Commit 4c928967 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Modified to ensure that only session for local users are returned. JM-168


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@976 b35dd754-fafc-0310-a699-88a17e54d16e
parent 674009a7
......@@ -522,6 +522,10 @@ public class SessionManager extends BasicModule {
* @return The XMPPAddress best suited to use for delivery to the recipient
*/
public Session getBestRoute(JID recipient) {
// Return null if the JID belongs to a foreign server
if (!serverName.equals(recipient.getDomain())) {
return null;
}
ClientSession session = null;
String resource = recipient.getResource();
String username = recipient.getNode();
......@@ -598,11 +602,13 @@ public class SessionManager extends BasicModule {
/**
* Returns the session responsible for this JID.
*
* @param from the sender of the packet.
* @return the <code>Session</code> associated with the JID.
*/
public ClientSession getSession(JID from) {
if (from == null) {
// Return null if the JID is null or belongs to a foreign server
if (from == null || !serverName.equals(from.getDomain())) {
return null;
}
......
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