Only clear custom keys for encrypted events

This commit is contained in:
Tulir Asokan 2022-02-15 13:36:44 +02:00
parent eee404c62d
commit d257c80327

View file

@ -1476,11 +1476,14 @@ func (portal *Portal) sendMessage(intent *appservice.IntentAPI, eventType event.
return nil, err return nil, err
} }
if eventType == event.EventEncrypted {
// Clear other custom keys if the event was encrypted, but keep the double puppet identifier
if intent.IsCustomPuppet { if intent.IsCustomPuppet {
wrappedContent.Raw = map[string]interface{}{doublePuppetKey: doublePuppetValue} wrappedContent.Raw = map[string]interface{}{doublePuppetKey: doublePuppetValue}
} else { } else {
wrappedContent.Raw = nil wrappedContent.Raw = nil
} }
}
_, _ = intent.UserTyping(portal.MXID, false, 0) _, _ = intent.UserTyping(portal.MXID, false, 0)
if timestamp == 0 { if timestamp == 0 {