Skip to content

Commit

Permalink
Merge pull request #263 from FineFindus/feat/mute-hashtag
Browse files Browse the repository at this point in the history
fix(hashtag/mute): update state on unmute
  • Loading branch information
LucasGGamerM authored Sep 25, 2023
2 parents 72ca3d0 + 53204a9 commit 9944185
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,27 @@ private void showMuteDialog(boolean mute) {
}
private void unmuteHashtag() {
//safe to get, this only called if filter is present
new DeleteFilter(filter.get().id).exec(accountID);
new DeleteFilter(filter.get().id).setCallback(new Callback<>(){
@Override
public void onSuccess(Void result){
updateMuteState(false);
}

@Override
public void onError(ErrorResponse error){
error.showToast(getContext());
}
}).exec(accountID);
}

private void muteHashtag() {
FilterKeyword hashtagFilter=new FilterKeyword();
hashtagFilter.wholeWord=true;
hashtagFilter.keyword="#"+hashtag;
new CreateFilter("#"+hashtag, EnumSet.of(FilterContext.HOME), FilterAction.HIDE, 0 , List.of(hashtagFilter)).setCallback(new Callback<Filter>(){
new CreateFilter("#"+hashtag, EnumSet.of(FilterContext.HOME), FilterAction.HIDE, 0 , List.of(hashtagFilter)).setCallback(new Callback<>(){
@Override
public void onSuccess(Filter result){
filter = Optional.of(result);
filter=Optional.of(result);
updateMuteState(true);
}

Expand Down

0 comments on commit 9944185

Please sign in to comment.