diff --git a/.changeset/ninety-hats-swim.md b/.changeset/ninety-hats-swim.md new file mode 100644 index 00000000000..43ea75a82d3 --- /dev/null +++ b/.changeset/ninety-hats-swim.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': major +--- + +Removes deprecated `livechat:setUpConnection` method diff --git a/apps/meteor/app/livechat/server/index.ts b/apps/meteor/app/livechat/server/index.ts index efd05cef536..a4d7f2d97ee 100644 --- a/apps/meteor/app/livechat/server/index.ts +++ b/apps/meteor/app/livechat/server/index.ts @@ -18,7 +18,6 @@ import './methods/saveCustomField'; import './methods/saveDepartment'; import './methods/sendMessageLivechat'; import './methods/sendFileLivechatMessage'; -import './methods/setUpConnection'; import './methods/takeInquiry'; import './methods/sendTranscript'; import './lib/QueueManager'; diff --git a/apps/meteor/app/livechat/server/methods/setUpConnection.ts b/apps/meteor/app/livechat/server/methods/setUpConnection.ts deleted file mode 100644 index 4aea4caa7c6..00000000000 --- a/apps/meteor/app/livechat/server/methods/setUpConnection.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { UserStatus } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ddp-client'; -import { check } from 'meteor/check'; -import { Meteor } from 'meteor/meteor'; - -import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -import { notifyGuestStatusChanged } from '../lib/guests'; - -declare module '@rocket.chat/ddp-client' { - // eslint-disable-next-line @typescript-eslint/naming-convention - interface ServerMethods { - 'livechat:setUpConnection'(data: { token: string }): void; - } -} - -declare module 'meteor/meteor' { - // eslint-disable-next-line @typescript-eslint/no-namespace - namespace Meteor { - // eslint-disable-next-line @typescript-eslint/naming-convention - interface Connection { - livechatToken?: string; - } - } -} - -Meteor.methods({ - 'livechat:setUpConnection'(data) { - methodDeprecationLogger.method('livechat:setUpConnection', '8.0.0', 'This functionality is no longer supported'); - check(data, { - token: String, - }); - - const { token } = data; - - if (this.connection && !this.connection.livechatToken) { - this.connection.livechatToken = token; - this.connection.onClose(async () => { - await notifyGuestStatusChanged(token, UserStatus.OFFLINE); - }); - } - }, -}); diff --git a/ee/apps/ddp-streamer/src/configureServer.ts b/ee/apps/ddp-streamer/src/configureServer.ts index 6f776545e59..cbdd516b6f8 100644 --- a/ee/apps/ddp-streamer/src/configureServer.ts +++ b/ee/apps/ddp-streamer/src/configureServer.ts @@ -137,22 +137,4 @@ server.methods({ } return Presence.setStatus(userId, status, statusText); }, - // Copied from /app/livechat/server/methods/setUpConnection.js - 'livechat:setUpConnection'(data = {}) { - console.warn('Warning: Method livechat:setUpConnection is deprecated and will be removed on v8.0.0'); - const { token } = data; - - if (typeof token !== 'string') { - return new Error('Token must be string'); - } - - if (!this.connection.livechatToken) { - this.connection.livechatToken = token; - this.connection.onClose(async () => { - await MeteorService.notifyGuestStatusChanged(token, 'offline'); - }); - } - - return undefined; - }, });