diff --git a/packages/sw/src/scripts/create-notification.ts b/packages/sw/src/scripts/create-notification.ts index 745396d1e3..0dc6b55079 100644 --- a/packages/sw/src/scripts/create-notification.ts +++ b/packages/sw/src/scripts/create-notification.ts @@ -59,7 +59,7 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif if (!account) return null; const userDetail = await cli.request('users/show', { userId: data.body.userId }, account.token); return [t('_notification.youWereFollowed'), { - body: getUserName(data.body.user), + body: `${getUserName(data.body.user)} (@${data.body.user?.username}${data.body.user?.host != null ? '@' + data.body.user.host : ''})`, icon: data.body.user.avatarUrl, badge: iconUrl('user-plus'), data, @@ -264,7 +264,7 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif }]; } return [data.body.group?.name ?? '', { - body: `${data.body.user?.username}: ${data.body.text ?? ''}`, + body: `${getUserName(data.body.user)}: ${data.body.text ?? ''}`, icon: data.body.user.avatarUrl, badge: iconUrl('messages'), tag: `messaging:group:${data.body.groupId}`,