Software /
code /
prosody
Comparison
plugins/muc/mod_muc.lua @ 6743:adf2fdf1264a
MUC: Prevent admins from being given affiliatons other than owner
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 25 Jun 2015 17:58:24 +0200 |
parent | 6742:6efeb801d62f |
child | 6744:79318d548465 |
comparison
equal
deleted
inserted
replaced
6742:6efeb801d62f | 6743:adf2fdf1264a |
---|---|
49 function muclib.room_mt:get_affiliation(jid) | 49 function muclib.room_mt:get_affiliation(jid) |
50 if is_admin(jid) then return "owner"; end | 50 if is_admin(jid) then return "owner"; end |
51 return _get_affiliation(self, jid); | 51 return _get_affiliation(self, jid); |
52 end | 52 end |
53 function muclib.room_mt:set_affiliation(actor, jid, affiliation, callback, reason) | 53 function muclib.room_mt:set_affiliation(actor, jid, affiliation, callback, reason) |
54 if is_admin(jid) then return nil, "modify", "not-acceptable"; end | 54 if affiliation ~= "owner" and is_admin(jid) then return nil, "modify", "not-acceptable"; end |
55 return _set_affiliation(self, actor, jid, affiliation, callback, reason); | 55 return _set_affiliation(self, actor, jid, affiliation, callback, reason); |
56 end | 56 end |
57 | 57 |
58 local function room_route_stanza(room, stanza) module:send(stanza); end | 58 local function room_route_stanza(room, stanza) module:send(stanza); end |
59 local function room_save(room, forced) | 59 local function room_save(room, forced) |