diff options
author | Wim <wim@42.be> | 2019-08-26 23:22:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-26 23:22:34 +0200 |
commit | d525f1c9e4ac39b74575052b61c4de72de794b4e (patch) | |
tree | 90f444dd4046c7d29ed08c005648c573deb484b2 /vendor/github.com/Rhymen/go-whatsapp/session.go | |
parent | 921f2dfcdf1a6263220b55eb55716e497373dfcf (diff) | |
download | matterbridge-msglm-d525f1c9e4ac39b74575052b61c4de72de794b4e.tar.gz matterbridge-msglm-d525f1c9e4ac39b74575052b61c4de72de794b4e.tar.bz2 matterbridge-msglm-d525f1c9e4ac39b74575052b61c4de72de794b4e.zip |
Update Rhymen/go-whatsapp vendor (#876)
Diffstat (limited to 'vendor/github.com/Rhymen/go-whatsapp/session.go')
-rw-r--r-- | vendor/github.com/Rhymen/go-whatsapp/session.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/github.com/Rhymen/go-whatsapp/session.go b/vendor/github.com/Rhymen/go-whatsapp/session.go index 3b9ba235..11307fab 100644 --- a/vendor/github.com/Rhymen/go-whatsapp/session.go +++ b/vendor/github.com/Rhymen/go-whatsapp/session.go @@ -101,6 +101,14 @@ func (wac *Conn) SetClientName(long, short string) error { } /* +SetClientVersion sets WhatsApp client version +Default value is 0.3.3324 +*/ +func (wac *Conn) SetClientVersion(major int, minor int, patch int) { + waVersion = []int{major, minor, patch} +} + +/* Login is the function that creates a new whatsapp session and logs you in. If you do not want to scan the qr code every time, you should save the returned session and use RestoreWithSession the next time. Login takes a writable channel as an parameter. This channel is used to push the data represented by the qr code back to the user. The received data @@ -187,6 +195,8 @@ func (wac *Conn) Login(qrChan chan<- string) (Session, error) { var resp2 []interface{} select { case r1 := <-s1: + wac.loginSessionLock.Lock() + defer wac.loginSessionLock.Unlock() if err := json.Unmarshal([]byte(r1), &resp2); err != nil { return session, fmt.Errorf("error decoding qr code resp: %v", err) } |