diff options
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) } |