aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-06-13 19:03:03 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-06-13 19:03:03 +0500
commit724e9bcad29b4d4bb75dee101d79e0504936f213 (patch)
treecb9d63951a38436386cc9205abf3bcbf909f862d /plugins/muc
parentaaa00bcfba6436abad4aa10dfa90059774549342 (diff)
downloadprosody-724e9bcad29b4d4bb75dee101d79e0504936f213.tar.gz
prosody-724e9bcad29b4d4bb75dee101d79e0504936f213.zip
MUC: Include a <password/> element in invites from password protected rooms.
Diffstat (limited to 'plugins/muc')
-rw-r--r--plugins/muc/muc.lib.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 4806e345..7c9d081b 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -706,8 +706,11 @@ function room_mt:handle_to_room(origin, stanza) -- presence changes and groupcha
:tag('x', {xmlns='http://jabber.org/protocol/muc#user'})
:tag('invite', {from=_from})
:tag('reason'):text(_reason or ""):up()
- :up()
- :up()
+ :up();
+ if self:get_password() then
+ invite:tag("password"):text(self:get_password()):up();
+ end
+ invite:up()
:tag('x', {xmlns="jabber:x:conference", jid=_to}) -- COMPAT: Some older clients expect this
:text(_reason or "")
:up()