Skip to content

Commit

Permalink
login: fix syncing storage after login
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Dec 10, 2024
1 parent d17cd5f commit 77edbf3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/connector/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (qr *QRLogin) processingWait(ctx context.Context) (*bridgev2.LoginStep, err
ul.Client.Connect(backgroundCtx)
if signalClient := ul.Client.(*SignalClient).Client; signalClient.Store.MasterKey != nil {
zerolog.Ctx(ctx).Info().Msg("Received master key in login, syncing storage immediately")
go signalClient.SyncStorage(ctx)
go signalClient.SyncStorage(backgroundCtx)
}
return &bridgev2.LoginStep{
Type: bridgev2.LoginStepTypeComplete,
Expand Down
4 changes: 2 additions & 2 deletions pkg/signalmeow/sending.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,11 +747,11 @@ func (cli *Client) SendMessage(ctx context.Context, recipientID libsignalgo.Serv
cli.sendSyncCopy(ctx, content, messageTimestamp, &res)
}
return SendMessageResult{WasSuccessful: true, SuccessfulSendResult: res}
} else if content.TypingMessage != nil && !cli.Store.DeviceData.AccountRecord.GetTypingIndicators() {
} else if content.TypingMessage != nil && cli.Store.DeviceData.AccountRecord != nil && !cli.Store.DeviceData.AccountRecord.GetTypingIndicators() {
zerolog.Ctx(ctx).Debug().Msg("Not sending typing message as typing indicators are disabled")
res := SuccessfulSendResult{Recipient: recipientID}
return SendMessageResult{WasSuccessful: true, SuccessfulSendResult: res}
} else if content.GetReceiptMessage().GetType() == signalpb.ReceiptMessage_READ && !cli.Store.DeviceData.AccountRecord.GetReadReceipts() {
} else if content.GetReceiptMessage().GetType() == signalpb.ReceiptMessage_READ && cli.Store.DeviceData.AccountRecord != nil && !cli.Store.DeviceData.AccountRecord.GetReadReceipts() {
zerolog.Ctx(ctx).Debug().Msg("Not sending receipt message as read receipts are disabled")
res := SuccessfulSendResult{Recipient: recipientID}
// Still send sync messages for read receipts
Expand Down

0 comments on commit 77edbf3

Please sign in to comment.