Commit 35d2feaa authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Added presence notification to room occupants when a user was kicked due to being idle for a while.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@211 b35dd754-fafc-0310-a699-88a17e54d16e
parent e235c69b
......@@ -197,15 +197,23 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
// Kick the user from all the rooms that he/she had previuosly joined
Iterator<MUCRole> roles = user.getRoles();
MUCRole role;
MUCRoom room;
Presence kickedPresence;
while (roles.hasNext()) {
role = roles.next();
room = role.getChatRoom();
try {
role.getChatRoom().kickOccupant(user.getAddress().toStringPrep(), null,
null);
kickedPresence =
room.kickOccupant(user.getAddress().toStringPrep(), null, null);
// Send the updated presence to the room occupants
room.send(kickedPresence);
}
catch (NotAllowedException e) {
// Do nothing since we cannot kick owners or admins
}
catch (UnauthorizedException e) {
// Do nothing
}
}
}
}
......
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