mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
hicli/processEvent: save session request manually if decryption queue is not provided
This commit is contained in:
parent
67b1c97f14
commit
efc532bfb2
1 changed files with 12 additions and 1 deletions
|
|
@ -370,7 +370,18 @@ func (h *HiClient) processEvent(ctx context.Context, evt *event.Event, decryptio
|
|||
}
|
||||
minIndex, _ := crypto.ParseMegolmMessageIndex(evt.Content.AsEncrypted().MegolmCiphertext)
|
||||
req.MinIndex = min(uint32(minIndex), req.MinIndex)
|
||||
decryptionQueue[dbEvt.MegolmSessionID] = req
|
||||
if decryptionQueue != nil {
|
||||
decryptionQueue[dbEvt.MegolmSessionID] = req
|
||||
} else {
|
||||
err = h.DB.SessionRequest.Put(ctx, req)
|
||||
if err != nil {
|
||||
zerolog.Ctx(ctx).Err(err).
|
||||
Stringer("session_id", dbEvt.MegolmSessionID).
|
||||
Msg("Failed to save session request")
|
||||
} else {
|
||||
h.WakeupRequestQueue()
|
||||
}
|
||||
}
|
||||
}
|
||||
return dbEvt, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue