Merge branch 'subscription-fixes' into 'develop'

Subscription / Notifications fixes

See merge request soapbox-pub/soapbox-fe!1620
environments/review-develop-3zknud/deployments/520
Alex Gleason 2 years ago
commit f42973b00e

@ -89,6 +89,7 @@ const updateNotifications = (notification: APIEntity) =>
const updateNotificationsQueue = (notification: APIEntity, intlMessages: Record<string, string>, intlLocale: string, curPath: string) =>
(dispatch: AppDispatch, getState: () => RootState) => {
if (!notification.type) return; // drop invalid notifications
if (notification.type === 'pleroma:chat_mention') return; // Drop chat notifications, handle them per-chat
const showAlert = getSettings(getState()).getIn(['notifications', 'alerts', notification.type]);

@ -57,7 +57,7 @@ class NotificationFilterBar extends React.PureComponent {
name: 'mention',
});
items.push({
text: <Icon src={require('@tabler/icons/thumb-up.svg')} />,
text: <Icon src={require('@tabler/icons/heart.svg')} />,
title: intl.formatMessage(messages.favourites),
action: this.onClick('favourite'),
name: 'favourite',
@ -81,7 +81,7 @@ class NotificationFilterBar extends React.PureComponent {
name: 'poll',
});
items.push({
text: <Icon src={require('@tabler/icons/home.svg')} />,
text: <Icon src={require('@tabler/icons/bell-ringing.svg')} />,
title: intl.formatMessage(messages.statuses),
action: this.onClick('status'),
name: 'status',

@ -9,12 +9,12 @@ import { HStack, Text, Emoji } from 'soapbox/components/ui';
import AccountContainer from 'soapbox/containers/account_container';
import StatusContainer from 'soapbox/containers/status_container';
import { useAppSelector } from 'soapbox/hooks';
import { NotificationType, validType } from 'soapbox/utils/notification';
import type { ScrollPosition } from 'soapbox/components/status';
import type { NotificationType } from 'soapbox/normalizers/notification';
import type { Account, Status, Notification as NotificationEntity } from 'soapbox/types/entities';
const notificationForScreenReader = (intl: ReturnType<typeof useIntl>, message: string, timestamp: Date) => {
const notificationForScreenReader = (intl: IntlShape, message: string, timestamp: Date) => {
const output = [message];
output.push(intl.formatDate(timestamp, { hour: '2-digit', minute: '2-digit', month: 'short', day: 'numeric' }));
@ -48,7 +48,7 @@ const icons: Record<NotificationType, string> = {
user_approved: require('@tabler/icons/user-plus.svg'),
};
const messages: Record<string | number | symbol, MessageDescriptor> = defineMessages({
const messages: Record<NotificationType, MessageDescriptor> = defineMessages({
follow: {
id: 'notification.follow',
defaultMessage: '{name} followed you',
@ -82,7 +82,7 @@ const messages: Record<string | number | symbol, MessageDescriptor> = defineMess
defaultMessage: '{name} moved to {targetName}',
},
'pleroma:chat_mention': {
id: 'notification.chat_mention',
id: 'notification.pleroma:chat_mention',
defaultMessage: '{name} sent you a message',
},
'pleroma:emoji_reaction': {
@ -221,7 +221,7 @@ const Notification: React.FC<INotificaton> = (props) => {
className='w-4 h-4 flex-none'
/>
);
} else if (type) {
} else if (validType(type)) {
return (
<Icon
src={icons[type]}
@ -279,27 +279,25 @@ const Notification: React.FC<INotificaton> = (props) => {
const targetName = notification.target && typeof notification.target === 'object' ? notification.target.acct : '';
const message: React.ReactNode = type && account && typeof account === 'object' ? buildMessage(intl, type, account, notification.total_count, targetName, instance.title) : null;
const message: React.ReactNode = validType(type) && account && typeof account === 'object' ? buildMessage(intl, type, account, notification.total_count, targetName, instance.title) : null;
const ariaLabel = validType(type) ? (
notificationForScreenReader(
intl,
intl.formatMessage(messages[type], {
name: account && typeof account === 'object' ? account.acct : '',
targetName,
}),
notification.created_at,
)
) : '';
return (
<HotKeys handlers={getHandlers()} data-testid='notification'>
<div
className='notification focusable'
tabIndex={0}
aria-label={
notificationForScreenReader(
intl,
intl.formatMessage({
id: type && messages[type].id,
defaultMessage: type && messages[type].defaultMessage,
},
{
name: account && typeof account === 'object' ? account.acct : '',
targetName,
}),
notification.created_at,
)
}
aria-label={ariaLabel}
>
<div className='p-4 focusable'>
<div className='mb-2'>

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "أُعجِب {name} بمنشورك",
"notification.follow": "{name} يتابعك",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} favorited your post",
"notification.follow": "{name} siguióte",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} хареса твоята публикация",
"notification.follow": "{name} те последва",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} আপনার কার্যক্রম পছন্দ করেছেন",
"notification.follow": "{name} আপনাকে অনুসরণ করেছেন",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} favorited your post",
"notification.follow": "{name} followed you",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} t'ha enviat un missatge",
"notification.pleroma:chat_mention": "{name} t'ha enviat un missatge",
"notification.favourite": "{name} ha afavorit el teu estat",
"notification.follow": "{name} t'ha seguit",
"notification.follow_request": "{name} ha sol·licitat seguir-te",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} hà aghjuntu u vostru statutu à i so favuriti",
"notification.follow": "{name} v'hà seguitatu",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} Vám poslal/a zprávu",
"notification.pleroma:chat_mention": "{name} Vám poslal/a zprávu",
"notification.favourite": "{name} si oblíbil/a váš příspěvek",
"notification.follow": "{name} vás začal/a sledovat",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "hoffodd {name} eich tŵt",
"notification.follow": "dilynodd {name} chi",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} favoriserede din status",
"notification.follow": "{name} fulgte dig",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} hat dir eine Nachricht gesendet",
"notification.pleroma:chat_mention": "{name} hat dir eine Nachricht gesendet",
"notification.favourite": "{name} hat deinen Beitrag favorisiert",
"notification.follow": "{name} folgt dir",
"notification.follow_request": "{name} möchte dir folgen",

@ -4318,7 +4318,7 @@
},
{
"defaultMessage": "{name} sent you a message",
"id": "notification.chat_mention"
"id": "notification.pleroma:chat_mention"
},
{
"defaultMessage": "{name} reacted to your post",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "Ο/Η {name} σημείωσε ως αγαπημένη την κατάστασή σου",
"notification.follow": "Ο/Η {name} σε ακολούθησε",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} 𐑕𐑧𐑯𐑑 𐑿 𐑩 𐑥𐑧𐑕𐑦𐑡",
"notification.pleroma:chat_mention": "{name} 𐑕𐑧𐑯𐑑 𐑿 𐑩 𐑥𐑧𐑕𐑦𐑡",
"notification.favourite": "{name} 𐑤𐑲𐑒𐑑 𐑘𐑹 𐑐𐑴𐑕𐑑",
"notification.follow": "{name} 𐑓𐑪𐑤𐑴𐑛 𐑿",
"notification.follow_request": "{name} 𐑣𐑨𐑟 𐑮𐑦𐑒𐑢𐑧𐑕𐑑𐑩𐑛 𐑑 𐑓𐑪𐑤𐑴 𐑿",

@ -712,7 +712,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} liked your post",
"notification.follow": "{name} followed you",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} stelumis vian mesaĝon",
"notification.follow": "{name} eksekvis vin",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} marcó tu estado como favorito",
"notification.follow": "{name} te empezó a seguir",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} marcó tu estado como favorito",
"notification.follow": "{name} te empezó a seguir",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} märkis su staatuse lemmikuks",
"notification.follow": "{name} jälgib sind",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name}(e)k zure mezua gogoko du",
"notification.follow": "{name}(e)k jarraitzen zaitu",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} نوشتهٔ شما را پسندید",
"notification.follow": "{name} پیگیر شما شد",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} tykkäsi tilastasi",
"notification.follow": "{name} seurasi sinua",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} a ajouté à ses favoris:",
"notification.follow": "{name} vous suit",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} favorited your post",
"notification.follow": "{name} followed you",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} marcou como favorito o seu estado",
"notification.follow": "{name} está a seguila",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} שלח לך הודעה",
"notification.pleroma:chat_mention": "{name} שלח לך הודעה",
"notification.favourite": "הפוסט שלך חובב על ידי {name}",
"notification.follow": "{name} במעקב אחרייך",
"notification.follow_request": "{name} ביקש לעקוב אחריך",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} favorited your post",
"notification.follow": "{name} followed you",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} je lajkao tvoj status",
"notification.follow": "{name} te sada slijedi",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} kedvencnek jelölte egy tülködet",
"notification.follow": "{name} követ téged",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} հավանեց թութդ",
"notification.follow": "{name} սկսեց հետեւել քեզ",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} menyukai status anda",
"notification.follow": "{name} mengikuti anda",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} favorizis tua mesajo",
"notification.follow": "{name} sequeskis tu",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} oggi festeggia il compleanno",
"notification.birthday.more": "{count} e {count, plural, un {friend} più {friends}}",
"notification.birthday_plural": "{name} e {more} oggi festeggiano il compleanno",
"notification.chat_mention": "{name} ti ha spedito un messaggio",
"notification.pleroma:chat_mention": "{name} ti ha spedito un messaggio",
"notification.favourite": "{name} ha apprezzato il contenuto",
"notification.follow": "{name} adesso ti segue",
"notification.follow_request": "{name} ha chiesto di seguirti",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name}さんがあなたにメッセージを送りました",
"notification.pleroma:chat_mention": "{name}さんがあなたにメッセージを送りました",
"notification.favourite": "{name}さんがあなたの投稿をお気に入りに登録しました",
"notification.follow": "{name}さんにフォローされました",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name}-მა თქვენი სტატუსი აქცია ფავორიტად",
"notification.follow": "{name} გამოგყვათ",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} жазбаңызды таңдаулыға қосты",
"notification.follow": "{name} сізге жазылды",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name}님이 즐겨찾기 했습니다",
"notification.follow": "{name}님이 나를 팔로우 했습니다",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} favorited your post",
"notification.follow": "{name} followed you",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} favorited your post",
"notification.follow": "{name} followed you",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} favorited your post",
"notification.follow": "{name} followed you",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} favorited your post",
"notification.follow": "{name} followed you",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} voegde jouw toot als favoriet toe",
"notification.follow": "{name} volgt jou nu",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} likte din status",
"notification.follow": "{name} fulgte deg",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} likte din status",
"notification.follow": "{name} fulgte deg",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} a ajustat a sos favorits",
"notification.follow": "{name} vos sèc",
"notification.follow_request": "{name} has requested to follow you",

