瀏覽代碼

Add double puppet values in reaction backfill

Tulir Asokan 2 年之前
父節點
當前提交
d087f3f6b1
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      historysync.go

+ 4 - 4
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() {
 	if rawTS := reaction.GetSenderTimestampMs(); rawTS >= mainEventTS.UnixMilli() && rawTS <= time.Now().UnixMilli() {
 		reactionInfo.Timestamp = time.UnixMilli(rawTS)
 		reactionInfo.Timestamp = time.UnixMilli(rawTS)
 	}
 	}
+	wrappedContent := event.Content{Parsed: &content}
+	intent.AddDoublePuppetValue(&wrappedContent)
 	reactionEvent = &event.Event{
 	reactionEvent = &event.Event{
 		ID:        portal.deterministicEventID(senderJID, reactionInfo.ID, ""),
 		ID:        portal.deterministicEventID(senderJID, reactionInfo.ID, ""),
 		Type:      event.EventReaction,
 		Type:      event.EventReaction,
-		Content:   event.Content{Parsed: content},
+		Content:   wrappedContent,
 		Sender:    intent.UserID,
 		Sender:    intent.UserID,
 		Timestamp: reactionInfo.Timestamp.UnixMilli(),
 		Timestamp: reactionInfo.Timestamp.UnixMilli(),
 	}
 	}
@@ -756,9 +758,7 @@ func (portal *Portal) wrapBatchEvent(info *types.MessageInfo, intent *appservice
 	if err != nil {
 	if err != nil {
 		return nil, err
 		return nil, err
 	}
 	}
-	if newEventType != eventType {
-		intent.AddDoublePuppetValue(&wrappedContent)
-	}
+	intent.AddDoublePuppetValue(&wrappedContent)
 	var eventID id.EventID
 	var eventID id.EventID
 	if portal.bridge.Config.Homeserver.Software == bridgeconfig.SoftwareHungry {
 	if portal.bridge.Config.Homeserver.Software == bridgeconfig.SoftwareHungry {
 		eventID = portal.deterministicEventID(info.Sender, info.ID, partName)
 		eventID = portal.deterministicEventID(info.Sender, info.ID, partName)