From c5ea472ecc19c44fd7f2d928bacfbc00644a4b3f Mon Sep 17 00:00:00 2001 From: werner mendizabal Date: Tue, 3 Jul 2018 20:11:56 -0500 Subject: [PATCH] RFE: remove pusher.com dependency --- index.js | 1 + lib/teletype-package.js | 5 ++++- package.json | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 51444446..449e1591 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,7 @@ module.exports = new TeletypePackage({ commandRegistry: atom.commands, tooltipManager: atom.tooltips, clipboard: atom.clipboard, + activePubSubGateway: atom.config.get('teletype.dev.activePubSubGateway'), pusherKey: atom.config.get('teletype.dev.pusherKey'), pusherOptions: { cluster: atom.config.get('teletype.dev.pusherCluster'), diff --git a/lib/teletype-package.js b/lib/teletype-package.js index b44e427b..b4159861 100644 --- a/lib/teletype-package.js +++ b/lib/teletype-package.js @@ -14,7 +14,7 @@ class TeletypePackage { const { baseURL, config, clipboard, commandRegistry, credentialCache, getAtomVersion, notificationManager, packageManager, peerConnectionTimeout, pubSubGateway, - pusherKey, pusherOptions, tetherDisconnectWindow, tooltipManager, + activePubSubGateway, pusherKey, pusherOptions, tetherDisconnectWindow, tooltipManager, workspace } = options @@ -26,6 +26,7 @@ class TeletypePackage { this.tooltipManager = tooltipManager this.clipboard = clipboard this.pubSubGateway = pubSubGateway + this.activePubSubGateway = activePubSubGateway this.pusherKey = pusherKey this.pusherOptions = pusherOptions this.baseURL = baseURL @@ -34,6 +35,7 @@ class TeletypePackage { this.tetherDisconnectWindow = tetherDisconnectWindow this.credentialCache = credentialCache || new CredentialCache() this.client = new TeletypeClient({ + activePubSubGateway: this.activePubSubGateway, pusherKey: this.pusherKey, pusherOptions: this.pusherOptions, baseURL: this.baseURL, @@ -48,6 +50,7 @@ class TeletypePackage { } activate () { + console.log('teletype: Using pubsub gateway:', this.activePubSubGateway) console.log('teletype: Using pusher key:', this.pusherKey) console.log('teletype: Using base URL:', this.baseURL) diff --git a/package.json b/package.json index 5162681d..4f7f53d8 100644 --- a/package.json +++ b/package.json @@ -84,6 +84,13 @@ "type": "string", "default": "mt1", "order": 3 + }, + "activePubSubGateway": { + "title": "The pubSubGateway that should be used for teletype (pusher or socketcluster)", + "description": "This should only be changed for development purposes. Changes take effect on the next package activation.", + "type": "string", + "default": "pusher", + "order": 4 } } }