diff --git a/client.js b/client.js index 32b28eaf..28aa0586 100644 --- a/client.js +++ b/client.js @@ -241,15 +241,19 @@ class AndroidClient extends Client { this.heartbeat = setInterval(async()=>{ this.doCircle(); try { + if (!this.isOnline()) + return; await wt.heartbeat.call(this); if (Date.now() - this.send_timestamp >= 59000) { - if (!await core.getMsg.call(this)) { + if (!await core.getMsg.call(this) && this.isOnline()) { this.logger.warn("GetMsg timeout!"); if (!await core.getMsg.call(this) && this.isOnline()) this.destroy(); } } } catch { + if (!this.isOnline()) + return; core.getMsg.call(this); try { await wt.heartbeat.call(this); diff --git a/package-lock.json b/package-lock.json index f280ecb8..258dba8e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "oicq", - "version": "1.11.4", + "version": "1.11.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 79f68eda..c9a6a548 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "oicq", - "version": "1.11.4", - "upday": "2020/12/12", + "version": "1.11.5", + "upday": "2020/12/15", "description": "QQ protocol!", "main": "client.js", "types": "client.d.ts",