diff --git a/apps/meteor/app/autotranslate/client/lib/actionButton.ts b/apps/meteor/app/autotranslate/client/lib/actionButton.ts index 24cea2d8d28a..a720917ce175 100644 --- a/apps/meteor/app/autotranslate/client/lib/actionButton.ts +++ b/apps/meteor/app/autotranslate/client/lib/actionButton.ts @@ -2,7 +2,6 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { roomCoordinator } from '../../../../client/lib/rooms/roomCoordinator'; -import { messageArgs } from '../../../../client/lib/utils/messageArgs'; import { hasTranslationLanguageInAttachments, hasTranslationLanguageInMessage, @@ -25,8 +24,7 @@ Meteor.startup(() => { label: 'Translate', context: ['message', 'message-mobile', 'threads'], type: 'interaction', - action(_, props) { - const { message = messageArgs(this).msg } = props; + action(_, { message }) { const language = AutoTranslate.getLanguage(message.rid); if (!hasTranslationLanguageInMessage(message, language) && !hasTranslationLanguageInAttachments(message.attachments, language)) { (AutoTranslate.messageIdsToWait as any)[message._id] = true; @@ -61,7 +59,7 @@ Meteor.startup(() => { context: ['message', 'message-mobile', 'threads'], type: 'interaction', action(_, props) { - const { message = messageArgs(this).msg } = props; + const { message } = props; const language = AutoTranslate.getLanguage(message.rid); if (!hasTranslationLanguageInMessage(message, language) && !hasTranslationLanguageInAttachments(message.attachments, language)) { (AutoTranslate.messageIdsToWait as any)[message._id] = true; diff --git a/apps/meteor/app/discussion/client/createDiscussionMessageAction.ts b/apps/meteor/app/discussion/client/createDiscussionMessageAction.ts index ecf014248830..14cf16fbe8fd 100644 --- a/apps/meteor/app/discussion/client/createDiscussionMessageAction.ts +++ b/apps/meteor/app/discussion/client/createDiscussionMessageAction.ts @@ -4,7 +4,6 @@ import { Tracker } from 'meteor/tracker'; import CreateDiscussion from '../../../client/components/CreateDiscussion/CreateDiscussion'; import { imperativeModal } from '../../../client/lib/imperativeModal'; import { roomCoordinator } from '../../../client/lib/rooms/roomCoordinator'; -import { messageArgs } from '../../../client/lib/utils/messageArgs'; import { hasPermission } from '../../authorization/client'; import { settings } from '../../settings/client'; import { MessageAction } from '../../ui-utils/client'; @@ -21,9 +20,7 @@ Meteor.startup(() => { label: 'Discussion_start', type: 'communication', context: ['message', 'message-mobile', 'videoconf'], - async action(_, props) { - const { message = messageArgs(this).msg, room } = props; - + async action(_, { message, room }) { imperativeModal.open({ component: CreateDiscussion, props: { diff --git a/apps/meteor/app/message-mark-as-unread/client/actionButton.ts b/apps/meteor/app/message-mark-as-unread/client/actionButton.ts index e1e35d216029..97cdf8a7a1ac 100644 --- a/apps/meteor/app/message-mark-as-unread/client/actionButton.ts +++ b/apps/meteor/app/message-mark-as-unread/client/actionButton.ts @@ -2,7 +2,6 @@ import { Meteor } from 'meteor/meteor'; import { roomCoordinator } from '../../../client/lib/rooms/roomCoordinator'; import { dispatchToastMessage } from '../../../client/lib/toast'; -import { messageArgs } from '../../../client/lib/utils/messageArgs'; import { router } from '../../../client/providers/RouterProvider'; import { ChatSubscription } from '../../models/client'; import { LegacyRoomManager, MessageAction } from '../../ui-utils/client'; @@ -15,9 +14,7 @@ Meteor.startup(() => { label: 'Mark_unread', context: ['message', 'message-mobile', 'threads'], type: 'interaction', - async action(_, props) { - const { message = messageArgs(this).msg } = props; - + async action(_, { message }) { try { const subscription = ChatSubscription.findOne({ rid: message.rid, diff --git a/apps/meteor/app/reactions/client/init.ts b/apps/meteor/app/reactions/client/init.ts index 1943d7262939..d9573fbfe833 100644 --- a/apps/meteor/app/reactions/client/init.ts +++ b/apps/meteor/app/reactions/client/init.ts @@ -1,7 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { roomCoordinator } from '../../../client/lib/rooms/roomCoordinator'; -import { messageArgs } from '../../../client/lib/utils/messageArgs'; import { MessageAction } from '../../ui-utils/client'; import { sdk } from '../../utils/client/lib/SDKClient'; @@ -11,8 +10,7 @@ Meteor.startup(() => { icon: 'add-reaction', label: 'Add_Reaction', context: ['message', 'message-mobile', 'threads', 'federated', 'videoconf', 'videoconf-threads'], - action(event, props) { - const { message = messageArgs(this).msg, chat } = props; + action(event, { message, chat }) { event?.stopPropagation(); chat?.emojiPicker.open(event?.currentTarget as Element, (emoji) => sdk.call('setReaction', `:${emoji}:`, message._id)); }, diff --git a/apps/meteor/app/threads/client/messageAction/replyInThread.ts b/apps/meteor/app/threads/client/messageAction/replyInThread.ts index 01d007e0d953..9d0ab8566e04 100644 --- a/apps/meteor/app/threads/client/messageAction/replyInThread.ts +++ b/apps/meteor/app/threads/client/messageAction/replyInThread.ts @@ -2,7 +2,6 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { roomCoordinator } from '../../../../client/lib/rooms/roomCoordinator'; -import { messageArgs } from '../../../../client/lib/utils/messageArgs'; import { router } from '../../../../client/providers/RouterProvider'; import { settings } from '../../../settings/client'; import { MessageAction } from '../../../ui-utils/client'; @@ -17,8 +16,7 @@ Meteor.startup(() => { icon: 'thread', label: 'Reply_in_thread', context: ['message', 'message-mobile', 'federated', 'videoconf'], - action(e, props) { - const { message = messageArgs(this).msg } = props; + action(e, { message }) { e?.stopPropagation(); router.navigate({ name: router.getRouteName()!, diff --git a/apps/meteor/app/ui-utils/client/lib/MessageAction.ts b/apps/meteor/app/ui-utils/client/lib/MessageAction.ts index c1f9590b98ee..0a5483c4acaa 100644 --- a/apps/meteor/app/ui-utils/client/lib/MessageAction.ts +++ b/apps/meteor/app/ui-utils/client/lib/MessageAction.ts @@ -47,7 +47,6 @@ export type MessageActionConfig = { group?: MessageActionGroup | MessageActionGroup[]; context?: MessageActionContext[]; action: ( - this: any, e: Pick | undefined, { message, diff --git a/apps/meteor/app/ui-utils/client/lib/messageActionDefault.ts b/apps/meteor/app/ui-utils/client/lib/messageActionDefault.ts index 2f2793f7493b..ae2ff1cf80d2 100644 --- a/apps/meteor/app/ui-utils/client/lib/messageActionDefault.ts +++ b/apps/meteor/app/ui-utils/client/lib/messageActionDefault.ts @@ -7,7 +7,6 @@ import { getPermaLink } from '../../../../client/lib/getPermaLink'; import { imperativeModal } from '../../../../client/lib/imperativeModal'; import { roomCoordinator } from '../../../../client/lib/rooms/roomCoordinator'; import { dispatchToastMessage } from '../../../../client/lib/toast'; -import { messageArgs } from '../../../../client/lib/utils/messageArgs'; import { router } from '../../../../client/providers/RouterProvider'; import ForwardMessageModal from '../../../../client/views/room/modals/ForwardMessageModal/ForwardMessageModal'; import ReactionListModal from '../../../../client/views/room/modals/ReactionListModal'; @@ -32,8 +31,7 @@ Meteor.startup(async () => { context: ['message', 'message-mobile', 'threads', 'federated'], role: 'link', type: 'communication', - action(_, props) { - const { message = messageArgs(this).msg } = props; + action(_, { message }) { roomCoordinator.openRouteLink( 'd', { name: message.u.username }, @@ -74,8 +72,7 @@ Meteor.startup(async () => { label: 'Forward_message', context: ['message', 'message-mobile', 'threads'], type: 'communication', - async action(_, props) { - const { message = messageArgs(this).msg } = props; + async action(_, { message }) { const permalink = await getPermaLink(message._id); imperativeModal.open({ component: ForwardMessageModal, @@ -100,9 +97,7 @@ Meteor.startup(async () => { icon: 'quote', label: 'Quote', context: ['message', 'message-mobile', 'threads', 'federated'], - async action(_, props) { - const { message = messageArgs(this).msg, chat, autoTranslateOptions } = props; - + async action(_, { message, chat, autoTranslateOptions }) { if (message && autoTranslateOptions?.autoTranslateEnabled && autoTranslateOptions.showAutoTranslate(message)) { message.msg = message.translations && autoTranslateOptions.autoTranslateLanguage @@ -130,9 +125,8 @@ Meteor.startup(async () => { // classes: 'clipboard', context: ['message', 'message-mobile', 'threads', 'federated', 'videoconf', 'videoconf-threads'], type: 'duplication', - async action(_, props) { + async action(_, { message }) { try { - const { message = messageArgs(this).msg } = props; const permalink = await getPermaLink(message._id); await navigator.clipboard.writeText(permalink); dispatchToastMessage({ type: 'success', message: t('Copied') }); @@ -157,8 +151,7 @@ Meteor.startup(async () => { // classes: 'clipboard', context: ['message', 'message-mobile', 'threads', 'federated'], type: 'duplication', - async action(_, props) { - const { message = messageArgs(this).msg } = props; + async action(_, { message }) { const msgText = getMainMessageText(message).msg; await navigator.clipboard.writeText(msgText); dispatchToastMessage({ type: 'success', message: t('Copied') }); @@ -176,8 +169,7 @@ Meteor.startup(async () => { label: 'Edit', context: ['message', 'message-mobile', 'threads', 'federated'], type: 'management', - async action(_, props) { - const { message = messageArgs(this).msg, chat } = props; + async action(_, { message, chat }) { await chat?.messageEditing.editMessage(message); }, condition({ message, subscription, settings, room, user }) { @@ -220,7 +212,7 @@ Meteor.startup(async () => { context: ['message', 'message-mobile', 'threads', 'federated', 'videoconf', 'videoconf-threads'], color: 'alert', type: 'management', - async action(this: unknown, _, { message = messageArgs(this).msg, chat }) { + async action(_, { message, chat }) { await chat?.flows.requestMessageDeletion(message); }, condition({ message, subscription, room, chat, user }) { @@ -248,7 +240,7 @@ Meteor.startup(async () => { context: ['message', 'message-mobile', 'threads', 'federated', 'videoconf', 'videoconf-threads'], color: 'alert', type: 'management', - action(this: unknown, _, { message = messageArgs(this).msg }) { + action(_, { message }) { imperativeModal.open({ component: ReportMessageModal, props: { @@ -275,7 +267,7 @@ Meteor.startup(async () => { label: 'Reactions', context: ['message', 'message-mobile', 'threads', 'videoconf', 'videoconf-threads'], type: 'interaction', - action(this: unknown, _, { message: { reactions = {} } = messageArgs(this).msg }) { + action(_, { message: { reactions = {} } }) { imperativeModal.open({ component: ReactionListModal, props: { reactions, onClose: imperativeModal.close }, diff --git a/apps/meteor/client/components/message/toolbar/useWebDAVMessageAction.tsx b/apps/meteor/client/components/message/toolbar/useWebDAVMessageAction.tsx index a2be70077054..06f84aeee1f8 100644 --- a/apps/meteor/client/components/message/toolbar/useWebDAVMessageAction.tsx +++ b/apps/meteor/client/components/message/toolbar/useWebDAVMessageAction.tsx @@ -4,7 +4,6 @@ import React, { useEffect } from 'react'; import { MessageAction } from '../../../../app/ui-utils/client/lib/MessageAction'; import { getURL } from '../../../../app/utils/client'; import { useWebDAVAccountIntegrationsQuery } from '../../../hooks/webdav/useWebDAVAccountIntegrationsQuery'; -import { messageArgs } from '../../../lib/utils/messageArgs'; import SaveToWebdavModal from '../../../views/room/webdav/SaveToWebdavModal'; export const useWebDAVMessageAction = () => { @@ -26,8 +25,7 @@ export const useWebDAVMessageAction = () => { condition: ({ message, subscription }) => { return !!subscription && !!data?.length && !!message.file; }, - action(_, props) { - const { message = messageArgs(this).msg } = props; + action(_, { message }) { const [attachment] = message.attachments || []; const url = getURL(attachment.title_link as string, { full: true }); diff --git a/apps/meteor/client/lib/utils/messageArgs.ts b/apps/meteor/client/lib/utils/messageArgs.ts deleted file mode 100644 index 0a92a6fa8adc..000000000000 --- a/apps/meteor/client/lib/utils/messageArgs.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { IRoom, ISubscription, ITranslatedMessage, IUser, SettingValue } from '@rocket.chat/core-typings'; - -export const messageArgs = ( - context: any, -): { - context?: 'threads' | 'mentions'; - msg: ITranslatedMessage; - u: IUser; - room: IRoom; - settings: Record; - groupable: boolean; - hideRoles: boolean; - subscription: ISubscription; - customClass: string; - templatePrefix: string; - ignored: boolean; - shouldCollapseReplies: boolean; -} => context?._arguments?.[1]?.hash || context; diff --git a/apps/meteor/client/startup/actionButtons/jumpToMessage.ts b/apps/meteor/client/startup/actionButtons/jumpToMessage.ts index 0b50078e4d9a..9e8d7d5e07b9 100644 --- a/apps/meteor/client/startup/actionButtons/jumpToMessage.ts +++ b/apps/meteor/client/startup/actionButtons/jumpToMessage.ts @@ -1,7 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { MessageAction } from '../../../app/ui-utils/client'; -import { messageArgs } from '../../lib/utils/messageArgs'; import { setMessageJumpQueryStringParameter } from '../../lib/utils/setMessageJumpQueryStringParameter'; Meteor.startup(() => { @@ -10,8 +9,7 @@ Meteor.startup(() => { icon: 'jump', label: 'Jump_to_message', context: ['mentions', 'threads', 'videoconf-threads'], - action(_, props) { - const { message = messageArgs(this).msg } = props; + action(_, { message }) { setMessageJumpQueryStringParameter(message._id); }, order: 100, diff --git a/apps/meteor/client/startup/actionButtons/jumpToPinMessage.ts b/apps/meteor/client/startup/actionButtons/jumpToPinMessage.ts index f618c5655d85..70460d94bedf 100644 --- a/apps/meteor/client/startup/actionButtons/jumpToPinMessage.ts +++ b/apps/meteor/client/startup/actionButtons/jumpToPinMessage.ts @@ -1,7 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { MessageAction } from '../../../app/ui-utils/client'; -import { messageArgs } from '../../lib/utils/messageArgs'; import { setMessageJumpQueryStringParameter } from '../../lib/utils/setMessageJumpQueryStringParameter'; Meteor.startup(() => { @@ -10,8 +9,7 @@ Meteor.startup(() => { icon: 'jump', label: 'Jump_to_message', context: ['pinned', 'message-mobile', 'direct'], - action(_, props) { - const { message = messageArgs(this).msg } = props; + action(_, { message }) { setMessageJumpQueryStringParameter(message._id); }, condition({ subscription }) { diff --git a/apps/meteor/client/startup/actionButtons/jumpToSearchMessage.ts b/apps/meteor/client/startup/actionButtons/jumpToSearchMessage.ts index b2715cf18c9f..2dcbe7fabe6c 100644 --- a/apps/meteor/client/startup/actionButtons/jumpToSearchMessage.ts +++ b/apps/meteor/client/startup/actionButtons/jumpToSearchMessage.ts @@ -1,7 +1,6 @@ import { Meteor } from 'meteor/meteor'; import { MessageAction } from '../../../app/ui-utils/client'; -import { messageArgs } from '../../lib/utils/messageArgs'; import { setMessageJumpQueryStringParameter } from '../../lib/utils/setMessageJumpQueryStringParameter'; Meteor.startup(() => { @@ -10,8 +9,7 @@ Meteor.startup(() => { icon: 'jump', label: 'Jump_to_message', context: ['search'], - async action(_, props) { - const { message = messageArgs(this).msg } = props; + async action(_, { message }) { setMessageJumpQueryStringParameter(message._id); }, order: 100, diff --git a/apps/meteor/client/startup/actionButtons/jumpToStarMessage.ts b/apps/meteor/client/startup/actionButtons/jumpToStarMessage.ts index 1f4b9c871e02..73ac085d9edb 100644 --- a/apps/meteor/client/startup/actionButtons/jumpToStarMessage.ts +++ b/apps/meteor/client/startup/actionButtons/jumpToStarMessage.ts @@ -2,7 +2,6 @@ import { Meteor } from 'meteor/meteor'; import { settings } from '../../../app/settings/client'; import { MessageAction } from '../../../app/ui-utils/client'; -import { messageArgs } from '../../lib/utils/messageArgs'; import { setMessageJumpQueryStringParameter } from '../../lib/utils/setMessageJumpQueryStringParameter'; Meteor.startup(() => { @@ -11,8 +10,7 @@ Meteor.startup(() => { icon: 'jump', label: 'Jump_to_message', context: ['starred', 'threads', 'message-mobile', 'videoconf-threads'], - action(_, props) { - const { message = messageArgs(this).msg } = props; + action(_, { message }) { setMessageJumpQueryStringParameter(message._id); }, condition({ message, subscription, user }) { diff --git a/apps/meteor/client/startup/actionButtons/permalinkPinned.ts b/apps/meteor/client/startup/actionButtons/permalinkPinned.ts index ddd9237c3eb8..add09ca7dcd0 100644 --- a/apps/meteor/client/startup/actionButtons/permalinkPinned.ts +++ b/apps/meteor/client/startup/actionButtons/permalinkPinned.ts @@ -5,7 +5,6 @@ import { MessageAction } from '../../../app/ui-utils/client'; import { t } from '../../../app/utils/lib/i18n'; import { getPermaLink } from '../../lib/getPermaLink'; import { dispatchToastMessage } from '../../lib/toast'; -import { messageArgs } from '../../lib/utils/messageArgs'; Meteor.startup(() => { MessageAction.addButton({ @@ -13,9 +12,8 @@ Meteor.startup(() => { icon: 'permalink', label: 'Copy_link', context: ['pinned'], - async action(_, props) { + async action(_, { message }) { try { - const { message = messageArgs(this).msg } = props; const permalink = await getPermaLink(message._id); navigator.clipboard.writeText(permalink); dispatchToastMessage({ type: 'success', message: t('Copied') }); diff --git a/apps/meteor/client/startup/actionButtons/permalinkStar.ts b/apps/meteor/client/startup/actionButtons/permalinkStar.ts index a1ee8d79fc44..e4a235491cb7 100644 --- a/apps/meteor/client/startup/actionButtons/permalinkStar.ts +++ b/apps/meteor/client/startup/actionButtons/permalinkStar.ts @@ -5,7 +5,6 @@ import { MessageAction } from '../../../app/ui-utils/client'; import { t } from '../../../app/utils/lib/i18n'; import { getPermaLink } from '../../lib/getPermaLink'; import { dispatchToastMessage } from '../../lib/toast'; -import { messageArgs } from '../../lib/utils/messageArgs'; Meteor.startup(() => { MessageAction.addButton({ @@ -14,9 +13,8 @@ Meteor.startup(() => { label: 'Copy_link', // classes: 'clipboard', context: ['starred', 'threads', 'videoconf-threads'], - async action(_, props) { + async action(_, { message }) { try { - const { message = messageArgs(this).msg } = props; const permalink = await getPermaLink(message._id); navigator.clipboard.writeText(permalink); dispatchToastMessage({ type: 'success', message: t('Copied') }); diff --git a/apps/meteor/client/startup/actionButtons/pinMessage.tsx b/apps/meteor/client/startup/actionButtons/pinMessage.tsx index b383b4a3c648..8f54550d02d9 100644 --- a/apps/meteor/client/startup/actionButtons/pinMessage.tsx +++ b/apps/meteor/client/startup/actionButtons/pinMessage.tsx @@ -8,7 +8,6 @@ import { imperativeModal } from '../../lib/imperativeModal'; import { queryClient } from '../../lib/queryClient'; import { roomCoordinator } from '../../lib/rooms/roomCoordinator'; import { dispatchToastMessage } from '../../lib/toast'; -import { messageArgs } from '../../lib/utils/messageArgs'; import PinMessageModal from '../../views/room/modals/PinMessageModal'; Meteor.startup(() => { @@ -18,8 +17,7 @@ Meteor.startup(() => { label: 'Pin', type: 'interaction', context: ['pinned', 'message', 'message-mobile', 'threads', 'direct', 'videoconf', 'videoconf-threads'], - async action(_, props) { - const { message = messageArgs(this).msg } = props; + async action(_, { message }) { const onConfirm = async () => { message.pinned = true; try { diff --git a/apps/meteor/client/startup/actionButtons/starMessage.ts b/apps/meteor/client/startup/actionButtons/starMessage.ts index b4696041a729..9e8fc7245191 100644 --- a/apps/meteor/client/startup/actionButtons/starMessage.ts +++ b/apps/meteor/client/startup/actionButtons/starMessage.ts @@ -6,7 +6,6 @@ import { sdk } from '../../../app/utils/client/lib/SDKClient'; import { queryClient } from '../../lib/queryClient'; import { roomCoordinator } from '../../lib/rooms/roomCoordinator'; import { dispatchToastMessage } from '../../lib/toast'; -import { messageArgs } from '../../lib/utils/messageArgs'; Meteor.startup(() => { MessageAction.addButton({ @@ -15,9 +14,7 @@ Meteor.startup(() => { label: 'Star', type: 'interaction', context: ['starred', 'message', 'message-mobile', 'threads', 'federated', 'videoconf', 'videoconf-threads'], - async action(_, props) { - const { message = messageArgs(this).msg } = props; - + async action(_, { message }) { try { await sdk.call('starMessage', { ...message, starred: true }); queryClient.invalidateQueries(['rooms', message.rid, 'starred-messages']); diff --git a/apps/meteor/client/startup/actionButtons/unpinMessage.ts b/apps/meteor/client/startup/actionButtons/unpinMessage.ts index f5803f480a79..aa5fa49bb48e 100644 --- a/apps/meteor/client/startup/actionButtons/unpinMessage.ts +++ b/apps/meteor/client/startup/actionButtons/unpinMessage.ts @@ -6,7 +6,6 @@ import { MessageAction } from '../../../app/ui-utils/client'; import { sdk } from '../../../app/utils/client/lib/SDKClient'; import { queryClient } from '../../lib/queryClient'; import { dispatchToastMessage } from '../../lib/toast'; -import { messageArgs } from '../../lib/utils/messageArgs'; Meteor.startup(() => { MessageAction.addButton({ @@ -15,8 +14,7 @@ Meteor.startup(() => { label: 'Unpin', type: 'interaction', context: ['pinned', 'message', 'message-mobile', 'threads', 'direct', 'videoconf', 'videoconf-threads'], - async action(_, props) { - const { message = messageArgs(this).msg } = props; + async action(_, { message }) { message.pinned = false; try { await sdk.call('unpinMessage', message); diff --git a/apps/meteor/client/startup/actionButtons/unstarMessage.ts b/apps/meteor/client/startup/actionButtons/unstarMessage.ts index e5835b61fd8f..af33492a689a 100644 --- a/apps/meteor/client/startup/actionButtons/unstarMessage.ts +++ b/apps/meteor/client/startup/actionButtons/unstarMessage.ts @@ -5,7 +5,6 @@ import { MessageAction } from '../../../app/ui-utils/client'; import { sdk } from '../../../app/utils/client/lib/SDKClient'; import { queryClient } from '../../lib/queryClient'; import { dispatchToastMessage } from '../../lib/toast'; -import { messageArgs } from '../../lib/utils/messageArgs'; Meteor.startup(() => { MessageAction.addButton({ @@ -14,9 +13,7 @@ Meteor.startup(() => { label: 'Unstar_Message', type: 'interaction', context: ['starred', 'message', 'message-mobile', 'threads', 'federated', 'videoconf', 'videoconf-threads'], - async action(_, props) { - const { message = messageArgs(this).msg } = props; - + async action(_, { message }) { try { await sdk.call('starMessage', { ...message, starred: false }); queryClient.invalidateQueries(['rooms', message.rid, 'starred-messages']); diff --git a/apps/meteor/client/startup/readReceipt.ts b/apps/meteor/client/startup/readReceipt.ts index 36eb50b6bcbd..5998ea3e6c52 100644 --- a/apps/meteor/client/startup/readReceipt.ts +++ b/apps/meteor/client/startup/readReceipt.ts @@ -4,7 +4,6 @@ import { Tracker } from 'meteor/tracker'; import { settings } from '../../app/settings/client'; import { MessageAction } from '../../app/ui-utils/client'; import { imperativeModal } from '../lib/imperativeModal'; -import { messageArgs } from '../lib/utils/messageArgs'; import ReadReceiptsModal from '../views/room/modals/ReadReceiptsModal'; Meteor.startup(() => { @@ -21,8 +20,7 @@ Meteor.startup(() => { label: 'Read_Receipts', context: ['starred', 'message', 'message-mobile', 'threads', 'videoconf', 'videoconf-threads'], type: 'duplication', - action(_, props) { - const { message = messageArgs(this).msg } = props; + action(_, { message }) { imperativeModal.open({ component: ReadReceiptsModal, props: { messageId: message._id, onClose: imperativeModal.close },