Mercurial > prosody-hg
comparison plugins/muc/mod_muc.lua @ 6742:6efeb801d62f
Backed out changeset bea3862b6bde in favor of a different approach
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 25 Jun 2015 17:54:19 +0200 |
| parents | bea3862b6bde |
| children | adf2fdf1264a |
comparison
equal
deleted
inserted
replaced
| 6741:bea3862b6bde | 6742:6efeb801d62f |
|---|---|
| 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; | |
| 47 local _get_affiliation = muc_new_room.room_mt.get_affiliation; | 48 local _get_affiliation = muc_new_room.room_mt.get_affiliation; |
| 48 function muclib.room_mt:get_affiliation(jid) | 49 function muclib.room_mt:get_affiliation(jid) |
| 49 if is_admin(jid) then return "owner"; end | 50 if is_admin(jid) then return "owner"; end |
| 50 return _get_affiliation(self, jid); | 51 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); | |
| 51 end | 56 end |
| 52 | 57 |
| 53 local function room_route_stanza(room, stanza) module:send(stanza); end | 58 local function room_route_stanza(room, stanza) module:send(stanza); end |
| 54 local function room_save(room, forced) | 59 local function room_save(room, forced) |
| 55 local node = jid_split(room.jid); | 60 local node = jid_split(room.jid); |
