MUC: Added room:get_password() and room:set_password().

Sun, 13 Jun 2010 18:13:18 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Sun, 13 Jun 2010 18:13:18 +0500
changeset 3244
616a3bb2bad9
parent 3243
dc7131d4e189
child 3245
a8a4c87a4fbf

MUC: Added room:get_password() and room:set_password().

plugins/muc/muc.lib.lua file | annotate | diff | comparison | revisions
--- a/plugins/muc/muc.lib.lua	Sun Jun 13 04:07:38 2010 +0500
+++ b/plugins/muc/muc.lib.lua	Sun Jun 13 18:13:18 2010 +0500
@@ -236,6 +236,15 @@
 		:tag('status'):text(error_message);
 end
 
+function room_mt:set_password(password)
+	if password == "" or type(password) ~= "string" then password = nil; end
+	self._data.password = password;
+	return password;
+end
+function room_mt:get_password()
+	return self._data.password;
+end
+
 function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc
 	local from, to = stanza.attr.from, stanza.attr.to;
 	local room = jid_bare(to);

mercurial