diff --git a/CALCKEY.md b/CALCKEY.md index 45ed6f0df..b1ccadef7 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -9,6 +9,7 @@ - Rewrite backend in Rust and [Axum](https://github.com/tokio-rs/axum) - Function - Federate with note edits + - Admin customizable max note length (100-8000) - User "choices" (recommended users) like Mastodon and Soapbox - Join Reason system like Mastodon/Pleroma - Option to publicize instance blocks @@ -97,6 +98,7 @@ - Undo renote button inside original note - Custom locales - Obliteration of Ai-chan +- Switch to [Calckey.js](https://codeberg.org/thatonecalculator/cal) - MissV: [fix Misskey Forkbomb](https://code.vtopia.live/Vtopia/MissV/commit/40b23c070bd4adbb3188c73546c6c625138fb3c1) - [Make showing ads optional](https://github.com/misskey-dev/misskey/pull/8996) - [Tapping avatar in mobile opens account modal](https://github.com/misskey-dev/misskey/pull/9056) diff --git a/package.json b/package.json index dad94fd35..391723bfc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "13.0.0-beta1", + "version": "13.0.0-beta2", "codename": "aqua", "repository": { "type": "git", @@ -19,7 +19,7 @@ "start:test": "yarn workspace backend run start:test", "init": "yarn migrate", "migrate": "yarn workspace backend run migrate", - "revertmigration": "yarn workspace backend run revertmigration", + "revertmigration": "yarn workspace backend run revertmigration", "migrateandstart": "yarn migrate && yarn start", "gulp": "gulp build", "watch": "yarn dev", diff --git a/packages/backend/package.json b/packages/backend/package.json index 503631315..df1bebd85 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -42,6 +42,7 @@ "blurhash": "1.1.5", "bull": "4.10.1", "cacheable-lookup": "7.0.0", + "calckey-js": "^0.0.15", "cbor": "8.1.0", "chalk": "5.1.2", "chalk-template": "0.4.0", @@ -77,7 +78,6 @@ "koa-views": "7.0.2", "mfm-js": "0.23.0", "mime-types": "2.1.35", - "misskey-js": "0.0.14", "mocha": "10.1.0", "multer": "1.4.4-lts.1", "nested-property": "4.0.0", diff --git a/packages/backend/src/remote/resolve-user.ts b/packages/backend/src/remote/resolve-user.ts index b44981bb8..fe6b65472 100644 --- a/packages/backend/src/remote/resolve-user.ts +++ b/packages/backend/src/remote/resolve-user.ts @@ -1,13 +1,13 @@ import { URL } from 'node:url'; -import webFinger from './webfinger.js'; -import config from '@/config/index.js'; -import { createPerson, updatePerson } from './activitypub/models/person.js'; -import { remoteLogger } from './logger.js'; import chalk from 'chalk'; -import { User, IRemoteUser } from '@/models/entities/user.js'; +import { IsNull } from 'typeorm'; +import config from '@/config/index.js'; +import type { User, IRemoteUser } from '@/models/entities/user.js'; import { Users } from '@/models/index.js'; import { toPuny } from '@/misc/convert-host.js'; -import { IsNull } from 'typeorm'; +import webFinger from './webfinger.js'; +import { createPerson, updatePerson } from './activitypub/models/person.js'; +import { remoteLogger } from './logger.js'; const logger = remoteLogger.createSubLogger('resolve-user'); @@ -67,7 +67,7 @@ export async function resolveUser(username: string, host: string | null): Promis // validate uri const uri = new URL(self.href); if (uri.hostname !== host) { - throw new Error(`Invalid uri`); + throw new Error('Invalid uri'); } await Users.update({ diff --git a/packages/backend/src/server/api/endpoints/i/known-as.ts b/packages/backend/src/server/api/endpoints/i/known-as.ts index 7b3354190..d33906a65 100644 --- a/packages/backend/src/server/api/endpoints/i/known-as.ts +++ b/packages/backend/src/server/api/endpoints/i/known-as.ts @@ -28,7 +28,7 @@ export const meta = { id: 'fcd2eef9-a9b2-4c4f-8624-038099e90aa5', }, notRemote: { - message: 'User not remote.', + message: 'User is not remote. You can only migrate to other instances.', code: 'NOT_REMOTE', id: '4362f8dc-731f-4ad8-a694-be2a88922a24', }, @@ -61,8 +61,13 @@ export default define(meta, paramDef, async (ps, user) => { const updates = {} as Partial; + // FIXME: .uri is local uri, not remote uri! if (!knownAs.uri) knownAs.uri = ''; - updates.alsoKnownAs = [knownAs.uri]; + if (updates.alsoKnownAs == null || updates.alsoKnownAs.length === 0) { + updates.alsoKnownAs = [knownAs.uri]; + } else { + updates.alsoKnownAs.push(knownAs.uri); + } await Users.update(user.id, updates); diff --git a/packages/backend/test/utils.ts b/packages/backend/test/utils.ts index 245cf858d..6833e6eb5 100644 --- a/packages/backend/test/utils.ts +++ b/packages/backend/test/utils.ts @@ -6,7 +6,7 @@ import * as childProcess from 'child_process'; import * as http from 'node:http'; import { SIGKILL } from 'constants'; import WebSocket from 'ws'; -import * as misskey from 'misskey-js'; +import * as misskey from 'calckey-js'; import fetch from 'node-fetch'; import FormData from 'form-data'; import { DataSource } from 'typeorm'; diff --git a/packages/client/package.json b/packages/client/package.json index bc49ac021..c71ac27ef 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -19,6 +19,7 @@ "blurhash": "1.1.5", "broadcast-channel": "4.18.1", "browser-image-resizer": "https://github.com/misskey-dev/browser-image-resizer.git#commit=0380d12c8e736788ea7f4e6e985175521ea7b23c", + "calckey-js": "^0.0.15", "chart.js": "4.0.1", "chartjs-adapter-date-fns": "2.0.1", "chartjs-plugin-gradient": "0.5.1", @@ -34,7 +35,6 @@ "katex": "0.16.3", "matter-js": "0.18.0", "mfm-js": "0.23.0", - "misskey-js": "0.0.14", "photoswipe": "5.3.3", "prismjs": "1.29.0", "punycode": "2.1.1", diff --git a/packages/client/src/account.ts b/packages/client/src/account.ts index eefcc9a10..62fc2d82f 100644 --- a/packages/client/src/account.ts +++ b/packages/client/src/account.ts @@ -1,5 +1,5 @@ import { defineAsyncComponent, reactive } from 'vue'; -import * as misskey from 'misskey-js'; +import * as misskey from 'calckey-js'; import { showSuspendedDialog } from './scripts/show-suspended-dialog'; import { i18n } from './i18n'; import { del, get, set } from '@/scripts/idb-proxy'; diff --git a/packages/client/src/components/MkAbuseReportWindow.vue b/packages/client/src/components/MkAbuseReportWindow.vue index c83592d8c..b8ef6686c 100644 --- a/packages/client/src/components/MkAbuseReportWindow.vue +++ b/packages/client/src/components/MkAbuseReportWindow.vue @@ -24,7 +24,7 @@