From 446f28ac31b3758af44f8f929188a18cedc23ff5 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 19 Mar 2026 10:36:59 +0100 Subject: [PATCH] fix: Use tag for spam reporting (XEP-0377) Update `blocked_add` to use the `` tag with the `jabber:client` namespace when reporting spam, as specified in XEP-0377 Example 5. Other report types continue to use the `` tag. Fixes: https://github.com/profanity-im/profanity/issues/1971 --- src/xmpp/blocking.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/xmpp/blocking.c b/src/xmpp/blocking.c index 53575e8b..1d16fd8c 100644 --- a/src/xmpp/blocking.c +++ b/src/xmpp/blocking.c @@ -118,7 +118,12 @@ blocked_add(char* jid, blocked_report reportkind, const char* const message) if (message) { xmpp_stanza_t* text = xmpp_stanza_new(ctx); - xmpp_stanza_set_name(text, STANZA_NAME_TEXT); + if (reportkind == BLOCKED_REPORT_SPAM) { + xmpp_stanza_set_name(text, STANZA_NAME_BODY); + xmpp_stanza_set_ns(text, "jabber:client"); + } else { + xmpp_stanza_set_name(text, STANZA_NAME_TEXT); + } xmpp_stanza_t* txt = xmpp_stanza_new(ctx); xmpp_stanza_set_text(txt, message);