forked from MirrorHub/mautrix-whatsapp
Backport fixing custom fields leaking in history sync
This commit is contained in:
parent
2142f92089
commit
a58cae16cd
1 changed files with 7 additions and 0 deletions
|
@ -478,6 +478,13 @@ func (portal *Portal) wrapBatchEvent(info *types.MessageInfo, intent *appservice
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if newEventType == event.EventEncrypted {
|
||||
// Clear other custom keys if the event was encrypted, but keep the double puppet identifier
|
||||
wrappedContent.Raw = map[string]interface{}{backfillIDField: info.ID}
|
||||
if intent.IsCustomPuppet {
|
||||
wrappedContent.Raw[doublePuppetKey] = doublePuppetValue
|
||||
}
|
||||
}
|
||||
return &event.Event{
|
||||
Sender: intent.UserID,
|
||||
Type: newEventType,
|
||||
|
|
Loading…
Reference in a new issue