From 24abf9d3177213ba6af6a308d43190928a28fb13 Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Tue, 19 Sep 2023 13:20:38 -0300 Subject: [PATCH] refactor(mute-conversations-toggle): remove unused method --- .../api/StatusInteractionController.java | 32 ------------------- 1 file changed, 32 deletions(-) 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)); - } }