mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-14 17:33:48 +01:00
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 {
|
if err != nil {
|
||||||
return nil, err
|
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{
|
return &event.Event{
|
||||||
Sender: intent.UserID,
|
Sender: intent.UserID,
|
||||||
Type: newEventType,
|
Type: newEventType,
|
||||||
|
|
Loading…
Reference in a new issue