wechaty-puppet-matrix 0.0.24 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/src/matrix/service/request.d.ts +5 -16
- package/dist/cjs/src/matrix/service/request.d.ts.map +1 -1
- package/dist/cjs/src/matrix/service/request.js +43 -164
- package/dist/cjs/src/puppet-matrix.d.ts.map +1 -1
- package/dist/cjs/src/puppet-matrix.js +8 -0
- package/dist/esm/src/matrix/service/request.d.ts +5 -16
- package/dist/esm/src/matrix/service/request.d.ts.map +1 -1
- package/dist/esm/src/matrix/service/request.js +43 -164
- package/dist/esm/src/puppet-matrix.d.ts.map +1 -1
- package/dist/esm/src/puppet-matrix.js +8 -0
- package/package.json +1 -1
- package/src/matrix/service/request.ts +49 -213
- package/src/puppet-matrix.ts +8 -1
- package/src/puppet-matrix.ts~ +0 -1674
package/src/puppet-matrix.ts
CHANGED
|
@@ -207,7 +207,12 @@ class PuppetMatrix extends PUPPET.Puppet {
|
|
|
207
207
|
} as any)
|
|
208
208
|
}, 5000)
|
|
209
209
|
}
|
|
210
|
-
|
|
210
|
+
}))
|
|
211
|
+
this._client.on('expired', this.wrapAsync(async (expired: boolean) => {
|
|
212
|
+
if (expired) {
|
|
213
|
+
log.info(PRE, 'Token has expired')
|
|
214
|
+
void this.onStop()
|
|
215
|
+
}
|
|
211
216
|
}))
|
|
212
217
|
}
|
|
213
218
|
addRunningPuppet(this)
|
|
@@ -434,6 +439,8 @@ class PuppetMatrix extends PUPPET.Puppet {
|
|
|
434
439
|
private async _stopClient (): Promise<void> {
|
|
435
440
|
this.__currentUserId = undefined
|
|
436
441
|
this.__currentUserId = undefined
|
|
442
|
+
this._client?.destroy()
|
|
443
|
+
this._client = undefined
|
|
437
444
|
if (this._cacheMgr) {
|
|
438
445
|
log.info(PRE, 'colse cache')
|
|
439
446
|
await this._cacheMgr.close()
|