# HG changeset patch # User Kim Alvefur # Date 1638996925 -3600 # Node ID 631b2afa7bc1eefe86fb6f50249df2a4f5c558a3 # Parent 9ab202e942f55b3f2f577472528fdbe4842ce04e MUC: Remove <{muc}x> tags in some errors Including the payload of the stanza that caused the error is optional and we're generally not doing it anywhere else. diff -r 9ab202e942f5 -r 631b2afa7bc1 plugins/muc/members_only.lib.lua --- a/plugins/muc/members_only.lib.lua Wed Dec 08 21:06:16 2021 +0100 +++ b/plugins/muc/members_only.lib.lua Wed Dec 08 21:55:25 2021 +0100 @@ -122,7 +122,7 @@ local affiliation = room:get_affiliation(stanza.attr.from); if valid_affiliations[affiliation or "none"] <= valid_affiliations.none then local reply = st.error_reply(stanza, "auth", "registration-required", nil, room.jid):up(); - event.origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); + event.origin.send(reply); return true; end end diff -r 9ab202e942f5 -r 631b2afa7bc1 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Wed Dec 08 21:06:16 2021 +0100 +++ b/plugins/muc/muc.lib.lua Wed Dec 08 21:55:25 2021 +0100 @@ -449,7 +449,7 @@ local affiliation = room:get_affiliation(stanza.attr.from); if affiliation == "outcast" then local reply = st.error_reply(stanza, "auth", "forbidden", nil, room.jid):up(); - event.origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); + event.origin.send(reply); return true; end end, -10); @@ -691,7 +691,7 @@ -- new nick or has different bare real jid log("debug", "%s couldn't join due to nick conflict: %s", real_jid, dest_occupant.nick); local reply = st.error_reply(stanza, "cancel", "conflict", nil, self.jid):up(); - origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); + origin.send(reply); return true; end diff -r 9ab202e942f5 -r 631b2afa7bc1 plugins/muc/password.lib.lua --- a/plugins/muc/password.lib.lua Wed Dec 08 21:06:16 2021 +0100 +++ b/plugins/muc/password.lib.lua Wed Dec 08 21:55:25 2021 +0100 @@ -51,7 +51,7 @@ 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", nil, room.jid):up(); - event.origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); + event.origin.send(reply); return true; end end, -20); diff -r 9ab202e942f5 -r 631b2afa7bc1 plugins/muc/register.lib.lua --- a/plugins/muc/register.lib.lua Wed Dec 08 21:06:16 2021 +0100 +++ b/plugins/muc/register.lib.lua Wed Dec 08 21:55:25 2021 +0100 @@ -85,7 +85,7 @@ 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", nil, room.jid):up(); - origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); + origin.send(reply); return true; end @@ -98,7 +98,7 @@ 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", nil, room.jid):up(); - origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); + origin.send(reply); return true; end end diff -r 9ab202e942f5 -r 631b2afa7bc1 spec/scansion/muc_register.scs --- a/spec/scansion/muc_register.scs Wed Dec 08 21:06:16 2021 +0100 +++ b/spec/scansion/muc_register.scs Wed Dec 08 21:55:25 2021 +0100 @@ -180,7 +180,6 @@ - # In a heated moment, Juliet unregisters from the room @@ -291,7 +290,6 @@ - # Juliet, however, quietly joins the room with success diff -r 9ab202e942f5 -r 631b2afa7bc1 spec/scansion/muc_show_offline.scs --- a/spec/scansion/muc_show_offline.scs Wed Dec 08 21:06:16 2021 +0100 +++ b/spec/scansion/muc_show_offline.scs Wed Dec 08 21:55:25 2021 +0100 @@ -185,7 +185,6 @@ - # In a heated moment, Juliet unregisters from the room @@ -296,7 +295,6 @@ - # Juliet, however, quietly joins the room with success