From 61db718bae9b52faccf777f88510d3095612cb2d Mon Sep 17 00:00:00 2001 From: sugar Date: Fri, 7 Feb 2025 21:32:00 +0100 Subject: [PATCH] implement mastodon push permission currently doesn't do anything, but it's necessary for masto-fe to be able to sign in --- locales/en-US.yml | 1 + locales/index.js | 2 +- .../backend/src/misc/mastodon/mastodon-to-misskey-scopes.ts | 1 + packages/misskey-js/src/consts.ts | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index 1fc6fea3a..5465a3aad 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -2243,6 +2243,7 @@ _permissions: "read:clip-favorite": "View favorited clips" "read:federation": "Get federation data" "write:report-abuse": "Report violation" + "write:push-notification": "Receive push notifications" _auth: shareAccessTitle: "Granting application permissions" shareAccess: "Would you like to authorize \"{name}\" to access this account?" diff --git a/locales/index.js b/locales/index.js index 0770fd82a..1eeb2eaf3 100644 --- a/locales/index.js +++ b/locales/index.js @@ -72,7 +72,7 @@ export function build() { .reduce((a, [k, v]) => (a[k] = (() => { const [lang] = k.split('-'); switch (k) { - case 'ja-JP': return v; + case 'ja-JP': return merge(locales['en-US'], v); case 'ja-KS': case 'en-US': return merge(locales['ja-JP'], v); default: return merge( diff --git a/packages/backend/src/misc/mastodon/mastodon-to-misskey-scopes.ts b/packages/backend/src/misc/mastodon/mastodon-to-misskey-scopes.ts index 531a9bc6c..046fc8738 100644 --- a/packages/backend/src/misc/mastodon/mastodon-to-misskey-scopes.ts +++ b/packages/backend/src/misc/mastodon/mastodon-to-misskey-scopes.ts @@ -3,6 +3,7 @@ import { permissions } from 'misskey-js'; const mastodonToMisskeyScopes: Map = new Map([ ['profile', ['read:account']], ['follow', ['read:following', 'write:following', 'read:blocks', 'write:blocks', 'read:mutes', 'write:mutes']], + ['push', ['write:push-notification']], ['read:accounts', ['read:account']], ['read:blocks', ['read:blocks']], ['read:bookmarks', ['read:favorites']], diff --git a/packages/misskey-js/src/consts.ts b/packages/misskey-js/src/consts.ts index 470490c15..f3c7dfb79 100644 --- a/packages/misskey-js/src/consts.ts +++ b/packages/misskey-js/src/consts.ts @@ -103,6 +103,7 @@ export const permissions = [ 'read:clip-favorite', 'read:federation', 'write:report-abuse', + 'write:push-notification', // Mastodon permission ] as const; export const moderationLogTypes = [