summaryrefslogtreecommitdiff
path: root/src/client/app/common/scripts/compose-notification.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/app/common/scripts/compose-notification.ts')
-rw-r--r--src/client/app/common/scripts/compose-notification.ts62
1 files changed, 34 insertions, 28 deletions
diff --git a/src/client/app/common/scripts/compose-notification.ts b/src/client/app/common/scripts/compose-notification.ts
index cc28f75998..2e58649ac2 100644
--- a/src/client/app/common/scripts/compose-notification.ts
+++ b/src/client/app/common/scripts/compose-notification.ts
@@ -20,34 +20,6 @@ export default function(type, data): Notification {
icon: data.url + '?thumbnail&size=64'
};
- case 'mention':
- return {
- title: `${getUserName(data.user)}さんから:`,
- body: getNoteSummary(data),
- icon: data.user.avatarUrl + '?thumbnail&size=64'
- };
-
- case 'reply':
- return {
- title: `${getUserName(data.user)}さんから返信:`,
- body: getNoteSummary(data),
- icon: data.user.avatarUrl + '?thumbnail&size=64'
- };
-
- case 'quote':
- return {
- title: `${getUserName(data.user)}さんが引用:`,
- body: getNoteSummary(data),
- icon: data.user.avatarUrl + '?thumbnail&size=64'
- };
-
- case 'reaction':
- return {
- title: `${getUserName(data.user)}: ${getReactionEmoji(data.reaction)}:`,
- body: getNoteSummary(data.note),
- icon: data.user.avatarUrl + '?thumbnail&size=64'
- };
-
case 'unread_messaging_message':
return {
title: `${getUserName(data.user)}さんからメッセージ:`,
@@ -62,6 +34,40 @@ export default function(type, data): Notification {
icon: data.parent.avatarUrl + '?thumbnail&size=64'
};
+ case 'notification':
+ switch (data.type) {
+ case 'mention':
+ return {
+ title: `${getUserName(data.user)}さんから:`,
+ body: getNoteSummary(data),
+ icon: data.user.avatarUrl + '?thumbnail&size=64'
+ };
+
+ case 'reply':
+ return {
+ title: `${getUserName(data.user)}さんから返信:`,
+ body: getNoteSummary(data),
+ icon: data.user.avatarUrl + '?thumbnail&size=64'
+ };
+
+ case 'quote':
+ return {
+ title: `${getUserName(data.user)}さんが引用:`,
+ body: getNoteSummary(data),
+ icon: data.user.avatarUrl + '?thumbnail&size=64'
+ };
+
+ case 'reaction':
+ return {
+ title: `${getUserName(data.user)}: ${getReactionEmoji(data.reaction)}:`,
+ body: getNoteSummary(data.note),
+ icon: data.user.avatarUrl + '?thumbnail&size=64'
+ };
+
+ default:
+ return null;
+ }
+
default:
return null;
}