Changeset

3258:bc07564bec6d

MUC: Added room:set_persistent(boolean) and room:is_persistent().
author Waqas Hussain <waqas20@gmail.com>
date Sun, 13 Jun 2010 21:38:31 +0500
parents 3257:fae054e15e03
children 3259:a5b9209efb23
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:55:07 2010 +0500
+++ b/plugins/muc/muc.lib.lua	Sun Jun 13 21:38:31 2010 +0500
@@ -274,6 +274,16 @@
 function room_mt:is_members_only()
 	return self._data.members_only;
 end
+function room_mt:set_persistent(persistent)
+	persistent = persistent and true or nil;
+	if self._data.persistent ~= persistent then
+		self._data.persistent = persistent;
+		if self.save then self:save(true); end
+	end
+end
+function room_mt:is_persistent()
+	return self._data.persistent;
+end
 
 function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc
 	local from, to = stanza.attr.from, stanza.attr.to;