From d2019b0ccd0b1d850444f8c483bac2077f7f53cf Mon Sep 17 00:00:00 2001 From: Sorunome Date: Sat, 25 Apr 2020 10:00:23 +0200 Subject: [PATCH] various fixes --- package-lock.json | 40 +++++++++++++++++++--------------------- package.json | 2 +- src/client.ts | 6 ++---- src/skype.ts | 1 + 4 files changed, 23 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index e6cd70e..f9293f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -98,9 +98,9 @@ } }, "@sorunome/skype-http": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@sorunome/skype-http/-/skype-http-1.5.0.tgz", - "integrity": "sha512-98CbzvtkvXprDIxsIHzKRbODDPAkbZNAbJcqPbXRR8IFMyjzcqgizns8PrfciQcF/e+XDjiWKGWuCBogV2Vi2g==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@sorunome/skype-http/-/skype-http-1.5.1.tgz", + "integrity": "sha512-dJ0fMeTmtzTUWbXN3+SCth8C9XElhrEkzbp454xyo0vXYyoPMbIUYuWeEas1hyeYjaqI9PdgTOe5xI9y+qr9/g==", "requires": { "async-file": "^2.0.2", "big-integer": "^1.6.26", @@ -114,18 +114,6 @@ "lodash": "^4.17.15", "tough-cookie": "^4.0.0", "tunnel": "0.0.6" - }, - "dependencies": { - "tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", - "requires": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.1.2" - } - } } }, "@szmarczak/http-timer": { @@ -1192,9 +1180,9 @@ "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" }, "incident": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/incident/-/incident-3.2.0.tgz", - "integrity": "sha512-Hok2kKEfZorHNeLePZxe03JCI0KxaN4XwrbwHWMSgZgyuNP/Pu/vqX1bwtm7FgwdqgXvEwAmDS5VCAkXnH3DXg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/incident/-/incident-3.2.1.tgz", + "integrity": "sha512-Mejx4QijYGSBAaR8NobH5dhFC7h5q1bIClsAtdoTEl/YzqSYVE/5WgovlYUHqwdBTLHkptQ5bv9nJNsJCJDeXg==", "requires": { "@types/object-inspect": "^1.4.0", "object-inspect": "^1.6.0" @@ -1893,9 +1881,9 @@ } }, "psl": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.7.0.tgz", - "integrity": "sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ==" + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" }, "pump": { "version": "3.0.0", @@ -2314,6 +2302,16 @@ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" }, + "tough-cookie": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", + "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "requires": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.1.2" + } + }, "triple-beam": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", diff --git a/package.json b/package.json index e2fdc17..c894493 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "author": "Sorunome", "dependencies": { - "@sorunome/skype-http": "^1.5.0", + "@sorunome/skype-http": "^1.5.1", "cheerio": "^1.0.0-rc.3", "command-line-args": "^5.1.1", "command-line-usage": "^5.0.5", diff --git a/src/client.ts b/src/client.ts index 85f4649..1be4042 100644 --- a/src/client.ts +++ b/src/client.ts @@ -27,8 +27,8 @@ const CONTACTS_DELTA_INTERVAL = 5 * 60 * 1000; // tslint:enable no-magic-numbers export class Client extends EventEmitter { - public contacts: Map = new Map(); - public conversations: Map = new Map(); + public contacts: Map = new Map(); + public conversations: Map = new Map(); private api: skypeHttp.Api; private handledIds: ExpireSet; private contactsInterval: NodeJS.Timeout | null = null; @@ -196,7 +196,6 @@ export class Client extends EventEmitter { // contact not found log.debug("No such contact found"); log.debug(err.body || err); - this.contacts.set(fullId, null); return null; } } @@ -228,7 +227,6 @@ export class Client extends EventEmitter { // conversation not found log.debug("No such conversation found"); log.debug(err.body || err); - this.conversations.set(id, null); return null; } } diff --git a/src/skype.ts b/src/skype.ts index 8d99e7f..b8c69cd 100644 --- a/src/skype.ts +++ b/src/skype.ts @@ -229,6 +229,7 @@ export class Skype { await this.puppet.sendStatusMessage(puppetId, "connected"); } catch (err) { log.error("Failed to connect", err.body || err); + p.data.state = undefined; // delete the sate so that we re-login for sure await this.puppet.sendStatusMessage(puppetId, "Failed to connect, reconnecting in a minute... " + err); setTimeout(async () => { await this.startClient(puppetId);