diff --git a/.changeset/nervous-doors-knock.md b/.changeset/nervous-doors-knock.md new file mode 100644 index 0000000000000..aa4084d7b8ded --- /dev/null +++ b/.changeset/nervous-doors-knock.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": major +--- + +Removes the deprecated `getAvatarSuggestion` method diff --git a/apps/meteor/server/methods/getAvatarSuggestion.ts b/apps/meteor/server/methods/getAvatarSuggestion.ts deleted file mode 100644 index aa35fa03b5a91..0000000000000 --- a/apps/meteor/server/methods/getAvatarSuggestion.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { IUser } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ddp-client'; -import { Meteor } from 'meteor/meteor'; - -import { getAvatarSuggestionForUser } from '../../app/lib/server/functions/getAvatarSuggestionForUser'; -import { methodDeprecationLogger } from '../../app/lib/server/lib/deprecationWarningLogger'; - -declare module '@rocket.chat/ddp-client' { - // eslint-disable-next-line @typescript-eslint/naming-convention - interface ServerMethods { - getAvatarSuggestion(): Record< - string, - { - blob: string; - contentType: string; - service: string; - url: string; - } - >; - } -} - -Meteor.methods({ - async getAvatarSuggestion() { - methodDeprecationLogger.method('getAvatarSuggestion', '7.0.0', '/v1/users.getAvatarSuggestion'); - - const user = (await Meteor.userAsync()) as IUser | undefined; - if (!user) { - throw new Meteor.Error('error-invalid-user', 'Invalid user', { - method: 'getAvatarSuggestion', - }); - } - - return getAvatarSuggestionForUser(user); - }, -}); diff --git a/apps/meteor/server/methods/index.ts b/apps/meteor/server/methods/index.ts index b2cd6f718b135..80c906ac5df11 100644 --- a/apps/meteor/server/methods/index.ts +++ b/apps/meteor/server/methods/index.ts @@ -11,7 +11,6 @@ import './channelsList'; import './createDirectMessage'; import './deleteFileMessage'; import './deleteUser'; -import './getAvatarSuggestion'; import './getRoomById'; import './getRoomIdByNameOrId'; import './getRoomNameById';