Commit a2b1f7ee authored by 0xd9a's avatar 0xd9a
Browse files

Remove account from "Home muted" when unfollowing (#1306)

parent 5a1b750b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -684,6 +684,8 @@ public class ProfileActivity extends BaseActivity {
                                    this.relationship = relationShip;
                                    updateAccount();
                                });
                        if (BaseMainActivity.filteredAccounts != null && BaseMainActivity.filteredAccounts.contains(account))
                            accountsVM.unmuteHome(Helper.getCurrentAccount(this), account);
                        dialog.dismiss();
                    });
                    unfollowConfirm.show();
@@ -695,6 +697,8 @@ public class ProfileActivity extends BaseActivity {
                                this.relationship = relationShip;
                                updateAccount();
                            });
                    if (BaseMainActivity.filteredAccounts != null && BaseMainActivity.filteredAccounts.contains(account))
                        accountsVM.unmuteHome(Helper.getCurrentAccount(this), account);
                }

            } else if (doAction == action.UNBLOCK) {
+12 −8
Original line number Diff line number Diff line
@@ -197,14 +197,18 @@ public class ReportActivity extends BaseBarActivity {
                            binding.groupMute.setVisibility(View.VISIBLE);
                        }
                    }
                    binding.actionUnfollow.setOnClickListener(v -> accountsVM.unfollow(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id)
                    binding.actionUnfollow.setOnClickListener(v -> {
                        accountsVM.unfollow(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id)
                                .observe(ReportActivity.this, rsUnfollow -> {
                                    if (rsUnfollow != null) {
                                        relationShip = rsUnfollow;
                                        Toasty.info(ReportActivity.this, getString(R.string.toast_unfollow), Toasty.LENGTH_LONG).show();
                                        binding.groupUnfollow.setVisibility(View.GONE);
                                    }
                            }));
                                });
                        if (BaseMainActivity.filteredAccounts != null && BaseMainActivity.filteredAccounts.contains(account))
                            accountsVM.unmuteHome(Helper.getCurrentAccount(this), account);
                    });
                    binding.actionMute.setOnClickListener(v -> accountsVM.mute(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id, null, null)
                            .observe(ReportActivity.this, rsMute -> {
                                if (rsMute != null) {
+2 −0
Original line number Diff line number Diff line
@@ -233,6 +233,8 @@ public class CrossActionHelper {
                assert accountsVM != null;
                accountsVM.unfollow(ownerAccount.instance, ownerAccount.token, targetedAccount.id)
                        .observe((LifecycleOwner) context, relationShip -> Toasty.info(context, context.getString(R.string.toast_unfollow), Toasty.LENGTH_SHORT).show());
                if (BaseMainActivity.filteredAccounts != null && BaseMainActivity.filteredAccounts.contains(targetedAccount))
                    accountsVM.unmuteHome(ownerAccount, targetedAccount);
            }
            case FAVOURITE_ACTION -> {
                assert statusesVM != null;
+4 −0
Original line number Diff line number Diff line
@@ -293,6 +293,8 @@ public class AccountAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
                                        account.relationShip = relationShip;
                                        adapter.notifyItemChanged(position);
                                    });
                            if (BaseMainActivity.filteredAccounts != null && BaseMainActivity.filteredAccounts.contains(account))
                                accountsVM.unmuteHome(Helper.getCurrentAccount(context), account).observe((LifecycleOwner) context, account1 -> adapter.notifyItemChanged(accountViewHolder.getLayoutPosition()));
                            dialog.dismiss();
                        });
                        unfollowConfirm.show();
@@ -302,6 +304,8 @@ public class AccountAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
                                    account.relationShip = relationShip;
                                    adapter.notifyItemChanged(position);
                                });
                        if (BaseMainActivity.filteredAccounts != null && BaseMainActivity.filteredAccounts.contains(account))
                            accountsVM.unmuteHome(Helper.getCurrentAccount(context), account).observe((LifecycleOwner) context, account1 -> adapter.notifyItemChanged(accountViewHolder.getLayoutPosition()));
                    }

                }