You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by be...@apache.org on 2013/07/01 14:03:35 UTC

[6/8] git commit: VYSPER-344: deliver s2s presence subscription stanzas not to the initiating entity (the other server) but to the "from" entity which originally created the request. now subscription works in s2s.

VYSPER-344: deliver s2s presence subscription stanzas not to the initiating entity (the other server) but to the "from" entity which originally created the request. now subscription works in s2s.


Project: http://git-wip-us.apache.org/repos/asf/mina-vysper/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-vysper/commit/1226325c
Tree: http://git-wip-us.apache.org/repos/asf/mina-vysper/tree/1226325c
Diff: http://git-wip-us.apache.org/repos/asf/mina-vysper/diff/1226325c

Branch: refs/heads/master
Commit: 1226325c0d3744728d1536f814ded01844df1ca1
Parents: 2f95d01
Author: Bernd Fondermann <be...@brainlounge.de>
Authored: Mon Jul 1 12:50:35 2013 +0200
Committer: Bernd Fondermann <be...@brainlounge.de>
Committed: Mon Jul 1 12:50:35 2013 +0200

----------------------------------------------------------------------
 .../core/im/handler/PresenceSubscriptionHandler.java      | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-vysper/blob/1226325c/server/core/src/main/java/org/apache/vysper/xmpp/modules/core/im/handler/PresenceSubscriptionHandler.java
----------------------------------------------------------------------
diff --git a/server/core/src/main/java/org/apache/vysper/xmpp/modules/core/im/handler/PresenceSubscriptionHandler.java b/server/core/src/main/java/org/apache/vysper/xmpp/modules/core/im/handler/PresenceSubscriptionHandler.java
index d224e38..fc624ad 100644
--- a/server/core/src/main/java/org/apache/vysper/xmpp/modules/core/im/handler/PresenceSubscriptionHandler.java
+++ b/server/core/src/main/java/org/apache/vysper/xmpp/modules/core/im/handler/PresenceSubscriptionHandler.java
@@ -80,7 +80,15 @@ public class PresenceSubscriptionHandler extends AbstractPresenceSpecializedHand
         // (initiatingEntity)
         // or in case of multiple resources, use the from attribute or return an
         // error if the from attribute is not present.
-        Entity initiatingEntity = sessionContext == null ? null : sessionContext.getInitiatingEntity();
+        Entity initiatingEntity = null;
+        if (sessionContext != null) {
+            if (sessionContext.isServerToServer()) {
+                initiatingEntity = presenceStanza.getFrom();
+            } else {
+                initiatingEntity = sessionContext.getInitiatingEntity();
+            }
+        }
+        
         XMPPCoreStanzaVerifier verifier = presenceStanza.getCoreVerifier();
         ResourceRegistry registry = serverRuntimeContext.getResourceRegistry();