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