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,13 +191,15 @@ public class PresenceUpdateHandler extends BasicModule implements ChannelHandler ...@@ -192,13 +191,15 @@ public class PresenceUpdateHandler extends BasicModule implements ChannelHandler
presenceManager.probePresence(session.getAddress(), item.getJid()); presenceManager.probePresence(session.getAddress(), item.getJid());
} }
} }
if (session.canFloodOfflineMessages()) {
// deliver offline messages if any // deliver offline messages if any
Collection<Message> messages = messageStore.getMessages(username); Collection<OfflineMessage> messages = messageStore.getMessages(username, true);
for (Message message : messages) { for (Message message : messages) {
session.process(message); session.process(message);
} }
} }
} }
}
public Presence createSubscribePresence(JID senderAddress, boolean isSubscribe) { public Presence createSubscribePresence(JID senderAddress, boolean isSubscribe) {
Presence presence = new Presence(); Presence presence = new Presence();
......
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