diff options
| author | Kaity A <kaity@atikayda.au> | 2024-02-24 05:05:25 +0000 |
|---|---|---|
| committer | Kaity A <kaity@atikayda.au> | 2024-02-24 05:05:25 +0000 |
| commit | def2e8dff03da399e68045eec02dddc9d1781a0a (patch) | |
| tree | 6246b4898fb88d045c09accaf51d6a60b554d80e /packages/sw/src | |
| parent | fix: delete old follow request (if exists) before creating new (diff) | |
| parent | merge: Reactions not working on child notes in detailed view (!438) (diff) | |
| download | sharkey-def2e8dff03da399e68045eec02dddc9d1781a0a.tar.gz sharkey-def2e8dff03da399e68045eec02dddc9d1781a0a.tar.bz2 sharkey-def2e8dff03da399e68045eec02dddc9d1781a0a.zip | |
Merge remote-tracking branch 'origin/develop' into fix/failed-follow
Diffstat (limited to 'packages/sw/src')
| -rw-r--r-- | packages/sw/src/@types/global.d.ts | 2 | ||||
| -rw-r--r-- | packages/sw/src/scripts/create-notification.ts | 12 | ||||
| -rw-r--r-- | packages/sw/src/scripts/get-account-from-id.ts | 2 | ||||
| -rw-r--r-- | packages/sw/src/scripts/get-user-name.ts | 2 | ||||
| -rw-r--r-- | packages/sw/src/scripts/i18n.ts | 2 | ||||
| -rw-r--r-- | packages/sw/src/scripts/lang.ts | 2 | ||||
| -rw-r--r-- | packages/sw/src/scripts/login-id.ts | 2 | ||||
| -rw-r--r-- | packages/sw/src/scripts/operations.ts | 2 | ||||
| -rw-r--r-- | packages/sw/src/scripts/twemoji-base.ts | 2 | ||||
| -rw-r--r-- | packages/sw/src/sw.ts | 5 | ||||
| -rw-r--r-- | packages/sw/src/types.ts | 2 |
11 files changed, 23 insertions, 12 deletions
diff --git a/packages/sw/src/@types/global.d.ts b/packages/sw/src/@types/global.d.ts index 80d7b02fe5..bf63810e6d 100644 --- a/packages/sw/src/@types/global.d.ts +++ b/packages/sw/src/@types/global.d.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: syuilo and misskey-project * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/sw/src/scripts/create-notification.ts b/packages/sw/src/scripts/create-notification.ts index 2e1ab719ac..32b12f4b4f 100644 --- a/packages/sw/src/scripts/create-notification.ts +++ b/packages/sw/src/scripts/create-notification.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: syuilo and misskey-project * SPDX-License-Identifier: AGPL-3.0-only */ @@ -231,7 +231,15 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif badge: iconUrl('bell'), data, }]; - + + case 'edited': + return [t('_notification.edited', { name: getUserName(data.body.user) }), { + body: data.body.note.text ?? '', + icon: data.body.user.avatarUrl, + badge: iconUrl('messages'), + data, + }]; + default: return null; } diff --git a/packages/sw/src/scripts/get-account-from-id.ts b/packages/sw/src/scripts/get-account-from-id.ts index bbd306374e..19bfe052ee 100644 --- a/packages/sw/src/scripts/get-account-from-id.ts +++ b/packages/sw/src/scripts/get-account-from-id.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: syuilo and misskey-project * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/sw/src/scripts/get-user-name.ts b/packages/sw/src/scripts/get-user-name.ts index 2acdb91159..6472a6c4e6 100644 --- a/packages/sw/src/scripts/get-user-name.ts +++ b/packages/sw/src/scripts/get-user-name.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: syuilo and misskey-project * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/sw/src/scripts/i18n.ts b/packages/sw/src/scripts/i18n.ts index 2c7feccc44..77b955dbe8 100644 --- a/packages/sw/src/scripts/i18n.ts +++ b/packages/sw/src/scripts/i18n.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: syuilo and misskey-project * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/sw/src/scripts/lang.ts b/packages/sw/src/scripts/lang.ts index a2b99ff6b1..6fccedd746 100644 --- a/packages/sw/src/scripts/lang.ts +++ b/packages/sw/src/scripts/lang.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: syuilo and misskey-project * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/sw/src/scripts/login-id.ts b/packages/sw/src/scripts/login-id.ts index 7002485925..084b52d1e4 100644 --- a/packages/sw/src/scripts/login-id.ts +++ b/packages/sw/src/scripts/login-id.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: syuilo and misskey-project * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/sw/src/scripts/operations.ts b/packages/sw/src/scripts/operations.ts index 0cbf4c7953..24eea06231 100644 --- a/packages/sw/src/scripts/operations.ts +++ b/packages/sw/src/scripts/operations.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: syuilo and misskey-project * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/sw/src/scripts/twemoji-base.ts b/packages/sw/src/scripts/twemoji-base.ts index 32c5172131..e5b0603660 100644 --- a/packages/sw/src/scripts/twemoji-base.ts +++ b/packages/sw/src/scripts/twemoji-base.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: syuilo and misskey-project * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/sw/src/sw.ts b/packages/sw/src/sw.ts index f423eaca20..c38419eadc 100644 --- a/packages/sw/src/sw.ts +++ b/packages/sw/src/sw.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: syuilo and misskey-project * SPDX-License-Identifier: AGPL-3.0-only */ @@ -133,6 +133,9 @@ globalThis.addEventListener('notificationclick', (ev: ServiceWorkerGlobalScopeEv case 'showFollowRequests': client = await swos.openClient('push', '/my/follow-requests', loginId); break; + case 'edited': + if ('note' in data.body) client = await swos.openPost({ reply: data.body.note }, loginId); + break; default: switch (data.body.type) { case 'receiveFollowRequest': diff --git a/packages/sw/src/types.ts b/packages/sw/src/types.ts index c63e489c71..fac3e707d8 100644 --- a/packages/sw/src/types.ts +++ b/packages/sw/src/types.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: syuilo and misskey-project * SPDX-License-Identifier: AGPL-3.0-only */ |