fix: Use <body> tag for spam reporting (XEP-0377)

Update `blocked_add` to use the `<body>` tag with the `jabber:client`
namespace when reporting spam, as specified in XEP-0377 Example 5.
Other report types continue to use the `<text>` tag.

Fixes: https://github.com/profanity-im/profanity/issues/1971
This commit is contained in:
Michael Vetter
2026-03-19 10:36:59 +01:00
parent 9de455ceea
commit 446f28ac31

View File

@@ -118,7 +118,12 @@ blocked_add(char* jid, blocked_report reportkind, const char* const message)
if (message) { if (message) {
xmpp_stanza_t* text = xmpp_stanza_new(ctx); 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_t* txt = xmpp_stanza_new(ctx);
xmpp_stanza_set_text(txt, message); xmpp_stanza_set_text(txt, message);