Commit dcb584ee authored by Thomas's avatar Thomas
Browse files

Fix solarized

parent 8dedd7a9
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -150,9 +150,7 @@ public class MastodonListActivity extends BaseBarActivity implements MastodonLis
                timelinesVM.getAccountsInList(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, mastodonList.id, null, null, 0)
                        .observe(MastodonListActivity.this, accounts -> {
                            if (accounts != null && accounts.size() > 0) {
                                for (Account account : accounts) {
                                    accountsVM.muteHome(MainActivity.currentAccount, account);
                                }
                                accountsVM.muteAccountsHome(MainActivity.currentAccount, accounts);
                            }
                        });
                dialog.dismiss();
+26 −1
Original line number Diff line number Diff line
@@ -813,7 +813,6 @@ public class AccountsVM extends AndroidViewModel {
    public LiveData<Account> muteHome(@NonNull BaseAccount forAccount, @NonNull Account target) {
        accountMutableLiveData = new MutableLiveData<>();
        new Thread(() -> {

            try {
                new MutedAccounts(getApplication().getApplicationContext()).muteAccount(forAccount, target);
                addMutedAccount(target);
@@ -828,6 +827,32 @@ public class AccountsVM extends AndroidViewModel {
        return accountMutableLiveData;
    }


    /**
     * Mute the given account in db
     *
     * @return {@link LiveData} containing the {@link Account} to the given account
     */
    public LiveData<List<Account>> muteAccountsHome(@NonNull BaseAccount forAccount, @NonNull List<Account> targets) {
        accountListMutableLiveData = new MutableLiveData<>();
        new Thread(() -> {
            try {
                for (Account target : targets) {
                    new MutedAccounts(getApplication().getApplicationContext()).muteAccount(forAccount, target);
                    sendAction(getApplication().getApplicationContext(), Helper.ARG_STATUS_ACCOUNT_ID_DELETED, null, target.id);
                    addMutedAccount(target);
                }
            } catch (DBException e) {
                e.printStackTrace();
            }
            Handler mainHandler = new Handler(Looper.getMainLooper());
            Runnable myRunnable = () -> accountListMutableLiveData.setValue(targets);
            mainHandler.post(myRunnable);
        }).start();
        return accountListMutableLiveData;
    }


    /**
     * Unmute the given account in db
     *