mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
bug fix where phonePoll wasn't clearing
This commit is contained in:
@@ -11,7 +11,6 @@ export class WAConnection extends Base {
|
||||
this.registerOnMessageStatusChange ()
|
||||
this.registerOnUnreadMessage ()
|
||||
this.registerOnPresenceUpdate ()
|
||||
this.registerPhoneConnectionPoll ()
|
||||
|
||||
// If a message has been updated (usually called when a video message gets its upload url)
|
||||
this.registerCallback (['action', 'add:update', 'message'], json => {
|
||||
@@ -266,18 +265,6 @@ export class WAConnection extends Base {
|
||||
protected async setProfilePicture (chat: WAChat) {
|
||||
chat.imgUrl = await this.getProfilePicture (chat.jid).catch (err => '')
|
||||
}
|
||||
protected registerPhoneConnectionPoll () {
|
||||
this.phoneCheck = setInterval (() => {
|
||||
this.checkPhoneConnection (5000) // 5000 ms for timeout
|
||||
.then (connected => {
|
||||
if (this.phoneConnected != connected) {
|
||||
this.emit ('connection-phone-change', {connected})
|
||||
}
|
||||
this.phoneConnected = connected
|
||||
})
|
||||
.catch (error => this.log(`error in getting phone connection: ${error}`, MessageLogLevel.info))
|
||||
}, 15000)
|
||||
}
|
||||
|
||||
// Add all event types
|
||||
|
||||
|
||||
Reference in New Issue
Block a user