MUC: Added a password field to the room config dialog.

Sun, 13 Jun 2010 19:19:03 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Sun, 13 Jun 2010 19:19:03 +0500
changeset 3248
f8d14ea3ad0e
parent 3247
ee8aaca3226c
child 3249
95daf6398dbb

MUC: Added a password field to the room config dialog.

plugins/muc/muc.lib.lua file | annotate | diff | comparison | revisions
--- a/plugins/muc/muc.lib.lua	Sun Jun 13 19:03:03 2010 +0500
+++ b/plugins/muc/muc.lib.lua	Sun Jun 13 19:19:03 2010 +0500
@@ -458,6 +458,9 @@
 				:tag("value"):text('anyone'):up()
 				:up()
 			:up()
+			:tag("field", {type='text-private', label='Password', var='muc#roomconfig_roomsecret'})
+				:tag("value"):text(self:get_password() or ""):up()
+			:up()
 	);
 end
 
@@ -505,6 +508,11 @@
 	self._data.whois = whois
 	module:log('debug', 'whois=%s', tostring(whois))
 
+	local password = fields['muc#roomconfig_roomsecret'];
+	if password then
+		self:set_password(password);
+	end
+
 	if self.save then self:save(true); end
 	origin.send(st.reply(stanza));
 

mercurial