# HG changeset patch # User Kim Alvefur # Date 1574722301 -3600 # Node ID cbe524ed1a6a3ef1a5f91f3df3640114061c7d27 # Parent b5fd1637f15cd49f04a8d8aadbc47f3d86ceb6ec MUC: Indicate origin of registration related errors diff -r b5fd1637f15c -r cbe524ed1a6a plugins/muc/register.lib.lua --- a/plugins/muc/register.lib.lua Mon Nov 25 23:47:49 2019 +0100 +++ b/plugins/muc/register.lib.lua Mon Nov 25 23:51:41 2019 +0100 @@ -66,7 +66,7 @@ local reserved_by = get_registered_jid(room, requested_nick); if reserved_by and reserved_by ~= jid_bare(stanza.attr.from) then module:log("debug", "%s attempted to use nick %s reserved by %s", stanza.attr.from, requested_nick, reserved_by); - local reply = st.error_reply(stanza, "cancel", "conflict"):up(); + local reply = st.error_reply(stanza, "cancel", "conflict", nil, room.jid):up(); origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); return true; end @@ -79,7 +79,7 @@ event.occupant.nick = jid_bare(event.occupant.nick) .. "/" .. nick; elseif event.dest_occupant.nick ~= jid_bare(event.dest_occupant.nick) .. "/" .. nick then module:log("debug", "Attempt by %s to join as %s, but their reserved nick is %s", stanza.attr.from, requested_nick, nick); - local reply = st.error_reply(stanza, "cancel", "not-acceptable"):up(); + local reply = st.error_reply(stanza, "cancel", "not-acceptable", nil, room.jid):up(); origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); return true; end @@ -103,7 +103,7 @@ local user_jid = jid_bare(stanza.attr.from) local affiliation = room:get_affiliation(user_jid); if affiliation == "outcast" then - origin.send(st.error_reply(stanza, "auth", "forbidden")); + origin.send(st.error_reply(stanza, "auth", "forbidden", room.jid)); return true; elseif not (affiliation or allow_unaffiliated) then origin.send(st.error_reply(stanza, "auth", "registration-required")); diff -r b5fd1637f15c -r cbe524ed1a6a spec/scansion/muc_register.scs --- a/spec/scansion/muc_register.scs Mon Nov 25 23:47:49 2019 +0100 +++ b/spec/scansion/muc_register.scs Mon Nov 25 23:51:41 2019 +0100 @@ -177,7 +177,7 @@ Rosaline receives: - + @@ -288,7 +288,7 @@ Rosaline receives: - +