From bd2ece9ff2cb3e22a154cc3830087990f73bf132 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 23 Feb 2025 18:44:59 +0200 Subject: [PATCH] hicli/sync: fix unredacting content of encrypted events --- pkg/hicli/sync.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/hicli/sync.go b/pkg/hicli/sync.go index 1b5eaa1..464ba0f 100644 --- a/pkg/hicli/sync.go +++ b/pkg/hicli/sync.go @@ -621,7 +621,7 @@ func (h *HiClient) processEvent( } var decryptionErr error var decryptedMautrixEvt *event.Event - if evt.Type == event.EventEncrypted && dbEvt.RedactedBy == "" { + if evt.Type == event.EventEncrypted && (dbEvt.RedactedBy == "" || len(dbEvt.Content) > 2) { decryptedMautrixEvt, decryptionErr = h.decryptEventInto(ctx, evt, dbEvt) } else if evt.Type == event.EventRedaction { if evt.Redacts != "" && gjson.GetBytes(evt.Content.VeryRaw, "redacts").Str != evt.Redacts.String() {