mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-09-30 05:28:56 +02:00
Only clear custom keys for encrypted events
This commit is contained in:
parent
eee404c62d
commit
d257c80327
1 changed files with 7 additions and 4 deletions
11
portal.go
11
portal.go
|
@ -1476,10 +1476,13 @@ func (portal *Portal) sendMessage(intent *appservice.IntentAPI, eventType event.
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if intent.IsCustomPuppet {
|
if eventType == event.EventEncrypted {
|
||||||
wrappedContent.Raw = map[string]interface{}{doublePuppetKey: doublePuppetValue}
|
// Clear other custom keys if the event was encrypted, but keep the double puppet identifier
|
||||||
} else {
|
if intent.IsCustomPuppet {
|
||||||
wrappedContent.Raw = nil
|
wrappedContent.Raw = map[string]interface{}{doublePuppetKey: doublePuppetValue}
|
||||||
|
} else {
|
||||||
|
wrappedContent.Raw = nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_, _ = intent.UserTyping(portal.MXID, false, 0)
|
_, _ = intent.UserTyping(portal.MXID, false, 0)
|
||||||
|
|
Loading…
Reference in a new issue