# HG changeset patch # User Waqas Hussain # Date 1276441731 -18000 # Node ID 38402e874b451a6c4a137e3af8b8f90e15d221b4 # Parent 95daf6398dbb9e6f249df301ece0410426a41f24 MUC: Added room:set_moderated(boolean) and room:is_moderated(). diff -r 95daf6398dbb -r 38402e874b45 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Sun Jun 13 20:05:45 2010 +0500 +++ b/plugins/muc/muc.lib.lua Sun Jun 13 20:08:51 2010 +0500 @@ -248,6 +248,16 @@ function room_mt:get_password() return self._data.password; end +function room_mt:set_moderated(moderated) + moderated = moderated and true or nil; + if self._data.moderated ~= moderated then + self._data.moderated = + if self.save then self:save(true); end + end +end +function room_mt:is_moderated() + return self._data.moderated; +end function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc local from, to = stanza.attr.from, stanza.attr.to;