aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-11-25 23:47:49 +0100
committerKim Alvefur <zash@zash.se>2019-11-25 23:47:49 +0100
commit057fbeaf06876cfbfbba24bbc317de313fa9e84b (patch)
tree146d222219130d19c919221a1a8e4f8cf6f04201
parentbe23b274f685f5eac73b79231491f4f0141f1c1c (diff)
downloadprosody-057fbeaf06876cfbfbba24bbc317de313fa9e84b.tar.gz
prosody-057fbeaf06876cfbfbba24bbc317de313fa9e84b.zip
MUC: Indicate origin of password related errors
-rw-r--r--plugins/muc/password.lib.lua2
-rw-r--r--spec/scansion/muc_password.scs2
2 files changed, 2 insertions, 2 deletions
diff --git a/plugins/muc/password.lib.lua b/plugins/muc/password.lib.lua
index 1f4b2add..6695c0cf 100644
--- a/plugins/muc/password.lib.lua
+++ b/plugins/muc/password.lib.lua
@@ -50,7 +50,7 @@ module:hook("muc-occupant-pre-join", function(event)
if get_password(room) ~= password then
local from, to = stanza.attr.from, stanza.attr.to;
module:log("debug", "%s couldn't join due to invalid password: %s", from, to);
- local reply = st.error_reply(stanza, "auth", "not-authorized"):up();
+ local reply = st.error_reply(stanza, "auth", "not-authorized", nil, room.jid):up();
reply.tags[1].attr.code = "401";
event.origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"}));
return true;
diff --git a/spec/scansion/muc_password.scs b/spec/scansion/muc_password.scs
index 82611183..63c821e0 100644
--- a/spec/scansion/muc_password.scs
+++ b/spec/scansion/muc_password.scs
@@ -58,7 +58,7 @@ Juliet sends:
Juliet receives:
<presence from="room@conference.localhost/Juliet" type="error">
- <error type="auth" code="401">
+ <error type="auth" code="401" by="room@conference.localhost">
<not-authorized xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</presence>