Diff

plugins/muc/muc.lib.lua @ 3244:616a3bb2bad9

MUC: Added room:get_password() and room:set_password().
author Waqas Hussain <waqas20@gmail.com>
date Sun, 13 Jun 2010 18:13:18 +0500
parent 2985:fde53d82fde0
child 3245:a8a4c87a4fbf
line wrap: on
line diff
--- 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);