Changeset

3254:a01c6411fdfb

MUC: Added room:set_members_only(boolean) and room:is_members_only().
author Waqas Hussain <waqas20@gmail.com>
date Sun, 13 Jun 2010 20:37:09 +0500 (2010-06-13)
parents 3253:23a30abcc76e
children 3255:6bffb5c63131
files plugins/muc/muc.lib.lua
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/muc.lib.lua	Sun Jun 13 20:29:27 2010 +0500
+++ b/plugins/muc/muc.lib.lua	Sun Jun 13 20:37:09 2010 +0500
@@ -261,6 +261,16 @@
 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;