diff --git a/apps/meteor/app/file-upload/server/methods/sendFileMessage.ts b/apps/meteor/app/file-upload/server/methods/sendFileMessage.ts index e105d1962d895..816d5d5c5e6b3 100644 --- a/apps/meteor/app/file-upload/server/methods/sendFileMessage.ts +++ b/apps/meteor/app/file-upload/server/methods/sendFileMessage.ts @@ -8,7 +8,6 @@ import type { IMessage, FileProp, } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms, Uploads, Users } from '@rocket.chat/models'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -156,13 +155,6 @@ export const parseFileIntoMessageAttachments = async ( return { files, attachments }; }; -declare module '@rocket.chat/ddp-client' { - // eslint-disable-next-line @typescript-eslint/naming-convention - interface ServerMethods { - sendFileMessage: (roomId: string, _store: string, file: Partial, msgData?: Record) => boolean; - } -} - export const sendFileMessage = async ( userId: string, { @@ -232,16 +224,3 @@ export const sendFileMessage = async ( return msg; }; - -Meteor.methods({ - async sendFileMessage(roomId, _store, file, msgData = {}) { - const userId = Meteor.userId(); - if (!userId) { - throw new Meteor.Error('error-invalid-user', 'Invalid user', { - method: 'sendFileMessage', - } as any); - } - - return sendFileMessage(userId, { roomId, file, msgData }); - }, -});