Fix most unexpected logout bugs, handle connection-in-progress states better and send warning message if sending to whatsapp times out

This commit is contained in:
Tulir Asokan
2019-08-30 22:04:57 +03:00
parent c4d2b04e67
commit d91f705e95
4 changed files with 40 additions and 7 deletions

View File

@ -233,6 +233,10 @@ func (user *User) IsConnected() bool {
return user.Conn != nil && user.Conn.IsConnected() && user.Conn.IsLoggedIn()
}
func (user *User) IsLoginInProgress() bool {
return user.Conn != nil && user.Conn.IsLoginInProgress()
}
func (user *User) loginQrChannel(ce *CommandEvent, qrChan <-chan string, eventIDChan chan<- string) {
var qrEventID string
for code := range qrChan {