Comparison

plugins/muc/muc.lib.lua @ 1752:4db786919805

MUC: Added kicking support.
author Waqas Hussain <waqas20@gmail.com>
date Mon, 07 Sep 2009 20:48:16 +0500
parent 1751:55ee6e792e3e
child 1753:a84901db4085
comparison
equal deleted inserted replaced
1751:55ee6e792e3e 1752:4db786919805
486 function room_mt:get_role(nick) 486 function room_mt:get_role(nick)
487 local session = self._occupants[nick]; 487 local session = self._occupants[nick];
488 return session and session.role or nil; 488 return session and session.role or nil;
489 end 489 end
490 function room_mt:set_role(actor, nick, role, callback) 490 function room_mt:set_role(actor, nick, role, callback)
491 if role == "none" then role = nil; end
491 if role and role ~= "moderator" and role ~= "participant" and role ~= "visitor" then return nil, "modify", "not-acceptable"; end 492 if role and role ~= "moderator" and role ~= "participant" and role ~= "visitor" then return nil, "modify", "not-acceptable"; end
492 if self:get_affiliation(actor) ~= "owner" then return nil, "cancel", "not-allowed"; end 493 if self:get_affiliation(actor) ~= "owner" then return nil, "cancel", "not-allowed"; end
493 local occupant = self._occupants[nick]; 494 local occupant = self._occupants[nick];
494 if not occupant then return nil, "modify", "not-acceptable"; end 495 if not occupant then return nil, "modify", "not-acceptable"; end
495 if occupant.affiliation == "owner" or occupant.affiliation == "admin" then return nil, "cancel", "not-allowed"; end 496 if occupant.affiliation == "owner" or occupant.affiliation == "admin" then return nil, "cancel", "not-allowed"; end