summaryrefslogtreecommitdiffstats
path: root/vendor/go.mau.fi/whatsmeow/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/go.mau.fi/whatsmeow/client.go')
-rw-r--r--vendor/go.mau.fi/whatsmeow/client.go15
1 files changed, 13 insertions, 2 deletions
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,