From 169631f6efad436416fceaf9970bb16de4abc7e5 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sun, 13 Jun 2010 19:19:03 +0500 Subject: MUC: Added a password field to the room config dialog. --- plugins/muc/muc.lib.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'plugins') 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)); -- cgit v1.2.3