From 4cc5b734e774ff209faf94ffc1001934dc98cf91 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 6 Dec 2022 21:49:19 +0100 Subject: [PATCH] activitypub: remove integration fields from person and nodeinfo --- .../src/remote/activitypub/models/person.ts | 43 ++----------------- packages/backend/src/server/nodeinfo.ts | 3 -- 2 files changed, 4 insertions(+), 42 deletions(-) diff --git a/packages/backend/src/remote/activitypub/models/person.ts b/packages/backend/src/remote/activitypub/models/person.ts index 13107f24f..503547972 100644 --- a/packages/backend/src/remote/activitypub/models/person.ts +++ b/packages/backend/src/remote/activitypub/models/person.ts @@ -401,37 +401,6 @@ export async function resolvePerson(uri: string, resolver: Resolver): Promise any - } = { - 'misskey:authentication:twitter': (userId, screenName) => ({ userId, screenName }), - 'misskey:authentication:github': (id, login) => ({ id, login }), - 'misskey:authentication:discord': (id, name) => $discord(id, name), - }; - -const $discord = (id: string, name: string) => { - if (typeof name !== 'string') { - return { id, username: 'unknown', discriminator: '0000' }; - } else { - const [username, discriminator] = name.split('#'); - return { id, username, discriminator }; - } -}; - -function addService(target: { [x: string]: any }, source: IApPropertyValue) { - const service = services[source.name]; - - if (typeof source.value !== 'string') { - source.value = 'unknown'; - } - - const [id, username] = source.value.split('@'); - - if (service) { - target[source.name.split(':')[2]] = service(id, username); - } -} - export function analyzeAttachments(attachments: IObject | IObject[] | undefined) { const fields: { name: string, @@ -441,14 +410,10 @@ export function analyzeAttachments(attachments: IObject | IObject[] | undefined) if (Array.isArray(attachments)) { for (const attachment of attachments.filter(isPropertyValue)) { - if (isPropertyValue(attachment.identifier)) { - addService(services, attachment.identifier); - } else { - fields.push({ - name: attachment.name, - value: fromHtml(attachment.value), - }); - } + fields.push({ + name: attachment.name, + value: fromHtml(attachment.value), + }); } } diff --git a/packages/backend/src/server/nodeinfo.ts b/packages/backend/src/server/nodeinfo.ts index b06e01f90..eb1769722 100644 --- a/packages/backend/src/server/nodeinfo.ts +++ b/packages/backend/src/server/nodeinfo.ts @@ -97,9 +97,6 @@ const nodeinfo2 = async (): Promise => { enableHcaptcha: meta.enableHcaptcha, enableRecaptcha: meta.enableRecaptcha, maxNoteTextLength: config.maxNoteTextLength, - enableTwitterIntegration: meta.enableTwitterIntegration, - enableGithubIntegration: meta.enableGithubIntegration, - enableDiscordIntegration: meta.enableDiscordIntegration, enableEmail: meta.enableEmail, proxyAccountName: proxyAccount?.username ?? null, themeColor: meta.themeColor || '#86b300',