From ed58b10486a1325c473d31d7aeafdebe712f4d00 Mon Sep 17 00:00:00 2001 From: Julien Virey Date: Tue, 2 Apr 2024 18:35:18 +0400 Subject: [PATCH] [MM-40568] Do not strip notification text for all platforms (#26536) * Do not strip notification text when using desktop app or webapp from linux * Remove notification text triming for all OS * 'strippedMarkdownNotifyText' is never reassigned. Use 'const' instead --------- Co-authored-by: Mattermost Build --- .../channels/src/actions/notification_actions.jsx | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/webapp/channels/src/actions/notification_actions.jsx b/webapp/channels/src/actions/notification_actions.jsx index 4118c11090..9110966d63 100644 --- a/webapp/channels/src/actions/notification_actions.jsx +++ b/webapp/channels/src/actions/notification_actions.jsx @@ -27,16 +27,11 @@ import MentionableRenderer from 'utils/markdown/mentionable_renderer'; import * as NotificationSounds from 'utils/notification_sounds'; import {showNotification} from 'utils/notifications'; import {cjkrPattern, escapeRegex} from 'utils/text_formatting'; -import {isDesktopApp, isMobileApp, isWindowsApp} from 'utils/user_agent'; +import {isDesktopApp, isMobileApp} from 'utils/user_agent'; import * as Utils from 'utils/utils'; import {runDesktopNotificationHooks} from './hooks'; -const NOTIFY_TEXT_MAX_LENGTH = 50; - -// windows notification length is based windows chrome which supports 128 characters and is the lowest length of windows browsers -const WINDOWS_NOTIFY_TEXT_MAX_LENGTH = 120; - const getSoundFromChannelMemberAndUser = (member, user) => { if (member?.notify_props?.desktop_sound) { return member.notify_props.desktop_sound === 'on'; @@ -244,12 +239,7 @@ export function sendDesktopNotification(post, msgProps) { image |= attachment.image_url.length > 0; }); - let strippedMarkdownNotifyText = stripMarkdown(notifyText); - - const notifyTextMaxLength = isWindowsApp() ? WINDOWS_NOTIFY_TEXT_MAX_LENGTH : NOTIFY_TEXT_MAX_LENGTH; - if (strippedMarkdownNotifyText.length > notifyTextMaxLength) { - strippedMarkdownNotifyText = strippedMarkdownNotifyText.substring(0, notifyTextMaxLength - 1) + '...'; - } + const strippedMarkdownNotifyText = stripMarkdown(notifyText); let body = `@${username}`; if (strippedMarkdownNotifyText.length === 0) {