@ -749,7 +749,7 @@
"notification.birthday": "{name} ma dziś urodziny",
"notification.birthday.more": "{count} {count, plural, one {znajomy} other {więcej znajomych}}",
"notification.birthday_plural": "{name} i {more} mają dziś urodziny",
"notification.chat_mention": "{name} wysłał(a) Ci wiadomośść",
"notification.pleroma:chat_mention": "{name} wysłał(a) Ci wiadomośść",
"notification.favourite": "{name} dodał(a) Twój wpis do ulubionych",
"notification.follow": "{name} zaczął(-ęła) Cię śledzić",
"notification.follow_request": "{name} poprosił(a) Cię o możliwość śledzenia",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} adicionou a sua postagem aos favoritos",
"notification.follow": "{name} te seguiu",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} enviou-te uma mensagem",
"notification.pleroma:chat_mention": "{name} enviou-te uma mensagem",
"notification.favourite": "{name} gostou desta publicação",
"notification.follow": "{name} começou a seguir-te",
"notification.follow_request": "{name} pediu para te seguir",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} a adăugat statusul tău la favorite",
"notification.follow": "{name} te urmărește",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} понравился Ваш статус",
"notification.follow": "{name} подписался (-лась) на вас",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} si obľúbil/a tvoj príspevok",
"notification.follow": "{name} ťa začal/a následovať",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} je vzljubil/a vaš status",
"notification.follow": "{name} vam sledi",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} parapëlqeu gjendjen tuaj",
"notification.follow": "{name} zuri tju ndjekë",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} je stavio Vaš status kao omiljeni",
"notification.follow": "{name} Vas je zapratio",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} је ставио/ла Ваш статус као омиљени",
"notification.follow": "{name} Вас је запратио/ла",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} favoriserade din status",
"notification.follow": "{name} följer dig",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} ஆர்வம் கொண்டவர், உங்கள் நிலை",
"notification.follow": "{name} நீங்கள் தொடர்ந்து வந்தீர்கள்",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} మీ స్టేటస్ ను ఇష్టపడ్డారు",
"notification.follow": "{name} మిమ్మల్ని అనుసరిస్తున్నారు",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} ได้ชื่นชอบสถานะของคุณ",
"notification.follow": "{name} ได้ติดตามคุณ",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} senin durumunu favorilere ekledi",
"notification.follow": "{name} seni takip ediyor",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} вподобав(-ла) ваш допис",
"notification.follow": "{name} підписався(-лась) на Вас",
"notification.follow_request": "{name} відправив(-ла) запит на підписку",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} 回复了你",
"notification.pleroma:chat_mention": "{name} 回复了你",
"notification.favourite": "{name} 赞了你的帖文",
"notification.follow": "{name} 开始关注你",
"notification.follow_request": "{name} 请求关注你",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} 收藏了你的文章",
"notification.follow": "{name} 開始關注你",
"notification.follow_request": "{name} has requested to follow you",

