Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 6049:6d410ffd6e13
MUC: Fixed traceback when a JID not in a room requested a role change for an occupant.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Tue, 01 Apr 2014 10:02:58 -0400 |
| parents | 3ee3d79db18c |
| children | 7a5ddbaf758d f755e0bdc60a |
comparison
equal
deleted
inserted
replaced
| 6047:4db0403bfc0d | 6049:6d410ffd6e13 |
|---|---|
| 1058 if not occupant or not actor_jid then return nil, "modify", "not-acceptable"; end | 1058 if not occupant or not actor_jid then return nil, "modify", "not-acceptable"; end |
| 1059 | 1059 |
| 1060 if actor_jid == true then return true; end | 1060 if actor_jid == true then return true; end |
| 1061 | 1061 |
| 1062 local actor = self._occupants[self._jid_nick[actor_jid]]; | 1062 local actor = self._occupants[self._jid_nick[actor_jid]]; |
| 1063 if actor.role == "moderator" then | 1063 if actor and actor.role == "moderator" then |
| 1064 if occupant.affiliation ~= "owner" and occupant.affiliation ~= "admin" then | 1064 if occupant.affiliation ~= "owner" and occupant.affiliation ~= "admin" then |
| 1065 if actor.affiliation == "owner" or actor.affiliation == "admin" then | 1065 if actor.affiliation == "owner" or actor.affiliation == "admin" then |
| 1066 return true; | 1066 return true; |
| 1067 elseif occupant.role ~= "moderator" and role ~= "moderator" then | 1067 elseif occupant.role ~= "moderator" and role ~= "moderator" then |
| 1068 return true; | 1068 return true; |
