From ff7fb116f07759801ce705a87574d1e3b4037694 Mon Sep 17 00:00:00 2001 From: MartinSchoeler Date: Fri, 29 Aug 2025 15:35:18 -0300 Subject: [PATCH 1/2] chore!: Remove deprecated `setReaction` meteor method --- .../app/reactions/server/setReaction.ts | 29 +------------------ 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/apps/meteor/app/reactions/server/setReaction.ts b/apps/meteor/app/reactions/server/setReaction.ts index 53358ac1c94bf..1659fc14db28a 100644 --- a/apps/meteor/app/reactions/server/setReaction.ts +++ b/apps/meteor/app/reactions/server/setReaction.ts @@ -1,7 +1,6 @@ import { Apps, AppEvents } from '@rocket.chat/apps'; -import { api, Message } from '@rocket.chat/core-services'; +import { Message } from '@rocket.chat/core-services'; import type { IMessage, IRoom, IUser } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages, EmojiCustom, Rooms, Users } from '@rocket.chat/models'; import { Meteor } from 'meteor/meteor'; @@ -11,7 +10,6 @@ import { canAccessRoomAsync } from '../../authorization/server'; import { hasPermissionAsync } from '../../authorization/server/functions/hasPermission'; import { emoji } from '../../emoji/server'; import { isTheLastMessage } from '../../lib/server/functions/isTheLastMessage'; -import { methodDeprecationLogger } from '../../lib/server/lib/deprecationWarningLogger'; import { notifyOnMessageChange } from '../../lib/server/lib/notifyListener'; export const removeUserReaction = (message: IMessage, reaction: string, username: string) => { @@ -159,28 +157,3 @@ declare module '@rocket.chat/ddp-client' { setReaction(reaction: string, messageId: IMessage['_id'], shouldReact?: boolean): boolean | undefined; } } - -Meteor.methods({ - async setReaction(reaction, messageId, shouldReact) { - methodDeprecationLogger.method('setReaction', '8.0.0', '/v1/chat.react'); - - const uid = Meteor.userId(); - if (!uid) { - throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'setReaction' }); - } - - try { - await executeSetReaction(uid, reaction, messageId, shouldReact); - } catch (e: any) { - if (e.error === 'error-not-allowed' && e.reason && e.details && e.details.rid) { - void api.broadcast('notify.ephemeralMessage', uid, e.details.rid, { - msg: e.reason, - }); - - return false; - } - - throw e; - } - }, -}); From 4249add62280dfc26e7c2c4a289d8b536c2553f4 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Fri, 29 Aug 2025 15:39:32 -0300 Subject: [PATCH 2/2] Create honest-knives-cough.md --- .changeset/honest-knives-cough.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/honest-knives-cough.md diff --git a/.changeset/honest-knives-cough.md b/.changeset/honest-knives-cough.md new file mode 100644 index 0000000000000..2329bec3a251a --- /dev/null +++ b/.changeset/honest-knives-cough.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": major +--- + +Removes the deprecated `setReaction` meteor method