@@ -8,7 +8,6 @@ import type {
88 IMessage ,
99 FileProp ,
1010} from '@rocket.chat/core-typings' ;
11- import type { ServerMethods } from '@rocket.chat/ddp-client' ;
1211import { Rooms , Uploads , Users } from '@rocket.chat/models' ;
1312import { Match , check } from 'meteor/check' ;
1413import { Meteor } from 'meteor/meteor' ;
@@ -18,7 +17,6 @@ import { getFileExtension } from '../../../../lib/utils/getFileExtension';
1817import { callbacks } from '../../../../server/lib/callbacks' ;
1918import { SystemLogger } from '../../../../server/lib/logger/system' ;
2019import { canAccessRoomAsync } from '../../../authorization/server/functions/canAccessRoom' ;
21- import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger' ;
2220import { executeSendMessage } from '../../../lib/server/methods/sendMessage' ;
2321import { FileUpload } from '../lib/FileUpload' ;
2422
@@ -163,13 +161,6 @@ export const parseFileIntoMessageAttachments = async (
163161 return { files, attachments } ;
164162} ;
165163
166- declare module '@rocket.chat/ddp-client' {
167- // eslint-disable-next-line @typescript-eslint/naming-convention
168- interface ServerMethods {
169- sendFileMessage : ( roomId : string , _store : string , file : Partial < IUpload > , msgData ?: Record < string , any > ) => boolean ;
170- }
171- }
172-
173164export const sendFileMessage = async (
174165 userId : string ,
175166 {
@@ -239,17 +230,3 @@ export const sendFileMessage = async (
239230
240231 return msg ;
241232} ;
242-
243- Meteor . methods < ServerMethods > ( {
244- async sendFileMessage ( roomId , _store , file , msgData = { } ) {
245- methodDeprecationLogger . method ( 'sendFileMessage' , '9.0.0' , '/v1/rooms.mediaConfirm/:rid/:fileId' ) ;
246- const userId = Meteor . userId ( ) ;
247- if ( ! userId ) {
248- throw new Meteor . Error ( 'error-invalid-user' , 'Invalid user' , {
249- method : 'sendFileMessage' ,
250- } as any ) ;
251- }
252-
253- return sendFileMessage ( userId , { roomId, file, msgData } ) ;
254- } ,
255- } ) ;
0 commit comments