diff --git a/app/lib/rocketchat/rocketchat.js b/app/lib/rocketchat/rocketchat.js index 2d3fd5654..cd5977f02 100644 --- a/app/lib/rocketchat/rocketchat.js +++ b/app/lib/rocketchat/rocketchat.js @@ -976,16 +976,19 @@ const RocketChat = { return `${server}/${roomType}/${channel.name}`; }, subscribe(...args) { - return this.sdk.subscribe(...args); + return sdk.subscribe(...args); + }, + subscribeRaw(...args) { + return sdk.subscribeRaw(...args); }, subscribeRoom(...args) { - return this.sdk.subscribeRoom(...args); + return sdk.subscribeRoom(...args); }, unsubscribe(subscription) { - return this.sdk.unsubscribe(subscription); + return sdk.unsubscribe(subscription); }, onStreamData(...args) { - return this.sdk.onStreamData(...args); + return sdk.onStreamData(...args); }, emitTyping(room, typing = true) { const { login, settings } = reduxStore.getState(); diff --git a/app/lib/rocketchat/services/sdk.ts b/app/lib/rocketchat/services/sdk.ts index 869657a29..44f151e59 100644 --- a/app/lib/rocketchat/services/sdk.ts +++ b/app/lib/rocketchat/services/sdk.ts @@ -27,6 +27,10 @@ class Sdk { return this.sdk; } + get current() { + return this.sdk; + } + /** * TODO: evaluate the need for assigning "null" to this.sdk * I'm returning "null" because we need to remove both instances of this.sdk here and on rocketchat.js @@ -141,6 +145,26 @@ class Sdk { }); return this.methodCall(method, ...parsedParams); } + + subscribe(...args: any[]) { + return this.sdk.subscribe(...args); + } + + subscribeRaw(...args: any[]) { + return this.sdk.subscribeRaw(...args); + } + + subscribeRoom(...args: any[]) { + return this.sdk.subscribeRoom(...args); + } + + unsubscribe(subscription: any[]) { + return this.sdk.unsubscribe(subscription); + } + + onStreamData(...args: any[]) { + return this.sdk.onStreamData(...args); + } } const sdk = new Sdk();