From c6716e030c02f316b887c1d3ee4b443aa3ab6afd Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 1 Apr 2022 00:23:19 +0200 Subject: Update dependencies (#1784) --- vendor/go.mau.fi/whatsmeow/client.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'vendor/go.mau.fi/whatsmeow/client.go') diff --git a/vendor/go.mau.fi/whatsmeow/client.go b/vendor/go.mau.fi/whatsmeow/client.go index f37b2a25..41bad823 100644 --- a/vendor/go.mau.fi/whatsmeow/client.go +++ b/vendor/go.mau.fi/whatsmeow/client.go @@ -67,11 +67,14 @@ type Client struct { appStateProc *appstate.Processor appStateSyncLock sync.Mutex + historySyncNotifications chan *waProto.HistorySyncNotification + historySyncHandlerStarted uint32 + uploadPreKeysLock sync.Mutex lastPreKeyUpload time.Time - mediaConn *MediaConn - mediaConnLock sync.Mutex + mediaConnCache *MediaConn + mediaConnLock sync.Mutex responseWaiters map[string]chan<- *waBinary.Node responseWaitersLock sync.Mutex @@ -102,6 +105,11 @@ type Client struct { // If it returns false, the accepting will be cancelled and the retry receipt will be ignored. PreRetryCallback func(receipt *events.Receipt, retryCount int, msg *waProto.Message) bool + // Should untrusted identity errors be handled automatically? If true, the stored identity and existing signal + // sessions will be removed on untrusted identity errors, and an events.IdentityChange will be dispatched. + // If false, decrypting a message from untrusted devices will fail. + AutoTrustIdentity bool + uniqueID string idCounter uint32 @@ -150,6 +158,8 @@ func NewClient(deviceStore *store.Device, log waLog.Logger) *Client { handlerQueue: make(chan *waBinary.Node, handlerQueueSize), appStateProc: appstate.NewProcessor(deviceStore, log.Sub("AppState")), + historySyncNotifications: make(chan *waProto.HistorySyncNotification, 32), + groupParticipantsCache: make(map[types.JID][]types.JID), userDevicesCache: make(map[types.JID][]types.JID), @@ -157,6 +167,7 @@ func NewClient(deviceStore *store.Device, log waLog.Logger) *Client { GetMessageForRetry: func(to types.JID, id types.MessageID) *waProto.Message { return nil }, EnableAutoReconnect: true, + AutoTrustIdentity: true, } cli.nodeHandlers = map[string]nodeHandler{ "message": cli.handleEncryptedMessage, -- cgit v1.2.3