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$
* $Date$
*
......@@ -37,6 +37,7 @@ public class PresenceRouter extends BasicModule {
private PresenceSubscribeHandler subscribeHandler;
private PresenceManager presenceManager;
private SessionManager sessionManager;
private String serverName;
/**
* Constructs a presence router.
......@@ -79,11 +80,10 @@ public class PresenceRouter extends BasicModule {
// Presence updates (null is 'available')
if (type == null || Presence.Type.unavailable == type) {
// check for local server target
if (recipientJID == null
|| recipientJID.getDomain() == null
|| "".equals(recipientJID.getDomain())
|| (recipientJID.getNode() == null && recipientJID.getResource() == null)) {
if (recipientJID == null || recipientJID.getDomain() == null ||
"".equals(recipientJID.getDomain()) || (recipientJID.getNode() == null &&
recipientJID.getResource() == null) &&
serverName.equals(recipientJID.getDomain())) {
updateHandler.process(packet);
}
else {
......@@ -129,6 +129,7 @@ public class PresenceRouter extends BasicModule {
public void initialize(XMPPServer server) {
super.initialize(server);
serverName = server.getServerInfo().getName();
routingTable = server.getRoutingTable();
updateHandler = server.getPresenceUpdateHandler();
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