summaryrefslogtreecommitdiffstats
path: root/vendor/go.mau.fi/whatsmeow/client.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2022-04-01 00:23:19 +0200
committerGitHub <noreply@github.com>2022-04-01 00:23:19 +0200
commitc6716e030c02f316b887c1d3ee4b443aa3ab6afd (patch)
tree470461fe2d29662e7a69834ed21fce30beed65ab /vendor/go.mau.fi/whatsmeow/client.go
parent4ab72acec656dafd304f88359b509b1f27c06604 (diff)
downloadmatterbridge-msglm-c6716e030c02f316b887c1d3ee4b443aa3ab6afd.tar.gz
matterbridge-msglm-c6716e030c02f316b887c1d3ee4b443aa3ab6afd.tar.bz2
matterbridge-msglm-c6716e030c02f316b887c1d3ee4b443aa3ab6afd.zip
Update dependencies (#1784)
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,