From 1c8ba320bc8b1c64dfaff32e4debe740b6820213 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Thu, 8 Aug 2019 11:14:18 +0800 Subject: Refactored some of the untouched classes last time to support multi user. Bugs fixed related to subreddit selection in PostXXXActivity. --- app/src/main/java/Account/AccountDao.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'app/src/main/java/Account/AccountDao.java') diff --git a/app/src/main/java/Account/AccountDao.java b/app/src/main/java/Account/AccountDao.java index 8db57683..3052e2b5 100644 --- a/app/src/main/java/Account/AccountDao.java +++ b/app/src/main/java/Account/AccountDao.java @@ -22,12 +22,16 @@ public interface AccountDao { @Query("DELETE FROM accounts") void deleteAllAccounts(); - @Query("SELECT * FROM accounts WHERE username = :userName COLLATE NOCASE LIMIT 1") - LiveData getAccountLiveData(String userName); + @Query("SELECT * FROM accounts WHERE username = :username COLLATE NOCASE LIMIT 1") + LiveData getAccountLiveData(String username); - @Query("SELECT * FROM accounts WHERE username = :userName COLLATE NOCASE LIMIT 1") - Account getAccountData(String userName); + @Query("SELECT * FROM accounts WHERE username = :username COLLATE NOCASE LIMIT 1") + Account getAccountData(String username); @Query("SELECT * FROM accounts WHERE is_current_user = 1 LIMIT 1") Account getCurrentAccount(); + + @Query("UPDATE accounts SET profile_image_url = :profileImageUrl, banner_image_url = :bannerImageUrl, " + + "karma = :karma WHERE username = :username") + void updateAccountInfo(String username, String profileImageUrl, String bannerImageUrl, int karma); } -- cgit v1.2.3