diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/StatusInteractionController.java b/mastodon/src/main/java/org/joinmastodon/android/api/StatusInteractionController.java index 69d96cd42..f8fef64bb 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/StatusInteractionController.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/StatusInteractionController.java @@ -137,36 +137,4 @@ public class StatusInteractionController{ status.bookmarked=bookmarked; if (updateCounters) E.post(new StatusCountersUpdatedEvent(status)); } - - public void setMuted(Status status, boolean muted, Consumer cb){ - if(!Looper.getMainLooper().isCurrentThread()) - throw new IllegalStateException("Can only be called from main thread"); - - SetStatusMuted current=runningMuteRequests.remove(status.id); - if(current!=null){ - current.cancel(); - } - SetStatusMuted req=(SetStatusMuted) new SetStatusMuted(status.id, muted) - .setCallback(new Callback<>(){ - @Override - public void onSuccess(Status result){ - runningMuteRequests.remove(status.id); - cb.accept(result); - if (updateCounters) E.post(new StatusCountersUpdatedEvent(result)); - } - - @Override - public void onError(ErrorResponse error){ - runningMuteRequests.remove(status.id); - error.showToast(MastodonApp.context); - status.muted=!muted; - cb.accept(status); - if (updateCounters) E.post(new StatusCountersUpdatedEvent(status)); - } - }) - .exec(accountID); - runningMuteRequests.put(status.id, req); - status.muted=muted; - if (updateCounters) E.post(new StatusCountersUpdatedEvent(status)); - } }