aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/Account/AccountDao.java
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2019-08-08 03:14:18 +0000
committerAlex Ning <chineseperson5@gmail.com>2019-08-08 03:14:18 +0000
commit1c8ba320bc8b1c64dfaff32e4debe740b6820213 (patch)
treee727453e0ad694c0dce47828fe3b1cb4d28a36c9 /app/src/main/java/Account/AccountDao.java
parentb5c9e98ec902a062b947c1ca58d9c41f16dcdaa0 (diff)
downloadinfinity-for-reddit-1c8ba320bc8b1c64dfaff32e4debe740b6820213.tar
infinity-for-reddit-1c8ba320bc8b1c64dfaff32e4debe740b6820213.tar.gz
infinity-for-reddit-1c8ba320bc8b1c64dfaff32e4debe740b6820213.tar.bz2
infinity-for-reddit-1c8ba320bc8b1c64dfaff32e4debe740b6820213.tar.lz
infinity-for-reddit-1c8ba320bc8b1c64dfaff32e4debe740b6820213.tar.xz
infinity-for-reddit-1c8ba320bc8b1c64dfaff32e4debe740b6820213.tar.zst
infinity-for-reddit-1c8ba320bc8b1c64dfaff32e4debe740b6820213.zip
Refactored some of the untouched classes last time to support multi user. Bugs fixed related to subreddit selection in PostXXXActivity.
Diffstat (limited to 'app/src/main/java/Account/AccountDao.java')
-rw-r--r--app/src/main/java/Account/AccountDao.java12
1 files changed, 8 insertions, 4 deletions
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<Account> getAccountLiveData(String userName);
+ @Query("SELECT * FROM accounts WHERE username = :username COLLATE NOCASE LIMIT 1")
+ LiveData<Account> 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);
}