diff --git a/pkg/hicli/sync.go b/pkg/hicli/sync.go index 3821776..074d7e0 100644 --- a/pkg/hicli/sync.go +++ b/pkg/hicli/sync.go @@ -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: - h.Crypto.HandleRoomKeyWithheld(ctx, content) + // 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) }