bridgev2/matrix: fix decrypting events in GetEvent
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled

This commit is contained in:
Tulir Asokan 2026-01-08 22:52:25 +02:00
commit 32da107299

View file

@ -714,10 +714,10 @@ func (as *ASIntent) GetEvent(ctx context.Context, roomID id.RoomID, eventID id.E
}
if evt.Type == event.EventEncrypted {
if as.Connector.Config.Encryption.DeleteKeys.RatchetOnDecrypt {
if as.Connector.Crypto == nil || as.Connector.Config.Encryption.DeleteKeys.RatchetOnDecrypt {
return nil, errors.New("can't decrypt the event")
}
return as.Matrix.Crypto.Decrypt(ctx, evt)
return as.Connector.Crypto.Decrypt(ctx, evt)
}
return evt, nil