mirror of
https://github.com/Docile-Alligator/Infinity-For-Reddit.git
synced 2026-08-18 11:03:26 +00:00
Fix deleted users cannot be unfollowed in anonymous mode.
This commit is contained in:
@ -618,6 +618,44 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
|
||||
nsfwWarningBuilder.show();
|
||||
}
|
||||
}*/
|
||||
} else {
|
||||
if (Account.ANONYMOUS_ACCOUNT.equals(accountName)) {
|
||||
// Only for unfollowing deleted users in the anonymous mode
|
||||
CheckIsFollowingUser.checkIsFollowingUser(mExecutor, new Handler(), mRedditDataRoomDatabase,
|
||||
username, accountName, new CheckIsFollowingUser.CheckIsFollowingUserListener() {
|
||||
@Override
|
||||
public void isSubscribed() {
|
||||
binding.subscribeUserChipViewUserDetailActivity.setText(R.string.unfollow);
|
||||
binding.subscribeUserChipViewUserDetailActivity.setChipBackgroundColor(ColorStateList.valueOf(subscribedColor));
|
||||
binding.subscribeUserChipViewUserDetailActivity.setVisibility(View.VISIBLE);
|
||||
subscriptionReady = true;
|
||||
|
||||
binding.subscribeUserChipViewUserDetailActivity.setOnClickListener(view -> {
|
||||
if (subscriptionReady) {
|
||||
subscriptionReady = false;
|
||||
UserFollowing.anonymousUnfollowUser(mExecutor, new Handler(), username,
|
||||
mRedditDataRoomDatabase, new UserFollowing.UserFollowingListener() {
|
||||
@Override
|
||||
public void onUserFollowingSuccess() {
|
||||
binding.subscribeUserChipViewUserDetailActivity.setVisibility(View.GONE);
|
||||
showMessage(R.string.unfollowed, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserFollowingFail() {
|
||||
//Will not be called
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void isNotSubscribed() {
|
||||
// We don't care
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user