Prevent messages to a certain resource from being carbon-copied

This commit is contained in:
Bohdan Horbeshko 2023-08-01 20:03:34 -04:00
parent a5f6c60035
commit 8fc9edd7e7
3 changed files with 5 additions and 2 deletions

View file

@ -2,7 +2,7 @@
COMMIT := $(shell git rev-parse --short HEAD) COMMIT := $(shell git rev-parse --short HEAD)
TD_COMMIT := "8517026415e75a8eec567774072cbbbbb52376c1" TD_COMMIT := "8517026415e75a8eec567774072cbbbbb52376c1"
VERSION := "v1.7.1" VERSION := "v1.7.2"
MAKEOPTS := "-j4" MAKEOPTS := "-j4"
all: all:

View file

@ -15,7 +15,7 @@ import (
goxmpp "gosrc.io/xmpp" goxmpp "gosrc.io/xmpp"
) )
var version string = "1.7.1" var version string = "1.7.2"
var commit string var commit string
var sm *goxmpp.StreamManager var sm *goxmpp.StreamManager

View file

@ -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)) message.Extensions = append(message.Extensions, extensions.NewReplyFallback(reply.Start, reply.End))
} }
} }
if !isCarbon && toJid.Resource != "" {
message.Extensions = append(message.Extensions, stanza.HintNoCopy{})
}
if isCarbon { if isCarbon {
carbonMessage := extensions.ClientMessage{ carbonMessage := extensions.ClientMessage{