MUC: Added room:set_moderated(boolean) and room:is_moderated().
authorWaqas Hussain <waqas20@gmail.com>
Sun, 13 Jun 2010 20:08:51 +0500
changeset 3250 38402e874b45
parent 3249 95daf6398dbb
child 3251 f2f9fe088f6e
MUC: Added room:set_moderated(boolean) and room:is_moderated().
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;