plugins/muc/muc.lib.lua
changeset 3446 9c0b3cd890e9
parent 3445 2fde9cb97f76
child 3506 0f46acca11cc
child 3507 b639042bb0d5
equal deleted inserted replaced
3445:2fde9cb97f76 3446:9c0b3cd890e9
   860 		end
   860 		end
   861 	end
   861 	end
   862 	local modified_nicks = {};
   862 	local modified_nicks = {};
   863 	for nick, occupant in pairs(self._occupants) do
   863 	for nick, occupant in pairs(self._occupants) do
   864 		if jid_bare(occupant.jid) == jid then
   864 		if jid_bare(occupant.jid) == jid then
       
   865 			t_insert(modified_nicks, nick);
   865 			if not role then -- getting kicked
   866 			if not role then -- getting kicked
   866 				self._occupants[nick] = nil;
   867 				self._occupants[nick] = nil;
   867 			else
   868 			else
   868 				t_insert(modified_nicks, nick);
       
   869 				occupant.affiliation, occupant.role = affiliation, role;
   869 				occupant.affiliation, occupant.role = affiliation, role;
   870 			end
   870 			end
   871 			p.attr.from = nick;
   871 			p.attr.from = nick;
   872 			for jid in pairs(occupant.sessions) do -- remove for all sessions of the nick
   872 			for jid in pairs(occupant.sessions) do -- remove for all sessions of the nick
   873 				if not role then self._jid_nick[jid] = nil; end
   873 				if not role then self._jid_nick[jid] = nil; end