aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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));