Commit ff7b99cf authored by Dave Cridland's avatar Dave Cridland

Merge pull request #410 from tevans/pubsub

Simplify and shorten pubsub message id
parents 7018ba41 0535aa41
...@@ -37,7 +37,6 @@ import org.jivesoftware.openfire.entitycaps.EntityCapabilities; ...@@ -37,7 +37,6 @@ import org.jivesoftware.openfire.entitycaps.EntityCapabilities;
import org.jivesoftware.openfire.entitycaps.EntityCapabilitiesManager; import org.jivesoftware.openfire.entitycaps.EntityCapabilitiesManager;
import org.jivesoftware.openfire.pubsub.CollectionNode; import org.jivesoftware.openfire.pubsub.CollectionNode;
import org.jivesoftware.openfire.pubsub.DefaultNodeConfiguration; import org.jivesoftware.openfire.pubsub.DefaultNodeConfiguration;
import org.jivesoftware.openfire.pubsub.LeafNode;
import org.jivesoftware.openfire.pubsub.Node; import org.jivesoftware.openfire.pubsub.Node;
import org.jivesoftware.openfire.pubsub.NodeSubscription; import org.jivesoftware.openfire.pubsub.NodeSubscription;
import org.jivesoftware.openfire.pubsub.PendingSubscriptionsCommand; import org.jivesoftware.openfire.pubsub.PendingSubscriptionsCommand;
...@@ -331,7 +330,7 @@ public class PEPService implements PubSubService, Cacheable { ...@@ -331,7 +330,7 @@ public class PEPService implements PubSubService, Cacheable {
message.setFrom(getAddress()); message.setFrom(getAddress());
for (JID jid : jids) { for (JID jid : jids) {
message.setTo(jid); message.setTo(jid);
message.setID(node.getNodeID() + "__" + jid.toBareJID() + "__" + StringUtils.randomString(5)); message.setID(StringUtils.randomString(8));
router.route(message); router.route(message);
} }
} }
...@@ -340,7 +339,7 @@ public class PEPService implements PubSubService, Cacheable { ...@@ -340,7 +339,7 @@ public class PEPService implements PubSubService, Cacheable {
public void sendNotification(Node node, Message message, JID recipientJID) { public void sendNotification(Node node, Message message, JID recipientJID) {
message.setTo(recipientJID); message.setTo(recipientJID);
message.setFrom(getAddress()); message.setFrom(getAddress());
message.setID(node.getNodeID() + "__" + recipientJID.toBareJID() + "__" + StringUtils.randomString(5)); message.setID(StringUtils.randomString(8));
// If the recipient subscribed with a bare JID and this PEPService can retrieve // If the recipient subscribed with a bare JID and this PEPService can retrieve
// presence information for the recipient, collect all of their full JIDs and // presence information for the recipient, collect all of their full JIDs and
......
...@@ -723,8 +723,7 @@ public class PubSubModule extends BasicModule implements ServerItemsProvider, Di ...@@ -723,8 +723,7 @@ public class PubSubModule extends BasicModule implements ServerItemsProvider, Di
message.setFrom(getAddress()); message.setFrom(getAddress());
for (JID jid : jids) { for (JID jid : jids) {
message.setTo(jid); message.setTo(jid);
message.setID( message.setID(StringUtils.randomString(8));
node.getNodeID() + "__" + jid.toBareJID() + "__" + StringUtils.randomString(5));
router.route(message); router.route(message);
} }
} }
...@@ -738,8 +737,7 @@ public class PubSubModule extends BasicModule implements ServerItemsProvider, Di ...@@ -738,8 +737,7 @@ public class PubSubModule extends BasicModule implements ServerItemsProvider, Di
public void sendNotification(Node node, Message message, JID jid) { public void sendNotification(Node node, Message message, JID jid) {
message.setFrom(getAddress()); message.setFrom(getAddress());
message.setTo(jid); message.setTo(jid);
message.setID( message.setID(StringUtils.randomString(8));
node.getNodeID() + "__" + jid.toBareJID() + "__" + StringUtils.randomString(5));
router.route(message); router.route(message);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment