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
No known key found for this signature in database
GPG Key ID: 64873EE210FF8E6B
1 changed files with 2 additions and 1 deletions

View File

@ -6,7 +6,8 @@ import org.joinmastodon.android.model.Relationship;
public class SetAccountMuted extends MastodonAPIRequest<Relationship>{
public SetAccountMuted(String id, boolean muted, long duration){
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{