Merge with daurnimator
authorMatthew Wild <mwild1@gmail.com>
Thu, 17 Apr 2014 08:01:32 +0000 (09:01 +0100)
committerMatthew Wild <mwild1@gmail.com>
Thu, 17 Apr 2014 08:01:32 +0000 (09:01 +0100)
1  2 
plugins/muc/muc.lib.lua

index 8cf8d882e5895962a2a3e779267a52e9d6cc4e46,27c50cd48a74748473563f70dbd631772074b451..5debb4a36ada98541951e43ce976fd3878c5f432
@@@ -1031,8 -1264,8 +1264,8 @@@ function room_mt:can_set_role(actor_jid
  
        if actor_jid == true then return true; end
  
-       local actor = self._occupants[self._jid_nick[actor_jid]];
+       local actor = self._occupants[self:get_occupant_jid(actor_jid)];
 -      if actor.role == "moderator" then
 +      if actor and actor.role == "moderator" then
                if occupant.affiliation ~= "owner" and occupant.affiliation ~= "admin" then
                        if actor.affiliation == "owner" or actor.affiliation == "admin" then
                                return true;