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/conn.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/conn.go')
-rw-r--r-- | vendor/github.com/Rhymen/go-whatsapp/conn.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/github.com/Rhymen/go-whatsapp/conn.go b/vendor/github.com/Rhymen/go-whatsapp/conn.go index ff83d42d..2bdeb118 100644 --- a/vendor/github.com/Rhymen/go-whatsapp/conn.go +++ b/vendor/github.com/Rhymen/go-whatsapp/conn.go @@ -89,6 +89,8 @@ type Conn struct { longClientName string shortClientName string + + loginSessionLock sync.RWMutex } type websocketWrapper struct { @@ -191,6 +193,19 @@ func (wac *Conn) Disconnect() (Session, error) { return *wac.session, err } +func (wac *Conn) AdminTest() (bool, error) { + if !wac.connected { + return false, ErrNotConnected + } + + if !wac.loggedIn { + return false, ErrInvalidSession + } + + result, err := wac.sendAdminTest() + return result, err +} + func (wac *Conn) keepAlive(minIntervalMs int, maxIntervalMs int) { defer wac.wg.Done() |