refactor(mute-conversations-toggle): remove unused method
This commit is contained in:
@@ -137,36 +137,4 @@ public class StatusInteractionController{
|
|||||||
status.bookmarked=bookmarked;
|
status.bookmarked=bookmarked;
|
||||||
if (updateCounters) E.post(new StatusCountersUpdatedEvent(status));
|
if (updateCounters) E.post(new StatusCountersUpdatedEvent(status));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMuted(Status status, boolean muted, Consumer<Status> 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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user