Software /
code /
prosody
Comparison
plugins/muc/mod_muc.lua @ 6741:bea3862b6bde
MUC: Remove half of monkeypatch that was supposed to make admins always be room owners, fixes #458
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 16 Jun 2015 15:13:47 +0200 |
parent | 5997:2d652afa57e4 |
child | 6742:6efeb801d62f |
comparison
equal
deleted
inserted
replaced
6691:c6c996410064 | 6741:bea3862b6bde |
---|---|
42 | 42 |
43 local function is_admin(jid) | 43 local function is_admin(jid) |
44 return um_is_admin(jid, module.host); | 44 return um_is_admin(jid, module.host); |
45 end | 45 end |
46 | 46 |
47 local _set_affiliation = muc_new_room.room_mt.set_affiliation; | |
48 local _get_affiliation = muc_new_room.room_mt.get_affiliation; | 47 local _get_affiliation = muc_new_room.room_mt.get_affiliation; |
49 function muclib.room_mt:get_affiliation(jid) | 48 function muclib.room_mt:get_affiliation(jid) |
50 if is_admin(jid) then return "owner"; end | 49 if is_admin(jid) then return "owner"; end |
51 return _get_affiliation(self, jid); | 50 return _get_affiliation(self, jid); |
52 end | |
53 function muclib.room_mt:set_affiliation(actor, jid, affiliation, callback, reason) | |
54 if is_admin(jid) then return nil, "modify", "not-acceptable"; end | |
55 return _set_affiliation(self, actor, jid, affiliation, callback, reason); | |
56 end | 51 end |
57 | 52 |
58 local function room_route_stanza(room, stanza) module:send(stanza); end | 53 local function room_route_stanza(room, stanza) module:send(stanza); end |
59 local function room_save(room, forced) | 54 local function room_save(room, forced) |
60 local node = jid_split(room.jid); | 55 local node = jid_split(room.jid); |