Commit 04c62463 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Check if the user should be flood with offline messages. JM-8


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1698 b35dd754-fafc-0310-a699-88a17e54d16e
parent e37c311a
...@@ -171,10 +171,9 @@ public class PresenceUpdateHandler extends BasicModule implements ChannelHandler ...@@ -171,10 +171,9 @@ public class PresenceUpdateHandler extends BasicModule implements ChannelHandler
* </ul> * </ul>
* *
* @param session The session being updated * @param session The session being updated
* @throws UnauthorizedException If the caller doesn't have the right permissions
* @throws UserNotFoundException If the user being updated does not exist * @throws UserNotFoundException If the user being updated does not exist
*/ */
private void initSession(Session session) throws UnauthorizedException, UserNotFoundException { private void initSession(ClientSession session) throws UserNotFoundException {
// Only user sessions need to be authenticated // Only user sessions need to be authenticated
if (session.getAddress().getNode() != null && !"".equals(session.getAddress().getNode())) { if (session.getAddress().getNode() != null && !"".equals(session.getAddress().getNode())) {
...@@ -192,10 +191,12 @@ public class PresenceUpdateHandler extends BasicModule implements ChannelHandler ...@@ -192,10 +191,12 @@ public class PresenceUpdateHandler extends BasicModule implements ChannelHandler
presenceManager.probePresence(session.getAddress(), item.getJid()); presenceManager.probePresence(session.getAddress(), item.getJid());
} }
} }
// deliver offline messages if any if (session.canFloodOfflineMessages()) {
Collection<Message> messages = messageStore.getMessages(username); // deliver offline messages if any
for (Message message : messages) { Collection<OfflineMessage> messages = messageStore.getMessages(username, true);
session.process(message); for (Message message : messages) {
session.process(message);
}
} }
} }
} }
......
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