From d087f3f6b1603a6710722e62e3e680a51106d2d6 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 22 Nov 2022 10:52:19 +0200 Subject: [PATCH] Add double puppet values in reaction backfill --- historysync.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/historysync.go b/historysync.go index c34e74e..dd1746c 100644 --- a/historysync.go +++ b/historysync.go @@ -737,10 +737,12 @@ func (portal *Portal) wrapBatchReaction(source *User, reaction *waProto.Reaction if rawTS := reaction.GetSenderTimestampMs(); rawTS >= mainEventTS.UnixMilli() && rawTS <= time.Now().UnixMilli() { reactionInfo.Timestamp = time.UnixMilli(rawTS) } + wrappedContent := event.Content{Parsed: &content} + intent.AddDoublePuppetValue(&wrappedContent) reactionEvent = &event.Event{ ID: portal.deterministicEventID(senderJID, reactionInfo.ID, ""), Type: event.EventReaction, - Content: event.Content{Parsed: content}, + Content: wrappedContent, Sender: intent.UserID, Timestamp: reactionInfo.Timestamp.UnixMilli(), } @@ -756,9 +758,7 @@ func (portal *Portal) wrapBatchEvent(info *types.MessageInfo, intent *appservice if err != nil { return nil, err } - if newEventType != eventType { - intent.AddDoublePuppetValue(&wrappedContent) - } + intent.AddDoublePuppetValue(&wrappedContent) var eventID id.EventID if portal.bridge.Config.Homeserver.Software == bridgeconfig.SoftwareHungry { eventID = portal.deterministicEventID(info.Sender, info.ID, partName)