From bc5a1d35cbf5c1aca406fa0fe81ca60d6b280bd5 Mon Sep 17 00:00:00 2001 From: mesonium <93607429+mesonium@users.noreply.github.com> Date: Sat, 29 Jul 2023 14:02:38 +0200 Subject: fix: Add x node to MUC PM stanza (#1462) Add tag in MUC-PMs to support better Carbon delivery in compliance with XEP-0045 v1.28 and above. Fixes #1306 --- libdino/src/service/muc_manager.vala | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libdino/src/service') diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala index e2e13435..119079f0 100644 --- a/libdino/src/service/muc_manager.vala +++ b/libdino/src/service/muc_manager.vala @@ -54,6 +54,7 @@ public class MucManager : StreamInteractionModule, Object { } return true; }); + stream_interactor.get_module(MessageProcessor.IDENTITY).build_message_stanza.connect(on_build_message_stanza); } // already_autojoin: Without this flag we'd be retrieving bookmarks (to check for autojoin) from the sender on every join @@ -651,6 +652,12 @@ public class MucManager : StreamInteractionModule, Object { conference_removed(account, jid); } + private void on_build_message_stanza(Entities.Message message, Xmpp.MessageStanza message_stanza, Conversation conversation) { + if (conversation.type_ == Conversation.Type.GROUPCHAT_PM) { + Xmpp.Xep.Muc.add_muc_pm_message_stanza_x_node(message_stanza); + } + } + private void self_ping(Account account) { XmppStream? stream = stream_interactor.get_stream(account); if (stream == null) return; -- cgit v1.2.3-70-g09d2