Skip to content

Commit 2b3d849

Browse files
nazabucciarelliggazzo
authored andcommitted
chore: remove sendFileMessage meteor method (#40288)
1 parent fd38bda commit 2b3d849

1 file changed

Lines changed: 0 additions & 23 deletions

File tree

apps/meteor/app/file-upload/server/methods/sendFileMessage.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -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';
1211
import { Rooms, Uploads, Users } from '@rocket.chat/models';
1312
import { Match, check } from 'meteor/check';
1413
import { Meteor } from 'meteor/meteor';
@@ -18,7 +17,6 @@ import { getFileExtension } from '../../../../lib/utils/getFileExtension';
1817
import { callbacks } from '../../../../server/lib/callbacks';
1918
import { SystemLogger } from '../../../../server/lib/logger/system';
2019
import { canAccessRoomAsync } from '../../../authorization/server/functions/canAccessRoom';
21-
import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger';
2220
import { executeSendMessage } from '../../../lib/server/methods/sendMessage';
2321
import { 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-
173164
export 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

Comments
 (0)