aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-06-13 20:37:09 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-06-13 20:37:09 +0500
commitacd62439c3442630de3bd59ee1cdd3dcad6dd522 (patch)
tree0ffe2827400612e008f96e42eb2e365ff7e993c7 /plugins
parent209b90ef46b758f44d17e3770f0ee5064c38007f (diff)
downloadprosody-acd62439c3442630de3bd59ee1cdd3dcad6dd522.tar.gz
prosody-acd62439c3442630de3bd59ee1cdd3dcad6dd522.zip
MUC: Added room:set_members_only(boolean) and room:is_members_only().
Diffstat (limited to 'plugins')
-rw-r--r--plugins/muc/muc.lib.lua10
1 files changed, 10 insertions, 0 deletions
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;