Bounce message corrections

On IRC it is confusing when an XMPP user "corrects" a message, but on
the other side a new message is sent. To prevent spam and confusion, do
not allow message corrections at all, and instead return an error if
attempted.

Fixes: #3436
Fixes: #3480
This commit is contained in:
Luca Matei Pintilie
2025-10-12 17:48:33 +02:00
committed by mathieui
parent 5cb2802fd2
commit 9c92f7ce4a
4 changed files with 22 additions and 0 deletions
+9
View File
@@ -295,6 +295,15 @@ void BiboumiComponent::handle_message(const Stanza& stanza)
error_type, error_name, error_text);
});
const XmlNode* body = stanza.get_child("body", COMPONENT_NS);
const XmlNode* replace = stanza.get_child("replace", MESSAGE_CORRECT_NS);
if (replace)
{
error_type = "cancel";
error_name = "feature-not-implemented";
error_text = "This room is mapped from IRC, which does not support message correction.";
return;
}
try { // catch IRCNotConnected exceptions
if (type == "groupchat" && iid.type == Iid::Type::Channel)
+1
View File
@@ -39,6 +39,7 @@
#define STABLE_ID_NS "urn:xmpp:sid:0"
#define STABLE_MUC_ID_NS "http://jabber.org/protocol/muc#stable_id"
#define SELF_PING_FLAG MUC_NS"#self-ping-optimization"
#define MESSAGE_CORRECT_NS "urn:xmpp:message-correct:0"
/**
* An XMPP component, communicating with an XMPP server using the protocole