Software /
code /
prosody
Comparison
plugins/muc/mod_muc.lua @ 5984:c68e2b11d691
MUC: Expose room metatable on module
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 18 Jan 2014 18:28:50 +0100 |
parent | 5945:51ead0aa3a02 |
child | 6000:0f6399c86c10 |
comparison
equal
deleted
inserted
replaced
5983:930109558aa2 | 5984:c68e2b11d691 |
---|---|
50 | 50 |
51 local function is_admin(jid) | 51 local function is_admin(jid) |
52 return um_is_admin(jid, module.host); | 52 return um_is_admin(jid, module.host); |
53 end | 53 end |
54 | 54 |
55 local _set_affiliation = muc_new_room.room_mt.set_affiliation; | 55 room_mt = muclib.room_mt; -- Yes, global. |
56 local _get_affiliation = muc_new_room.room_mt.get_affiliation; | 56 local _set_affiliation = room_mt.set_affiliation; |
57 local _get_affiliation = room_mt.get_affiliation; | |
57 function muclib.room_mt:get_affiliation(jid) | 58 function muclib.room_mt:get_affiliation(jid) |
58 if is_admin(jid) then return "owner"; end | 59 if is_admin(jid) then return "owner"; end |
59 return _get_affiliation(self, jid); | 60 return _get_affiliation(self, jid); |
60 end | 61 end |
61 function muclib.room_mt:set_affiliation(actor, jid, affiliation, callback, reason) | 62 function muclib.room_mt:set_affiliation(actor, jid, affiliation, callback, reason) |