hicli/sync: ignore m.unavailable withheld events from own devices

This commit is contained in:
Tulir Asokan 2025-03-01 21:43:09 +02:00
parent 91fa59d5ba
commit 014c63f0e7

View file

@ -82,7 +82,12 @@ func (h *HiClient) preProcessSyncResponse(ctx context.Context, resp *mautrix.Res
case *event.EncryptedEventContent:
h.Crypto.HandleEncryptedEvent(ctx, evt)
case *event.RoomKeyWithheldEventContent:
// TODO move this check to mautrix-go?
if evt.Sender == h.Account.UserID && content.Code == event.RoomKeyWithheldUnavailable {
log.Debug().Any("withheld_content", content).Msg("Ignoring m.unavailable megolm session withheld event")
} else {
h.Crypto.HandleRoomKeyWithheld(ctx, content)
}
default:
postponedToDevices = append(postponedToDevices, evt)
}