@ -706,7 +706,7 @@
"notification.birthday": "{name} has a birthday today",
"notification.birthday.more": "{count} more {count, plural, one {friend} other {friends}}",
"notification.birthday_plural": "{name} and {more} have birthday today",
"notification.chat_mention": "{name} sent you a message",
"notification.pleroma:chat_mention": "{name} sent you a message",
"notification.favourite": "{name} 把你的嘟文加入了最愛",
"notification.follow": "{name} 關注了你",
"notification.follow_request": "{name} has requested to follow you",

@ -11,19 +11,6 @@ import {
import type { Account, Status, EmbeddedEntity } from 'soapbox/types/entities';
export type NotificationType =
'follow'
| 'follow_request'
| 'mention'
| 'reblog'
| 'favourite'
| 'poll'
| 'status'
| 'move'
| 'pleroma:chat_mention'
| 'pleroma:emoji_reaction'
| 'user_approved';
// https://docs.joinmastodon.org/entities/notification/
export const NotificationRecord = ImmutableRecord({
account: null as EmbeddedEntity<Account>,
@ -33,7 +20,7 @@ export const NotificationRecord = ImmutableRecord({
id: '',
status: null as EmbeddedEntity<Status>,
target: null as EmbeddedEntity<Account>, // move
type: '' as NotificationType | '',
type: '',
total_count: null as number | null, // grouped notifications
});

@ -20,6 +20,12 @@ filenames.forEach(filename => {
'notification.mention': full['notification.mention'] || '',
'notification.reblog': full['notification.reblog'] || '',
'notification.poll': full['notification.poll'] || '',
'notification.status': full['notification.status'] || '',
'notification.move': full['notification.move'] || '',
'notification.user_approved': full['notification.user_approved'] || '',
'notification.pleroma:chat_mention': full['notification.pleroma:chat_mention'] || '',
'notification.pleroma:emoji_reaction': full['notification.pleroma:emoji_reaction'] || '',
'status.show_more': full['status.show_more'] || '',
'status.reblog': full['status.reblog'] || '',

@ -0,0 +1,25 @@
/** Notification types known to Soapbox. */
const NOTIFICATION_TYPES = [
'follow',
'follow_request',
'mention',
'reblog',
'favourite',
'poll',
'status',
'move',
'pleroma:chat_mention',
'pleroma:emoji_reaction',
'user_approved',
] as const;
type NotificationType = typeof NOTIFICATION_TYPES[number];
/** Ensure the Notification is a valid, known type. */
const validType = (type: string): type is NotificationType => NOTIFICATION_TYPES.includes(type as any);
export {
NOTIFICATION_TYPES,
NotificationType,
validType,
};
Loading…
Cancel
Save