More account/post actions
This commit is contained in:
@@ -4,8 +4,20 @@ import org.joinmastodon.android.api.MastodonAPIRequest;
|
||||
import org.joinmastodon.android.model.Relationship;
|
||||
|
||||
public class SetAccountFollowed extends MastodonAPIRequest<Relationship>{
|
||||
public SetAccountFollowed(String id, boolean followed){
|
||||
public SetAccountFollowed(String id, boolean followed, boolean showReblogs){
|
||||
super(HttpMethod.POST, "/accounts/"+id+"/"+(followed ? "follow" : "unfollow"), Relationship.class);
|
||||
setRequestBody(new Object());
|
||||
if(followed)
|
||||
setRequestBody(new Request(showReblogs, null));
|
||||
else
|
||||
setRequestBody(new Object());
|
||||
}
|
||||
|
||||
private static class Request{
|
||||
public Boolean reblogs, notify;
|
||||
|
||||
public Request(Boolean reblogs, Boolean notify){
|
||||
this.reblogs=reblogs;
|
||||
this.notify=notify;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.joinmastodon.android.api.requests.accounts;
|
||||
|
||||
import org.joinmastodon.android.api.MastodonAPIRequest;
|
||||
|
||||
public class SetDomainBlocked extends MastodonAPIRequest<Object>{
|
||||
public SetDomainBlocked(String domain, boolean blocked){
|
||||
super(blocked ? HttpMethod.POST : HttpMethod.DELETE, "/domain_blocks", Object.class);
|
||||
setRequestBody(new Request(domain));
|
||||
}
|
||||
|
||||
private static class Request{
|
||||
public String domain;
|
||||
|
||||
public Request(String domain){
|
||||
this.domain=domain;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user