mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-10-06 13:59:49 +02:00
Switch between all logged-in reddit accounts is available.
This commit is contained in:
@@ -35,6 +35,9 @@ public interface AccountDao {
|
||||
"karma = :karma WHERE username = :username")
|
||||
void updateAccountInfo(String username, String profileImageUrl, String bannerImageUrl, int karma);
|
||||
|
||||
@Query("SELECT * FROM accounts WHERE username != :username")
|
||||
LiveData<List<Account>> getAccountsExceptCurrentAccountLiveData(String username);
|
||||
@Query("SELECT * FROM accounts WHERE is_current_user = 0 ORDER BY username COLLATE NOCASE ASC")
|
||||
LiveData<List<Account>> getAccountsExceptCurrentAccountLiveData();
|
||||
|
||||
@Query("UPDATE accounts SET is_current_user = 1 WHERE username = :username")
|
||||
void markAccountCurrent(String username);
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ public class AccountRepository {
|
||||
AccountRepository(RedditDataRoomDatabase redditDataRoomDatabase, String username) {
|
||||
mAccountDao = redditDataRoomDatabase.accountDao();
|
||||
mAccountLiveData = mAccountDao.getAccountLiveData(username);
|
||||
mAccountsExceptCurrentAccountLiveData = mAccountDao.getAccountsExceptCurrentAccountLiveData(username);
|
||||
mAccountsExceptCurrentAccountLiveData = mAccountDao.getAccountsExceptCurrentAccountLiveData();
|
||||
}
|
||||
|
||||
LiveData<Account> getAccountLiveData() {
|
||||
|
Reference in New Issue
Block a user