Fix notification message for posts with no text content (#31007)

* Fix notification message for posts with no text

Changed the default notification message from "did something new" to
"posted a message" for better clarity when receiving notifications
from posts with no readable text content.

Fixes: MM-61948

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* address feedback from code review

---------

Co-authored-by: Claude <noreply@anthropic.com>
Этот коммит содержится в:
Jesse Hallam
2025-05-21 15:32:40 -03:00
коммит произвёл GitHub
родитель 31a8047973
Коммит c42d17b308
3 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@@ -144,7 +144,7 @@ describe('Desktop notifications', () => {
spyNotificationAs('withNotification', 'granted');
const actualMsg = '---';
const expected = '@' + otherUser.username + ' did something new';
const expected = '@' + otherUser.username + ' posted a message';
// # Ensure notifications are set up to fire a desktop notification for all activity.
changeDesktopNotificationAs('all');

Просмотреть файл

@@ -174,7 +174,7 @@ export function sendDesktopNotification(post: Post, msgProps: NewPostMessageProp
}
const getNotificationTitle = (channel: Pick<Channel, 'type' | 'display_name'>, msgProps: NewPostMessageProps, isCrtReply: boolean) => {
let title = Utils.localizeMessage({id: 'channel_loader.posted', defaultMessage: 'Posted'});
let title = Utils.localizeMessage({id: 'channel_loader.title', defaultMessage: 'Posted'});
if (channel.type === Constants.DM_CHANNEL) {
title = Utils.localizeMessage({id: 'notification.dm', defaultMessage: 'Direct Message'});
} else {
@@ -241,7 +241,7 @@ const getNotificationBody = (state: GlobalState, post: Post, msgProps: NewPostMe
} else if (image) {
body += Utils.localizeMessage({id: 'channel_loader.postedImage', defaultMessage: ' posted an image'});
} else {
body += Utils.localizeMessage({id: 'channel_loader.something', defaultMessage: ' did something new'});
body += Utils.localizeMessage({id: 'channel_loader.posted', defaultMessage: ' posted a message'});
}
} else {
body += `: ${strippedMarkdownNotifyText}`;

Просмотреть файл

@@ -3484,11 +3484,11 @@
"channel_invite.no_options_message": "No matches found - <InvitationModalLink>Invite them to the team</InvitationModalLink>",
"channel_invite.policy_enforced.description": "Only people who match the specified access rules can be selected and added to this channel.",
"channel_invite.policy_enforced.title": "Channel access is restricted by user attributes",
"channel_loader.posted": "Posted",
"channel_loader.posted": " posted a message",
"channel_loader.postedImage": " posted an image",
"channel_loader.socketError": "Please check connection, Mattermost unreachable. If issue persists, ask administrator to [check WebSocket port](!https://docs.mattermost.com/install/troubleshooting.html#please-check-connection-mattermost-unreachable-if-issue-persists-ask-administrator-to-check-websocket-port).",
"channel_loader.someone": "Someone",
"channel_loader.something": " did something new",
"channel_loader.title": "Posted",
"channel_loader.unknown_error": "We received an unexpected status code from the server.",
"channel_loader.uploadedFile": " uploaded a file",
"channel_loader.uploadedImage": " uploaded an image",