mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-06-20 16:00:29 +00:00
Allow following a feed that isn't in rhizome yet, and override the displayed name
This commit is contained in:
@ -220,8 +220,8 @@ public class ServalDClient implements ServalDHttpConnectionFactory {
|
||||
return list;
|
||||
}
|
||||
|
||||
public int meshmbAlterSubscription(Subscriber id, MeshMBCommon.SubscriptionAction action, SigningKey peer) throws ServalDInterfaceException, IOException {
|
||||
return MeshMBCommon.alterSubscription(this, id, action, peer);
|
||||
public int meshmbAlterSubscription(Subscriber id, MeshMBCommon.SubscriptionAction action, Subscriber peer, String name) throws ServalDInterfaceException, IOException {
|
||||
return MeshMBCommon.alterSubscription(this, id, action, peer, name);
|
||||
}
|
||||
|
||||
public MeshMBSubscriptionList meshmbSubscriptions(Subscriber identity) throws IOException, ServalDInterfaceException {
|
||||
|
@ -9,6 +9,7 @@ import org.servalproject.servaldna.Subscriber;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.util.Vector;
|
||||
|
||||
/**
|
||||
* Created by jeremy on 5/10/16.
|
||||
@ -34,8 +35,15 @@ public class MeshMBCommon {
|
||||
return conn.getResponseCode();
|
||||
}
|
||||
|
||||
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());
|
||||
public static int alterSubscription(ServalDHttpConnectionFactory connector, Subscriber id, SubscriptionAction action, Subscriber peer, String name) throws ServalDInterfaceException, IOException {
|
||||
Vector<ServalDHttpConnectionFactory.QueryParam> parms = new Vector<>();
|
||||
parms.add(new ServalDHttpConnectionFactory.QueryParam("sender", peer.sid.toHex()));
|
||||
if (name!=null && !"".equals(name))
|
||||
parms.add(new ServalDHttpConnectionFactory.QueryParam("name", name));
|
||||
HttpURLConnection conn = connector.newServalDHttpConnection(
|
||||
"/restful/meshmb/"+id.signingKey.toHex()+"/"+peer.signingKey.toHex(),
|
||||
parms
|
||||
);
|
||||
conn.setRequestMethod("POST");
|
||||
conn.connect();
|
||||
return conn.getResponseCode();
|
||||
|
Reference in New Issue
Block a user