mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
crypto: don't check otk count if sharing new keys
This commit is contained in:
parent
caca057b23
commit
fa90bba820
1 changed files with 1 additions and 1 deletions
|
|
@ -729,7 +729,7 @@ func (mach *OlmMachine) ShareKeys(ctx context.Context, currentOTKCount int) erro
|
|||
start := time.Now()
|
||||
mach.otkUploadLock.Lock()
|
||||
defer mach.otkUploadLock.Unlock()
|
||||
if mach.lastOTKUpload.Add(1*time.Minute).After(start) || currentOTKCount < 0 {
|
||||
if mach.lastOTKUpload.Add(1*time.Minute).After(start) || (currentOTKCount < 0 && mach.account.Shared) {
|
||||
log.Debug().Msg("Checking OTK count from server due to suspiciously close share keys requests or negative OTK count")
|
||||
resp, err := mach.Client.UploadKeys(ctx, &mautrix.ReqUploadKeys{})
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue