From a88fe74b8269873ff05915a3cd42b95b096a72fa Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 26 Jul 2022 14:45:36 -0700 Subject: [PATCH 001/234] semi for children --- packages/backend/src/server/api/endpoints/notes/children.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/notes/children.ts b/packages/backend/src/server/api/endpoints/notes/children.ts index feaf94dcf..7f2245c7e 100644 --- a/packages/backend/src/server/api/endpoints/notes/children.ts +++ b/packages/backend/src/server/api/endpoints/notes/children.ts @@ -55,7 +55,7 @@ export default define(meta, paramDef, async (ps, user) => { .andWhere('note.id IN (SELECT id FROM note_replies(:noteId, :depth, :limit))', { noteId: ps.noteId, depth: ps.depth, limit: ps.limit }) .innerJoinAndSelect('note.user', 'user') .leftJoinAndSelect('user.avatar', 'avatar') - .leftJoinAndSelect('user.banner', 'banner') + .leftJoinAndSelect('user.banner', 'banner'); generateVisibilityQuery(query, user); if (user) { From 805e389d06fbee0f7fa6e09704259c0c3d010d60 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 26 Jul 2022 21:02:43 -0700 Subject: [PATCH 002/234] accesibility --- packages/client/src/components/instance-ticker.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/instance-ticker.vue b/packages/client/src/components/instance-ticker.vue index d9f196f88..ed9d30b8c 100644 --- a/packages/client/src/components/instance-ticker.vue +++ b/packages/client/src/components/instance-ticker.vue @@ -1,6 +1,6 @@ From 4c1b2c79c5ef2cd17675b2d30714e152d79b80a1 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 26 Jul 2022 21:03:22 -0700 Subject: [PATCH 003/234] cl --- CALCKEY.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CALCKEY.md b/CALCKEY.md index 4eb418b20..4941f8a93 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -16,18 +16,18 @@ - Filter notifications by user - Remove NSFW/AI stuff - [Rat mode?](https://stop.voring.me/notes/933fx97bmd) -- Improve accesibility score -
Current Misskey score is 57/100 - -![](https://pool.jortage.com/voringme/misskey/8ff18aae-4dc6-4b08-9e05-a4c9d051a9e3.png) - -
## Work in progress - Less cluttered notification summary - Better timeline top bar - Admin custom CSS +- Improve accesibility score +
Current Misskey score is 57/100 + +![](https://pool.jortage.com/voringme/misskey/8ff18aae-4dc6-4b08-9e05-a4c9d051a9e3.png) + +
## Implemented From 82e5b80641e00c9aebcaf172d1e5b231533d8310 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 26 Jul 2022 21:03:37 -0700 Subject: [PATCH 004/234] cl --- CALCKEY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CALCKEY.md b/CALCKEY.md index 4941f8a93..f3150596d 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -20,7 +20,6 @@ ## Work in progress - Less cluttered notification summary -- Better timeline top bar - Admin custom CSS - Improve accesibility score
Current Misskey score is 57/100 @@ -37,6 +36,7 @@ - Rosé Pine by default (+ non-themable elements made Rosé Pine) - Better sidebar/navbar - [Profile background as banner](https://codeberg.org/Freeplay/Misskey-Tweaks/src/branch/main/snippets/profile-background.styl) +- Better timeline top bar - Mark as read from notifications widget - Better welcome screen (not logged in) - Ability to turn off "Connection lost" message From 768de4f29a3d8a654c25188f22d8e76a04db2503 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 26 Jul 2022 21:18:36 -0700 Subject: [PATCH 005/234] More rpine --- packages/client/src/components/notification.vue | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/client/src/components/notification.vue b/packages/client/src/components/notification.vue index 9589970a4..613eef451 100644 --- a/packages/client/src/components/notification.vue +++ b/packages/client/src/components/notification.vue @@ -214,50 +214,50 @@ useTooltip(reactionRef, (showing) => { } > * { - color: #fff; + color: #e0def4; width: 100%; height: 100%; } &.follow, &.followRequestAccepted, &.receiveFollowRequest, &.groupInvited { padding: 3px; - background: #36aed2; + background: #31748f; pointer-events: none; } &.renote { padding: 3px; - background: #36d298; + background: #9ccfd8; pointer-events: none; } &.quote { padding: 3px; - background: #36d298; + background: #9ccfd8; pointer-events: none; } &.reply { padding: 3px; - background: #007aff; + background: #c4a7e7; pointer-events: none; } &.mention { padding: 3px; - background: #88a6b7; + background: #908caa; pointer-events: none; } &.pollVote { padding: 3px; - background: #88a6b7; + background: #908caa; pointer-events: none; } &.pollEnded { padding: 3px; - background: #88a6b7; + background: #908caa; pointer-events: none; } } From e1c96a88e3d6eb07c0663b03cf7d9365cb3f2d61 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 26 Jul 2022 21:32:03 -0700 Subject: [PATCH 006/234] =?UTF-8?q?=F0=9F=8E=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/client/src/components/tab.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/client/src/components/tab.vue b/packages/client/src/components/tab.vue index 669e9e2e1..1ba3219e3 100644 --- a/packages/client/src/components/tab.vue +++ b/packages/client/src/components/tab.vue @@ -32,6 +32,7 @@ export default defineComponent({ .pxhvhrfw { display: flex; font-size: 90%; + border-radius: 10px; > button { flex: 1; From 67ff22be708a3eacdf606a720574fd06ac23b78f Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 26 Jul 2022 21:33:52 -0700 Subject: [PATCH 007/234] =?UTF-8?q?=F0=9F=8E=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/client/src/components/tab.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/client/src/components/tab.vue b/packages/client/src/components/tab.vue index 1ba3219e3..d69b4567f 100644 --- a/packages/client/src/components/tab.vue +++ b/packages/client/src/components/tab.vue @@ -33,6 +33,7 @@ export default defineComponent({ display: flex; font-size: 90%; border-radius: 10px; + padding: 0.5rem; > button { flex: 1; From 6fac9bc1d695b103a029fb8f138675ec41d16f61 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 26 Jul 2022 21:35:03 -0700 Subject: [PATCH 008/234] =?UTF-8?q?=F0=9F=8E=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/client/src/components/tab.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/tab.vue b/packages/client/src/components/tab.vue index d69b4567f..3c2e47ba7 100644 --- a/packages/client/src/components/tab.vue +++ b/packages/client/src/components/tab.vue @@ -32,8 +32,8 @@ export default defineComponent({ .pxhvhrfw { display: flex; font-size: 90%; - border-radius: 10px; - padding: 0.5rem; + border-radius: var(--radius); + padding: 10px 8px; > button { flex: 1; From 9e1e64e58d146ad1832ac20fc14fe18c45beed2b Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Wed, 27 Jul 2022 08:55:58 +0200 Subject: [PATCH 009/234] Update 'CALCKEY.md' --- CALCKEY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CALCKEY.md b/CALCKEY.md index f3150596d..9ded35c8a 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -9,6 +9,7 @@ - Option to publicize instance blocks - Better intro/onboarding - Fully revamp non-logged-in screen +- Remote follow button - Personal notes for all accounts - Non-nyaify cat mode - Timeline filters From 4d2279762409f3f6988fb6c48952f819ccd22349 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Wed, 27 Jul 2022 09:46:35 -0700 Subject: [PATCH 010/234] Custom MOTD! --- CALCKEY.md | 2 +- locales/en-US.yml | 3 +++ locales/ja-JP.yml | 2 ++ package.json | 2 +- .../migration/1658939464003CustomMOTD.js | 8 ++++++ packages/backend/src/models/entities/meta.ts | 5 ++++ packages/backend/src/server/api/endpoints.ts | 2 ++ .../src/server/api/endpoints/admin/meta.ts | 9 +++++++ .../server/api/endpoints/admin/update-meta.ts | 7 +++++ packages/backend/src/server/web/index.ts | 27 ++++++------------- packages/client/src/pages/admin/settings.vue | 8 ++++++ 11 files changed, 54 insertions(+), 21 deletions(-) create mode 100644 packages/backend/migration/1658939464003CustomMOTD.js diff --git a/CALCKEY.md b/CALCKEY.md index 9ded35c8a..dde53a888 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -36,6 +36,7 @@ - Star as default reaction - Rosé Pine by default (+ non-themable elements made Rosé Pine) - Better sidebar/navbar +- MOTD (customizable by admins!) - [Profile background as banner](https://codeberg.org/Freeplay/Misskey-Tweaks/src/branch/main/snippets/profile-background.styl) - Better timeline top bar - Mark as read from notifications widget @@ -45,7 +46,6 @@ - Spinner instead of "Loading..." - SearchX instead of Google - Spacing on group items -- MOTD - Reply limit bug fixed (somewhat) - Custom assets - [OAuth bearer token authentication](https://github.com/misskey-dev/misskey/pull/9021) diff --git a/locales/en-US.yml b/locales/en-US.yml index 0088af46d..53cb9185f 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -901,6 +901,9 @@ move: "Move" showAds: "Show ads" enterSendsMessage: "Press Return in Messaging to send message (off is Ctrl + Return)" adminCustomCssWarn: "This setting should only be used if you know what it does. Entering improper values may cause EVERYONE'S clients to stop functioning normally. Please ensure your CSS works properly by testing it in your user settings." +customMOTD: "Custom MOTD (splash screen messages)" +customMOTDDescription: "Custom messages for the MOTD (splash screen) separated by line breaks to be shown randomly every time a user loads/reloads the page." + _sensitiveMediaDetection: description: "Reduces the effort of server moderation through automatically recognizing NSFW media via Machine Learning. This will slightly increase the load on the server." diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 1c832e1f7..3ce268ddd 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -901,6 +901,8 @@ shuffle: "シャッフル" account: "アカウント" move: "移動" adminCustomCssWarn: "この設定は、それが何をするものであるかを知っている場合のみ使用してください。不適切な値を入力すると、クライアントが正常に動作しなくなる可能性があります。ユーザー設定でCSSをテストし、正しく動作することを確認してください。" +customMOTD: "カスタムMOTD(スプラッシュスクリーンメッセージ)" +customMOTDDescription: "ユーザがページをロード/リロードするたびにランダムに表示される、改行で区切られたMOTD(スプラッシュスクリーン)用のカスタムメッセージ" _sensitiveMediaDetection: description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てることができます。サーバーの負荷が少し増えます。" diff --git a/package.json b/package.json index 96c286e50..5cc0201de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.118.0-calc.8.b4", + "version": "12.118.0-calc.9.b4", "codename": "indigo", "repository": { "type": "git", diff --git a/packages/backend/migration/1658939464003CustomMOTD.js b/packages/backend/migration/1658939464003CustomMOTD.js new file mode 100644 index 000000000..eac03451d --- /dev/null +++ b/packages/backend/migration/1658939464003CustomMOTD.js @@ -0,0 +1,8 @@ +export class CustomMOTD1658939464003 { + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" ADD "customMOTD" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "customMOTD"`); + } +} diff --git a/packages/backend/src/models/entities/meta.ts b/packages/backend/src/models/entities/meta.ts index 02f5e3ecc..cb47307f9 100644 --- a/packages/backend/src/models/entities/meta.ts +++ b/packages/backend/src/models/entities/meta.ts @@ -67,6 +67,11 @@ export class Meta { }) public pinnedUsers: string[]; + @Column('varchar', { + length: 256, array: true, default: '{}', + }) + public customMOTD: string[]; + @Column('varchar', { length: 256, array: true, default: '{}', }) diff --git a/packages/backend/src/server/api/endpoints.ts b/packages/backend/src/server/api/endpoints.ts index d7fcc32d3..0c29e16fc 100644 --- a/packages/backend/src/server/api/endpoints.ts +++ b/packages/backend/src/server/api/endpoints.ts @@ -268,6 +268,7 @@ import * as ep___pages_unlike from './endpoints/pages/unlike.js'; import * as ep___pages_update from './endpoints/pages/update.js'; import * as ep___ping from './endpoints/ping.js'; import * as ep___pinnedUsers from './endpoints/pinned-users.js'; +import * as ep___customMOTD from './endpoints/custom-motd.js'; import * as ep___promo_read from './endpoints/promo/read.js'; import * as ep___requestResetPassword from './endpoints/request-reset-password.js'; import * as ep___resetDb from './endpoints/reset-db.js'; @@ -585,6 +586,7 @@ const eps = [ ['pages/update', ep___pages_update], ['ping', ep___ping], ['pinned-users', ep___pinnedUsers], + ['custom-motd', ep___customMOTD], ['promo/read', ep___promo_read], ['request-reset-password', ep___requestResetPassword], ['reset-db', ep___resetDb], diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index 8a11baf90..b5201ea9f 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -171,6 +171,14 @@ export const meta = { optional: false, nullable: false, }, }, + customMOTD: { + type: 'array', + optional: true, nullable: false, + items: { + type: 'string', + optional: false, nullable: false, + }, + }, hiddenTags: { type: 'array', optional: true, nullable: false, @@ -402,6 +410,7 @@ export default define(meta, paramDef, async (ps, me) => { cacheRemoteFiles: instance.cacheRemoteFiles, useStarForReactionFallback: instance.useStarForReactionFallback, pinnedUsers: instance.pinnedUsers, + customMOTD: instance.customMOTD, hiddenTags: instance.hiddenTags, blockedHosts: instance.blockedHosts, allowedHosts: instance.allowedHosts, diff --git a/packages/backend/src/server/api/endpoints/admin/update-meta.ts b/packages/backend/src/server/api/endpoints/admin/update-meta.ts index 1fe68f261..60d388d68 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -21,6 +21,9 @@ export const paramDef = { pinnedUsers: { type: 'array', nullable: true, items: { type: 'string', } }, + customMOTD: { type: 'array', nullable: true, items: { + type: 'string', + } }, hiddenTags: { type: 'array', nullable: true, items: { type: 'string', } }, @@ -135,6 +138,10 @@ export default define(meta, paramDef, async (ps, me) => { set.pinnedUsers = ps.pinnedUsers.filter(Boolean); } + if (Array.isArray(ps.customMOTD)) { + set.customMOTD = ps.customMOTD.filter(Boolean); + } + if (Array.isArray(ps.hiddenTags)) { set.hiddenTags = ps.hiddenTags.filter(Boolean); } diff --git a/packages/backend/src/server/web/index.ts b/packages/backend/src/server/web/index.ts index 1d201d712..58d141041 100644 --- a/packages/backend/src/server/web/index.ts +++ b/packages/backend/src/server/web/index.ts @@ -268,22 +268,6 @@ router.get('/@:user.json', async ctx => { } }); -// MOTD -const motd = [ - 'If you\'re on mobile, you can tap install/add to homescreen to get the app!', - 'You can click the time a note was posted to get a full view of the note.', - 'Wanna find people to follow? Head over to the Explore tab!', - 'Want more ways to post? You can make blogs in Pages and galleries in Gallery tab.', - 'You can add cool stuff to notes like CWs, polls, multiple videos/gifs, and audio!', - 'Use #hashtags to tag notes and reach more people, especially for #art.', - 'If your note gets popular, it might show up on the Featured tap for up to 3 days!', - 'Use the 4 buttons at the top (or the top drop-down on mobile) to switch timelines.', - 'The Fediverse is made up of more than just Calckey.', - 'Avatars and banners can be GIFs.', - 'When writing a note, type $ to see a list of cool text effects (mfm).', - 'Be gay, do crime.', -]; - //#region SSR (for crawlers) // User router.get(['/@:user', '/@:user/:sub'], async (ctx, next) => { @@ -311,9 +295,8 @@ router.get(['/@:user', '/@:user/:sub'], async (ctx, next) => { icon: meta.iconUrl, themeColor: meta.themeColor, privateMode: meta.privateMode, - randomMOTD: motd[Math.floor(Math.random() * motd.length)], }); - ctx.set('Cache-Control', 'public, max-age=3'); + ctx.set('Cache-Control', 'public, max-age=15'); } else { // リモートユーザーなので // モデレータがAPI経由で参照可能にするために404にはしない @@ -543,6 +526,11 @@ router.get('/streaming', async ctx => { // Render base html for all requests router.get('(.*)', async ctx => { const meta = await fetchMeta(); + let motd = ['Loading...']; + // Check if meta.MOTD exists and is at least 1 in length + if (meta.customMOTD && meta.customMOTD.length > 0) { + motd = meta.customMOTD; + } await ctx.render('base', { img: meta.bannerUrl, title: meta.name || 'Calckey', @@ -551,8 +539,9 @@ router.get('(.*)', async ctx => { icon: meta.iconUrl, themeColor: meta.themeColor, privateMode: meta.privateMode, + randomMOTD: motd[Math.floor(Math.random() * motd.length)], }); - ctx.set('Cache-Control', 'public, max-age=15'); + ctx.set('Cache-Control', 'public, max-age=3'); }); // Register router diff --git a/packages/client/src/pages/admin/settings.vue b/packages/client/src/pages/admin/settings.vue index 496eb46ea..995c8e805 100644 --- a/packages/client/src/pages/admin/settings.vue +++ b/packages/client/src/pages/admin/settings.vue @@ -34,6 +34,11 @@ + + + + + @@ -176,6 +181,7 @@ let defaultDarkTheme: any = $ref(null); let enableLocalTimeline: boolean = $ref(false); let enableGlobalTimeline: boolean = $ref(false); let pinnedUsers: string = $ref(''); +let customMOTD: string = $ref(''); let cacheRemoteFiles: boolean = $ref(false); let localDriveCapacityMb: any = $ref(0); let remoteDriveCapacityMb: any = $ref(0); @@ -203,6 +209,7 @@ async function init() { enableLocalTimeline = !meta.disableLocalTimeline; enableGlobalTimeline = !meta.disableGlobalTimeline; pinnedUsers = meta.pinnedUsers.join('\n'); + customMOTD = meta.customMOTD.join('\n'); cacheRemoteFiles = meta.cacheRemoteFiles; localDriveCapacityMb = meta.driveCapacityPerLocalUserMb; remoteDriveCapacityMb = meta.driveCapacityPerRemoteUserMb; @@ -231,6 +238,7 @@ function save() { disableLocalTimeline: !enableLocalTimeline, disableGlobalTimeline: !enableGlobalTimeline, pinnedUsers: pinnedUsers.split('\n'), + customMOTD: customMOTD.split('\n'), cacheRemoteFiles, localDriveCapacityMb: parseInt(localDriveCapacityMb, 10), remoteDriveCapacityMb: parseInt(remoteDriveCapacityMb, 10), From 4a7166625f8598abedfd46b6e86e7522916b3108 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Wed, 27 Jul 2022 09:47:29 -0700 Subject: [PATCH 011/234] clean up --- packages/backend/src/server/web/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/backend/src/server/web/index.ts b/packages/backend/src/server/web/index.ts index 58d141041..161f8a473 100644 --- a/packages/backend/src/server/web/index.ts +++ b/packages/backend/src/server/web/index.ts @@ -527,8 +527,7 @@ router.get('/streaming', async ctx => { router.get('(.*)', async ctx => { const meta = await fetchMeta(); let motd = ['Loading...']; - // Check if meta.MOTD exists and is at least 1 in length - if (meta.customMOTD && meta.customMOTD.length > 0) { + if (meta.customMOTD.length > 0) { motd = meta.customMOTD; } await ctx.render('base', { From 7ae95770aaf8aa218005639ba77f2a754132cf13 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Wed, 27 Jul 2022 09:58:18 -0700 Subject: [PATCH 012/234] Add endpoint --- .../src/server/api/endpoints/custom-motd.ts | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 packages/backend/src/server/api/endpoints/custom-motd.ts diff --git a/packages/backend/src/server/api/endpoints/custom-motd.ts b/packages/backend/src/server/api/endpoints/custom-motd.ts new file mode 100644 index 000000000..859bde904 --- /dev/null +++ b/packages/backend/src/server/api/endpoints/custom-motd.ts @@ -0,0 +1,32 @@ +// import { IsNull } from 'typeorm'; +import { fetchMeta } from '@/misc/fetch-meta.js'; +import define from '../define.js'; + +export const meta = { + tags: ['meta'], + + requireCredential: false, + requireCredentialPrivateMode: true, + + res: { + type: 'array', + optional: false, nullable: false, + items: { + type: 'string', + optional: false, nullable: false, + }, + }, +} as const; + +export const paramDef = { + type: 'array', + properties: {}, + required: [], +} as const; + +// eslint-disable-next-line import/no-default-export +export default define(meta, paramDef, async () => { + const meta = await fetchMeta(); + const motd = await Promise.all(meta.customMOTD.map(x => x)); + return motd; +}); From eb843e7cff1ca84ee0c0da00dc26ce6473781f58 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Wed, 27 Jul 2022 10:07:52 -0700 Subject: [PATCH 013/234] =?UTF-8?q?=F0=9F=8E=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CALCKEY.md | 3 ++- packages/client/src/components/note.vue | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CALCKEY.md b/CALCKEY.md index dde53a888..a51beaef7 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -46,7 +46,8 @@ - Spinner instead of "Loading..." - SearchX instead of Google - Spacing on group items -- Reply limit bug fixed (somewhat) +- Quotes have solid border +- Reply limit bug fixed - Custom assets - [OAuth bearer token authentication](https://github.com/misskey-dev/misskey/pull/9021) - [Styled Repair Tools](https://github.com/misskey-dev/misskey/pull/8956) diff --git a/packages/client/src/components/note.vue b/packages/client/src/components/note.vue index cab5c8258..5c0efc463 100644 --- a/packages/client/src/components/note.vue +++ b/packages/client/src/components/note.vue @@ -319,7 +319,7 @@ function readPromo() { margin: auto; width: calc(100% - 8px); height: calc(100% - 8px); - border: dashed 1px var(--focus); + border: solid 1px var(--focus); border-radius: var(--radius); box-sizing: border-box; } @@ -507,7 +507,7 @@ function readPromo() { > * { padding: 16px; - border: dashed 1px var(--renote); + border: solid 1px var(--renote); border-radius: 8px; } } From 75a75f8508c9b7cfd61f8d37dd71c42665314b8a Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Wed, 27 Jul 2022 10:08:53 -0700 Subject: [PATCH 014/234] Codename aqua! --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5cc0201de..93899c0ff 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "misskey", - "version": "12.118.0-calc.9.b4", - "codename": "indigo", + "version": "12.118.0-calc.10.b4", + "codename": "aqua", "repository": { "type": "git", "url": "https://codeberg.org/thatonecalculator/calckey.git" From 1129a2ec8c25f572dff6f87bcb5044ae5568e472 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Wed, 27 Jul 2022 10:25:30 -0700 Subject: [PATCH 015/234] Custom splash icons! --- locales/en-US.yml | 3 +- locales/ja-JP.yml | 2 ++ .../1658941974648CustomSplashIcons.js | 8 +++++ packages/backend/src/models/entities/meta.ts | 5 +++ packages/backend/src/server/api/endpoints.ts | 2 ++ .../src/server/api/endpoints/admin/meta.ts | 9 ++++++ .../server/api/endpoints/admin/update-meta.ts | 7 ++++ .../src/server/api/endpoints/custom-motd.ts | 2 +- .../api/endpoints/custom-splash-icons.ts | 32 +++++++++++++++++++ packages/backend/src/server/web/index.ts | 6 +++- packages/client/src/pages/admin/settings.vue | 8 +++++ 11 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 packages/backend/migration/1658941974648CustomSplashIcons.js create mode 100644 packages/backend/src/server/api/endpoints/custom-splash-icons.ts diff --git a/locales/en-US.yml b/locales/en-US.yml index 53cb9185f..b8e8fe1bd 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -903,7 +903,8 @@ enterSendsMessage: "Press Return in Messaging to send message (off is Ctrl + Ret adminCustomCssWarn: "This setting should only be used if you know what it does. Entering improper values may cause EVERYONE'S clients to stop functioning normally. Please ensure your CSS works properly by testing it in your user settings." customMOTD: "Custom MOTD (splash screen messages)" customMOTDDescription: "Custom messages for the MOTD (splash screen) separated by line breaks to be shown randomly every time a user loads/reloads the page." - +customSplashIcons: "Custom splash screen icons (urls)" +customSplashIconsDescription: "URLs for custom splash screen icons separated by line breaks to be shown randomly every time a user loads/reloads the page. Please make sure the images are on a static URL, preferably all resized to 192x192." _sensitiveMediaDetection: description: "Reduces the effort of server moderation through automatically recognizing NSFW media via Machine Learning. This will slightly increase the load on the server." diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 3ce268ddd..ff96cc77c 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -903,6 +903,8 @@ move: "移動" adminCustomCssWarn: "この設定は、それが何をするものであるかを知っている場合のみ使用してください。不適切な値を入力すると、クライアントが正常に動作しなくなる可能性があります。ユーザー設定でCSSをテストし、正しく動作することを確認してください。" customMOTD: "カスタムMOTD(スプラッシュスクリーンメッセージ)" customMOTDDescription: "ユーザがページをロード/リロードするたびにランダムに表示される、改行で区切られたMOTD(スプラッシュスクリーン)用のカスタムメッセージ" +customSplashIcons: "カスタムスプラッシュスクリーンアイコン" +customSplashIconsDescription: "ユーザがページをロード/リロードするたびにランダムに表示される、改行で区切られたカスタムスプラッシュスクリーンアイコンの URL。画像は静的なURLで、できればすべて192x192にリサイズしてください。" _sensitiveMediaDetection: description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てることができます。サーバーの負荷が少し増えます。" diff --git a/packages/backend/migration/1658941974648CustomSplashIcons.js b/packages/backend/migration/1658941974648CustomSplashIcons.js new file mode 100644 index 000000000..fce5eb767 --- /dev/null +++ b/packages/backend/migration/1658941974648CustomSplashIcons.js @@ -0,0 +1,8 @@ +export class CustomSplashIcons1658941974648 { + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" ADD "customSplashIcons" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "customSplashIcons"`); + } +} diff --git a/packages/backend/src/models/entities/meta.ts b/packages/backend/src/models/entities/meta.ts index cb47307f9..475f68324 100644 --- a/packages/backend/src/models/entities/meta.ts +++ b/packages/backend/src/models/entities/meta.ts @@ -72,6 +72,11 @@ export class Meta { }) public customMOTD: string[]; + @Column('varchar', { + length: 256, array: true, default: '{}', + }) + public customSplashIcons: string[]; + @Column('varchar', { length: 256, array: true, default: '{}', }) diff --git a/packages/backend/src/server/api/endpoints.ts b/packages/backend/src/server/api/endpoints.ts index 0c29e16fc..c8f64ee46 100644 --- a/packages/backend/src/server/api/endpoints.ts +++ b/packages/backend/src/server/api/endpoints.ts @@ -269,6 +269,7 @@ import * as ep___pages_update from './endpoints/pages/update.js'; import * as ep___ping from './endpoints/ping.js'; import * as ep___pinnedUsers from './endpoints/pinned-users.js'; import * as ep___customMOTD from './endpoints/custom-motd.js'; +import * as ep___customSplashIcons from './endpoints/custom-splash-icons.js'; import * as ep___promo_read from './endpoints/promo/read.js'; import * as ep___requestResetPassword from './endpoints/request-reset-password.js'; import * as ep___resetDb from './endpoints/reset-db.js'; @@ -587,6 +588,7 @@ const eps = [ ['ping', ep___ping], ['pinned-users', ep___pinnedUsers], ['custom-motd', ep___customMOTD], + ['custom-motd', ep___customSplashIcons], ['promo/read', ep___promo_read], ['request-reset-password', ep___requestResetPassword], ['reset-db', ep___resetDb], diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index b5201ea9f..32441a335 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -179,6 +179,14 @@ export const meta = { optional: false, nullable: false, }, }, + customSplashIcons: { + type: 'array', + optional: true, nullable: false, + items: { + type: 'string', + optional: false, nullable: false, + }, + }, hiddenTags: { type: 'array', optional: true, nullable: false, @@ -411,6 +419,7 @@ export default define(meta, paramDef, async (ps, me) => { useStarForReactionFallback: instance.useStarForReactionFallback, pinnedUsers: instance.pinnedUsers, customMOTD: instance.customMOTD, + customSplashIcons: instance.customSplashIcons, hiddenTags: instance.hiddenTags, blockedHosts: instance.blockedHosts, allowedHosts: instance.allowedHosts, diff --git a/packages/backend/src/server/api/endpoints/admin/update-meta.ts b/packages/backend/src/server/api/endpoints/admin/update-meta.ts index 60d388d68..f8077a033 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -24,6 +24,9 @@ export const paramDef = { customMOTD: { type: 'array', nullable: true, items: { type: 'string', } }, + customSplashIcons: { type: 'array', nullable: true, items: { + type: 'string', + } }, hiddenTags: { type: 'array', nullable: true, items: { type: 'string', } }, @@ -142,6 +145,10 @@ export default define(meta, paramDef, async (ps, me) => { set.customMOTD = ps.customMOTD.filter(Boolean); } + if (Array.isArray(ps.customSplashIcons)) { + set.customSplashIcons = ps.customSplashIcons.filter(Boolean); + } + if (Array.isArray(ps.hiddenTags)) { set.hiddenTags = ps.hiddenTags.filter(Boolean); } diff --git a/packages/backend/src/server/api/endpoints/custom-motd.ts b/packages/backend/src/server/api/endpoints/custom-motd.ts index 859bde904..fd58424bd 100644 --- a/packages/backend/src/server/api/endpoints/custom-motd.ts +++ b/packages/backend/src/server/api/endpoints/custom-motd.ts @@ -19,7 +19,7 @@ export const meta = { } as const; export const paramDef = { - type: 'array', + type: 'object', properties: {}, required: [], } as const; diff --git a/packages/backend/src/server/api/endpoints/custom-splash-icons.ts b/packages/backend/src/server/api/endpoints/custom-splash-icons.ts new file mode 100644 index 000000000..380e2131b --- /dev/null +++ b/packages/backend/src/server/api/endpoints/custom-splash-icons.ts @@ -0,0 +1,32 @@ +// import { IsNull } from 'typeorm'; +import { fetchMeta } from '@/misc/fetch-meta.js'; +import define from '../define.js'; + +export const meta = { + tags: ['meta'], + + requireCredential: false, + requireCredentialPrivateMode: true, + + res: { + type: 'array', + optional: false, nullable: false, + items: { + type: 'string', + optional: false, nullable: false, + }, + }, +} as const; + +export const paramDef = { + type: 'object', + properties: {}, + required: [], +} as const; + +// eslint-disable-next-line import/no-default-export +export default define(meta, paramDef, async () => { + const meta = await fetchMeta(); + const icons = await Promise.all(meta.customSplashIcons.map(x => x)); + return icons; +}); diff --git a/packages/backend/src/server/web/index.ts b/packages/backend/src/server/web/index.ts index 161f8a473..bb5b1a772 100644 --- a/packages/backend/src/server/web/index.ts +++ b/packages/backend/src/server/web/index.ts @@ -530,12 +530,16 @@ router.get('(.*)', async ctx => { if (meta.customMOTD.length > 0) { motd = meta.customMOTD; } + let iconUrl = meta.iconUrl; + if (meta.customSplashIcons.length > 0) { + iconUrl = meta.customSplashIcons[Math.floor(Math.random() * meta.customSplashIcons.length)]; + } await ctx.render('base', { img: meta.bannerUrl, title: meta.name || 'Calckey', instanceName: meta.name || 'Calckey', desc: meta.description, - icon: meta.iconUrl, + icon: iconUrl, themeColor: meta.themeColor, privateMode: meta.privateMode, randomMOTD: motd[Math.floor(Math.random() * motd.length)], diff --git a/packages/client/src/pages/admin/settings.vue b/packages/client/src/pages/admin/settings.vue index 995c8e805..2060328a2 100644 --- a/packages/client/src/pages/admin/settings.vue +++ b/packages/client/src/pages/admin/settings.vue @@ -39,6 +39,11 @@ + + + + + @@ -182,6 +187,7 @@ let enableLocalTimeline: boolean = $ref(false); let enableGlobalTimeline: boolean = $ref(false); let pinnedUsers: string = $ref(''); let customMOTD: string = $ref(''); +let customSplashIcons: string = $ref(''); let cacheRemoteFiles: boolean = $ref(false); let localDriveCapacityMb: any = $ref(0); let remoteDriveCapacityMb: any = $ref(0); @@ -210,6 +216,7 @@ async function init() { enableGlobalTimeline = !meta.disableGlobalTimeline; pinnedUsers = meta.pinnedUsers.join('\n'); customMOTD = meta.customMOTD.join('\n'); + customSplashIcons = meta.customSplashIcons.join('\n'); cacheRemoteFiles = meta.cacheRemoteFiles; localDriveCapacityMb = meta.driveCapacityPerLocalUserMb; remoteDriveCapacityMb = meta.driveCapacityPerRemoteUserMb; @@ -239,6 +246,7 @@ function save() { disableGlobalTimeline: !enableGlobalTimeline, pinnedUsers: pinnedUsers.split('\n'), customMOTD: customMOTD.split('\n'), + customSplashIcons: customSplashIcons.split('\n'), cacheRemoteFiles, localDriveCapacityMb: parseInt(localDriveCapacityMb, 10), remoteDriveCapacityMb: parseInt(remoteDriveCapacityMb, 10), From be7e65f0826b47d57440f33a33f9df372d764d3e Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Wed, 27 Jul 2022 10:28:13 -0700 Subject: [PATCH 016/234] planned --- CALCKEY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CALCKEY.md b/CALCKEY.md index a51beaef7..15f00f14f 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -3,6 +3,7 @@ ## Planned - MFM button +- Make more of the post clickable like every other SNS - Better Messaging UI - Classic mode make instance icon bring up new context menu - Like/star button From 74e45c24afc41f1921fa88165d19072036f9945f Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Wed, 27 Jul 2022 10:36:49 -0700 Subject: [PATCH 017/234] Changelog --- CALCKEY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CALCKEY.md b/CALCKEY.md index 15f00f14f..32f1fd7c5 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -38,6 +38,7 @@ - Rosé Pine by default (+ non-themable elements made Rosé Pine) - Better sidebar/navbar - MOTD (customizable by admins!) +- Custom randomized splash icons - [Profile background as banner](https://codeberg.org/Freeplay/Misskey-Tweaks/src/branch/main/snippets/profile-background.styl) - Better timeline top bar - Mark as read from notifications widget From b36bb813c19ef4032bc42002ea1e1d7f3a00d712 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Wed, 27 Jul 2022 11:19:57 -0700 Subject: [PATCH 018/234] Spinner --- CALCKEY.md | 1 + .../client/src/components/global/loading.vue | 46 ++++++++++++------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/CALCKEY.md b/CALCKEY.md index 32f1fd7c5..2e1a25980 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -45,6 +45,7 @@ - Better welcome screen (not logged in) - Ability to turn off "Connection lost" message - Raw instance info only for moderators +- New spinner animation - Spinner instead of "Loading..." - SearchX instead of Google - Spacing on group items diff --git a/packages/client/src/components/global/loading.vue b/packages/client/src/components/global/loading.vue index bcc6dfac0..d1ad7ad1f 100644 --- a/packages/client/src/components/global/loading.vue +++ b/packages/client/src/components/global/loading.vue @@ -1,15 +1,18 @@