mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-06-21 08:09:24 +00:00
Add API's for marking a feed as blocked
This commit is contained in:
@ -17,6 +17,12 @@ public class MeshMBCommon {
|
||||
|
||||
public static final String SERVICE = "MeshMB1";
|
||||
|
||||
public enum SubscriptionAction{
|
||||
Follow,
|
||||
Ignore,
|
||||
Block
|
||||
}
|
||||
|
||||
public static int sendMessage(ServalDHttpConnectionFactory connector, SigningKey id, String text) throws IOException, ServalDInterfaceException {
|
||||
HttpURLConnection conn = connector.newServalDHttpConnection("/restful/meshmb/" + id.toHex() + "/sendmessage");
|
||||
PostHelper helper = new PostHelper(conn);
|
||||
@ -28,15 +34,8 @@ public class MeshMBCommon {
|
||||
return conn.getResponseCode();
|
||||
}
|
||||
|
||||
public static int ignore(ServalDHttpConnectionFactory connector, Subscriber id, SigningKey peer) throws ServalDInterfaceException, IOException {
|
||||
HttpURLConnection conn = connector.newServalDHttpConnection("/restful/meshmb/" + id.signingKey.toHex() + "/ignore/" + peer.toHex());
|
||||
conn.setRequestMethod("POST");
|
||||
conn.connect();
|
||||
return conn.getResponseCode();
|
||||
}
|
||||
|
||||
public static int follow(ServalDHttpConnectionFactory connector, Subscriber id, SigningKey peer) throws ServalDInterfaceException, IOException {
|
||||
HttpURLConnection conn = connector.newServalDHttpConnection("/restful/meshmb/" + id.signingKey.toHex() + "/follow/" + peer.toHex());
|
||||
public static int alterSubscription(ServalDHttpConnectionFactory connector, Subscriber id, SubscriptionAction action, SigningKey peer) throws ServalDInterfaceException, IOException {
|
||||
HttpURLConnection conn = connector.newServalDHttpConnection("/restful/meshmb/" + id.signingKey.toHex() + "/"+action.toString().toLowerCase()+"/" + peer.toHex());
|
||||
conn.setRequestMethod("POST");
|
||||
conn.connect();
|
||||
return conn.getResponseCode();
|
||||
|
Reference in New Issue
Block a user