Diff

plugins/muc/password.lib.lua @ 10447:b5fd1637f15c

MUC: Indicate origin of password related errors
author Kim Alvefur <zash@zash.se>
date Mon, 25 Nov 2019 23:47:49 +0100
parent 9455:c62c983b8be3
child 12027:5fb16f41f861
line wrap: on
line diff
--- a/plugins/muc/password.lib.lua	Mon Nov 25 20:59:36 2019 +0100
+++ b/plugins/muc/password.lib.lua	Mon Nov 25 23:47:49 2019 +0100
@@ -50,7 +50,7 @@
 	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;