From 8fc9edd7e70aeca266ab2860198de49bdc2ab585 Mon Sep 17 00:00:00 2001 From: Bohdan Horbeshko Date: Tue, 1 Aug 2023 20:03:34 -0400 Subject: Prevent messages to a certain resource from being carbon-copied --- xmpp/gateway/gateway.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xmpp') diff --git a/xmpp/gateway/gateway.go b/xmpp/gateway/gateway.go index 7e54ee5..1be2fca 100644 --- a/xmpp/gateway/gateway.go +++ b/xmpp/gateway/gateway.go @@ -119,6 +119,9 @@ func sendMessageWrapper(to string, from string, body string, id string, componen message.Extensions = append(message.Extensions, extensions.NewReplyFallback(reply.Start, reply.End)) } } + if !isCarbon && toJid.Resource != "" { + message.Extensions = append(message.Extensions, stanza.HintNoCopy{}) + } if isCarbon { carbonMessage := extensions.ClientMessage{ -- cgit v1.2.3