diff --git a/packages/backend/assets/notification-badges/boost.png b/packages/backend/assets/notification-badges/boost.png new file mode 100644 index 0000000000..ebec4ecd85 Binary files /dev/null and b/packages/backend/assets/notification-badges/boost.png differ diff --git a/packages/backend/assets/notification-badges/clipboard-check-solid.png b/packages/backend/assets/notification-badges/clipboard-check.png similarity index 100% rename from packages/backend/assets/notification-badges/clipboard-check-solid.png rename to packages/backend/assets/notification-badges/clipboard-check.png diff --git a/packages/backend/assets/notification-badges/id-card-alt.png b/packages/backend/assets/notification-badges/id-card.png similarity index 100% rename from packages/backend/assets/notification-badges/id-card-alt.png rename to packages/backend/assets/notification-badges/id-card.png diff --git a/packages/backend/assets/notification-badges/poll-h.png b/packages/backend/assets/notification-badges/poll.png similarity index 100% rename from packages/backend/assets/notification-badges/poll-h.png rename to packages/backend/assets/notification-badges/poll.png diff --git a/packages/backend/assets/notification-badges/quote-right.png b/packages/backend/assets/notification-badges/quote.png similarity index 100% rename from packages/backend/assets/notification-badges/quote-right.png rename to packages/backend/assets/notification-badges/quote.png diff --git a/packages/backend/assets/notification-badges/reaction.png b/packages/backend/assets/notification-badges/reaction.png new file mode 100644 index 0000000000..d617a4c5c0 Binary files /dev/null and b/packages/backend/assets/notification-badges/reaction.png differ diff --git a/packages/backend/assets/notification-badges/retweet.png b/packages/backend/assets/notification-badges/retweet.png deleted file mode 100644 index dc61060481..0000000000 Binary files a/packages/backend/assets/notification-badges/retweet.png and /dev/null differ diff --git a/packages/firefish-js/src/entities.ts b/packages/firefish-js/src/entities.ts index 346830e0f7..e05952813d 100644 --- a/packages/firefish-js/src/entities.ts +++ b/packages/firefish-js/src/entities.ts @@ -222,6 +222,12 @@ export type Notification = { userId: User["id"]; note: Note; } + | { + type: "pollEnded"; + user: User; + userId: User["id"]; + note: Note; + } | { type: "follow"; user: User; diff --git a/packages/sw/src/scripts/create-notification.ts b/packages/sw/src/scripts/create-notification.ts index 12d76aabfc..30ffac3237 100644 --- a/packages/sw/src/scripts/create-notification.ts +++ b/packages/sw/src/scripts/create-notification.ts @@ -19,11 +19,11 @@ const closeNotificationsByTags = async (tags: string[]): Promise => { }; const iconUrl = (name: BadgeNames): string => - `/static-assets/tabler-badges/${name}.png`; + `/static-assets/notification-badges/${name}.png`; /* How to add a new badge: - * 1. Find the icon and download png from https://tabler-icons.io/ - * 2. vips resize ~/Downloads/icon-name.png vipswork.png 0.4; vips scRGB2BW vipswork.png ~/icon-name.png"[compression=9,strip]"; rm vipswork.png; - * 3. mv ~/icon-name.png ~/misskey/packages/backend/assets/tabler-badges/ + * 1. Find the icon from https://phosphoricons.com/ + * 2. Choose #000000 as the color, 96px as the size, and bold as the weight + * 3. Move icon-name.png to packages/backend/assets/notification-badges/ * 4. Add 'icon-name' to BadgeNames * 5. Add `badge: iconUrl('icon-name'),` */ @@ -131,7 +131,7 @@ async function composeNotification( { body: data.body.note.text || "", icon: data.body.user.avatarUrl, - badge: iconUrl("retweet"), + badge: iconUrl("boost"), data, actions: [ { @@ -150,7 +150,7 @@ async function composeNotification( { body: data.body.note.text || "", icon: data.body.user.avatarUrl, - badge: iconUrl("quote-right"), + badge: iconUrl("quote"), data, actions: [ { @@ -182,8 +182,7 @@ async function composeNotification( badge = badgeUrl.href; reaction = name.split("@")[0]; } else { - // Unicode絵文字の場合 - badge = `/twemoji-badge/${char2fileName(reaction)}.png`; + badge = iconUrl("reaction"); } if ( @@ -219,7 +218,7 @@ async function composeNotification( { body: data.body.note.text || "", icon: data.body.user.avatarUrl, - badge: iconUrl("poll-h"), + badge: iconUrl("poll"), data, }, ]; @@ -229,7 +228,7 @@ async function composeNotification( t("_notification.pollEnded"), { body: data.body.note.text || "", - badge: iconUrl("clipboard-check-solid"), + badge: iconUrl("clipboard-check"), data, }, ]; @@ -273,7 +272,7 @@ async function composeNotification( }), { body: data.body.invitation.group.name, - badge: iconUrl("id-card-alt"), + badge: iconUrl("id-card"), data, actions: [ { diff --git a/packages/sw/src/types.ts b/packages/sw/src/types.ts index 3de84e5749..991fcfd757 100644 --- a/packages/sw/src/types.ts +++ b/packages/sw/src/types.ts @@ -37,15 +37,17 @@ export type PushNotificationDataMap = { export type BadgeNames = | "null" - | "antenna" - | "arrow-back-up" | "at" - | "chart-arrows" - | "circle-check" - | "medal" + | "boost" + | "check" + | "clipboard-check" + | "clock" + | "comments" + | "id-card" | "messages" | "plus" + | "poll" | "quote" - | "repeat" - | "user-plus" - | "users"; + | "reaction" + | "reply" + | "user-plus";