refactor: only add body for muting requests

This commit is contained in:
FineFindus
2024-04-02 19:34:26 +02:00
parent 56540d7e7b
commit 18f8c1d29e

View File

@@ -6,7 +6,8 @@ import org.joinmastodon.android.model.Relationship;
public class SetAccountMuted extends MastodonAPIRequest<Relationship>{ public class SetAccountMuted extends MastodonAPIRequest<Relationship>{
public SetAccountMuted(String id, boolean muted, long duration){ public SetAccountMuted(String id, boolean muted, long duration){
super(HttpMethod.POST, "/accounts/"+id+"/"+(muted ? "mute" : "unmute"), Relationship.class); super(HttpMethod.POST, "/accounts/"+id+"/"+(muted ? "mute" : "unmute"), Relationship.class);
setRequestBody(new Request(duration)); if(muted)
setRequestBody(new Request(duration, muteNotifications));
} }
private static class Request{ private static class Request{