MUC: Added room:set_hidden(boolean) and room:is_hidden().

Sun, 13 Jun 2010 21:54:47 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Sun, 13 Jun 2010 21:54:47 +0500
changeset 3261
fe1c93296abd
parent 3260
19b655a8671c
child 3262
330010ef078f

MUC: Added room:set_hidden(boolean) and room:is_hidden().

plugins/muc/muc.lib.lua file | annotate | diff | comparison | revisions
--- a/plugins/muc/muc.lib.lua	Sun Jun 13 21:43:53 2010 +0500
+++ b/plugins/muc/muc.lib.lua	Sun Jun 13 21:54:47 2010 +0500
@@ -285,6 +285,16 @@
 function room_mt:is_persistent()
 	return self._data.persistent;
 end
+function room_mt:set_hidden(hidden)
+	hidden = hidden and true or nil;
+	if self._data.hidden ~= hidden then
+		self._data.hidden = hidden;
+		if self.save then self:save(true); end
+	end
+end
+function room_mt:is_hidden()
+	return self._data.hidden;
+end
 
 function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc
 	local from, to = stanza.attr.from, stanza.attr.to;

mercurial