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
* </ul>
*
* @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
*/
private void initSession(Session session) throws UnauthorizedException, UserNotFoundException {
private void initSession(ClientSession session) throws UserNotFoundException {
// Only user sessions need to be authenticated
if (session.getAddress().getNode() != null && !"".equals(session.getAddress().getNode())) {
......@@ -192,10 +191,12 @@ public class PresenceUpdateHandler extends BasicModule implements ChannelHandler
presenceManager.probePresence(session.getAddress(), item.getJid());
}
}
// deliver offline messages if any
Collection<Message> messages = messageStore.getMessages(username);
for (Message message : messages) {
session.process(message);
if (session.canFloodOfflineMessages()) {
// deliver offline messages if any
Collection<OfflineMessage> messages = messageStore.getMessages(username, true);
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