Commit 136d9636 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Fixed #sendServerMessage. JM-262


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1266 b35dd754-fafc-0310-a699-88a17e54d16e
parent c13b386b
...@@ -406,9 +406,6 @@ public class SessionManager extends BasicModule { ...@@ -406,9 +406,6 @@ public class SessionManager extends BasicModule {
catch (UserNotFoundException e) { catch (UserNotFoundException e) {
// Do nothing since the session is anonymous (? - shouldn't happen) // Do nothing since the session is anonymous (? - shouldn't happen)
} }
catch (UnauthorizedException e) {
// Do nothing
}
} }
} }
...@@ -420,7 +417,7 @@ public class SessionManager extends BasicModule { ...@@ -420,7 +417,7 @@ public class SessionManager extends BasicModule {
* the notification. * the notification.
*/ */
private void broadcastPresenceToOtherResource(ClientSession session) private void broadcastPresenceToOtherResource(ClientSession session)
throws UserNotFoundException, UnauthorizedException { throws UserNotFoundException {
Presence presence = null; Presence presence = null;
Collection<ClientSession> availableSession; Collection<ClientSession> availableSession;
SessionMap sessionMap = sessions.get(session.getUsername()); SessionMap sessionMap = sessions.get(session.getUsername());
...@@ -500,9 +497,6 @@ public class SessionManager extends BasicModule { ...@@ -500,9 +497,6 @@ public class SessionManager extends BasicModule {
catch (UserNotFoundException e) { catch (UserNotFoundException e) {
// Do nothing since the session is anonymous // Do nothing since the session is anonymous
} }
catch (UnauthorizedException e) {
// Do nothing
}
} }
} }
...@@ -664,7 +658,7 @@ public class SessionManager extends BasicModule { ...@@ -664,7 +658,7 @@ public class SessionManager extends BasicModule {
// Initially Check preAuthenticated Sessions // Initially Check preAuthenticated Sessions
session = preAuthenticatedSessions.get(buf.toString()); session = preAuthenticatedSessions.get(buf.toString());
if(session != null){ if(session != null){
return (ClientSession)session; return session;
} }
if (resource == null) { if (resource == null) {
...@@ -682,9 +676,6 @@ public class SessionManager extends BasicModule { ...@@ -682,9 +676,6 @@ public class SessionManager extends BasicModule {
} }
} }
} }
if (session == null) {
return null;
}
return session; return session;
} }
...@@ -1093,15 +1084,11 @@ public class SessionManager extends BasicModule { ...@@ -1093,15 +1084,11 @@ public class SessionManager extends BasicModule {
public void sendServerMessage(String subject, String body) { public void sendServerMessage(String subject, String body) {
try { sendServerMessage(null, subject, body);
sendServerMessage(null, subject, body);
}
catch (SessionNotFoundException e) {
}
} }
public void sendServerMessage(JID address, String subject, String body) throws SessionNotFoundException { public void sendServerMessage(JID address, String subject, String body) {
Packet packet = createServerMessage(subject, body); Message packet = createServerMessage(subject, body);
try { try {
if (address == null || address.getNode() == null || address.getNode().length() < 1) { if (address == null || address.getNode() == null || address.getNode().length() < 1) {
broadcast(packet); broadcast(packet);
...@@ -1110,14 +1097,14 @@ public class SessionManager extends BasicModule { ...@@ -1110,14 +1097,14 @@ public class SessionManager extends BasicModule {
userBroadcast(address.getNode(), packet); userBroadcast(address.getNode(), packet);
} }
else { else {
getSession(address).process(packet); router.route(packet);
} }
} }
catch (Exception e) { catch (UnauthorizedException e) {
} }
} }
private Packet createServerMessage(String subject, String body) { private Message createServerMessage(String subject, String body) {
Message message = new Message(); Message message = new Message();
message.setFrom(serverAddress); message.setFrom(serverAddress);
if (subject != null) { if (subject != 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