Commit 0dfc7994 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Send room invitation if the room is members-only and the user was not a member.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@483 b35dd754-fafc-0310-a699-88a17e54d16e
parent 9f60547f
......@@ -244,7 +244,14 @@ public class IQOwnerHandler {
}
else if ("member".equals(targetAffiliation)) {
// Add the new user as a member of the room
boolean hadAffiliation = room.getAffiliation(bareJID) != MUCRole.NONE;
presences.addAll(room.addMember(bareJID, null, senderRole));
// If the user had an affiliation don't send an invitation. Otherwise
// send an invitation if the room is members-only
if (!hadAffiliation && room.isInvitationRequiredToEnter()) {
room.sendInvitation(bareJID, null, senderRole, reply
.getOriginatingSession());
}
}
else if ("none".equals(targetAffiliation)) {
// Set that this jid has a NONE affiliation
......
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