|
|
|
@ -60,7 +60,7 @@ public class MessageSend_p {
|
|
|
|
|
final serverObjects prop = new serverObjects();
|
|
|
|
|
|
|
|
|
|
if ((post == null) || (post.get("hash","").isEmpty())) {
|
|
|
|
|
prop.put("mode", "2");
|
|
|
|
|
prop.put("mode", "3");
|
|
|
|
|
return prop;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -78,6 +78,7 @@ public class MessageSend_p {
|
|
|
|
|
// open an editor page for the message
|
|
|
|
|
// first ask if the other peer is online, and also what kind of document it accepts
|
|
|
|
|
Seed seed = sb.peers.getConnected(ASCII.getBytes(hash));
|
|
|
|
|
if (seed != null) {
|
|
|
|
|
for (String ip : seed.getIPs()) {
|
|
|
|
|
final Map<String, String> result = Protocol.permissionMessage(seed.getPublicAddress(ip), hash);
|
|
|
|
|
//System.out.println("DEBUG: permission request result = " + result.toString());
|
|
|
|
@ -87,11 +88,12 @@ public class MessageSend_p {
|
|
|
|
|
peerName = sb.peers.mySeed().get(Seed.NAME, "nameless");
|
|
|
|
|
} else {
|
|
|
|
|
targetPeer = sb.peers.getConnected(hash);
|
|
|
|
|
if (targetPeer == null)
|
|
|
|
|
if (targetPeer == null) {
|
|
|
|
|
peerName = "nameless";
|
|
|
|
|
else
|
|
|
|
|
} else {
|
|
|
|
|
peerName = targetPeer.get(Seed.NAME, "nameless");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
prop.putXML("mode_permission_peerName", peerName);
|
|
|
|
|
final String response = (result == null) ? null : result.get("response");
|
|
|
|
@ -125,6 +127,10 @@ public class MessageSend_p {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else { // seed == null
|
|
|
|
|
prop.put("mode_permission", "0");
|
|
|
|
|
prop.putXML("mode_permission_peerName", "a passive peer");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
prop.put("mode", "2");
|
|
|
|
|
// send written message to peer
|
|
|
|
|