Commit 357b0d00 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Fixed routing of presences of type available/unavailable sent to components. JM-375

git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@2705 b35dd754-fafc-0310-a699-88a17e54d16e
parent 54927244
/** /**
* $RCSfile$ * $RCSfile: PresenceRouter.java,v $
* $Revision$ * $Revision$
* $Date$ * $Date$
* *
...@@ -37,6 +37,7 @@ public class PresenceRouter extends BasicModule { ...@@ -37,6 +37,7 @@ public class PresenceRouter extends BasicModule {
private PresenceSubscribeHandler subscribeHandler; private PresenceSubscribeHandler subscribeHandler;
private PresenceManager presenceManager; private PresenceManager presenceManager;
private SessionManager sessionManager; private SessionManager sessionManager;
private String serverName;
/** /**
* Constructs a presence router. * Constructs a presence router.
...@@ -79,11 +80,10 @@ public class PresenceRouter extends BasicModule { ...@@ -79,11 +80,10 @@ public class PresenceRouter extends BasicModule {
// Presence updates (null is 'available') // Presence updates (null is 'available')
if (type == null || Presence.Type.unavailable == type) { if (type == null || Presence.Type.unavailable == type) {
// check for local server target // check for local server target
if (recipientJID == null if (recipientJID == null || recipientJID.getDomain() == null ||
|| recipientJID.getDomain() == null "".equals(recipientJID.getDomain()) || (recipientJID.getNode() == null &&
|| "".equals(recipientJID.getDomain()) recipientJID.getResource() == null) &&
|| (recipientJID.getNode() == null && recipientJID.getResource() == null)) { serverName.equals(recipientJID.getDomain())) {
updateHandler.process(packet); updateHandler.process(packet);
} }
else { else {
...@@ -129,6 +129,7 @@ public class PresenceRouter extends BasicModule { ...@@ -129,6 +129,7 @@ public class PresenceRouter extends BasicModule {
public void initialize(XMPPServer server) { public void initialize(XMPPServer server) {
super.initialize(server); super.initialize(server);
serverName = server.getServerInfo().getName();
routingTable = server.getRoutingTable(); routingTable = server.getRoutingTable();
updateHandler = server.getPresenceUpdateHandler(); updateHandler = server.getPresenceUpdateHandler();
subscribeHandler = server.getPresenceSubscribeHandler(); subscribeHandler = server.getPresenceSubscribeHandler();
......
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