aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-06-13 19:19:03 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-06-13 19:19:03 +0500
commit169631f6efad436416fceaf9970bb16de4abc7e5 (patch)
treedbc0ddcf018d1feb8e29efb6e825865293567e47
parent724e9bcad29b4d4bb75dee101d79e0504936f213 (diff)
downloadprosody-169631f6efad436416fceaf9970bb16de4abc7e5.tar.gz
prosody-169631f6efad436416fceaf9970bb16de4abc7e5.zip
MUC: Added a password field to the room config dialog.
-rw-r--r--plugins/muc/muc.lib.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 7c9d081b..38e392b5 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -458,6 +458,9 @@ function room_mt:send_form(origin, stanza)
: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 @@ function room_mt:process_form(origin, stanza)
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));