From acd62439c3442630de3bd59ee1cdd3dcad6dd522 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sun, 13 Jun 2010 20:37:09 +0500 Subject: MUC: Added room:set_members_only(boolean) and room:is_members_only(). --- plugins/muc/muc.lib.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'plugins/muc') diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index fe56d2c2..1e8b31e3 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -261,6 +261,16 @@ end function room_mt:is_moderated() return self._data.moderated; end +function room_mt:set_members_only(members_only) + members_only = members_only and true or nil; + if self._data.members_only ~= members_only then + self._data.members_only = members_only; + if self.save then self:save(true); end + end +end +function room_mt:is_members_only() + return self._data.members_only; +end function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc local from, to = stanza.attr.from, stanza.attr.to; -- cgit v1.2.3