From 7fd1f05bb39ad38b6b69dc95d52fda0a3b06573d Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 00:50:11 -0700 Subject: [PATCH 01/42] debug log --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index 1cd47557a6..3aa10d1829 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -64,12 +64,11 @@ export default define(meta, paramDef, async (ps, user) => { throw new ApiError(meta.errors.rtlDisabled); } } + console.log(`\n\n${m.recommendedInstances}\n\n`) - // .andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: instances }) //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - // Query where note.userHost is in recommended instances .andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: m.recommendedInstances }) // .andWhere(new Brackets(qb => { // qb.where('note.userHost IN :instances', { instances: m.recommendedInstances }) From b475ea415d15e0f6f226e18c1f9671e828697779 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 00:53:57 -0700 Subject: [PATCH 02/42] I doubt itll work, but... --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index 3aa10d1829..18cf4944e5 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -1,6 +1,6 @@ import { Brackets } from 'typeorm'; import { fetchMeta } from '@/misc/fetch-meta.js'; -import { Notes, Users } from '@/models/index.js'; +import { Notes } from '@/models/index.js'; import { activeUsersChart } from '@/services/chart/index.js'; import define from '../../define.js'; import { ApiError } from '../../error.js'; @@ -64,12 +64,11 @@ export default define(meta, paramDef, async (ps, user) => { throw new ApiError(meta.errors.rtlDisabled); } } - console.log(`\n\n${m.recommendedInstances}\n\n`) //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - .andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: m.recommendedInstances }) + .andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: m.recommendedInstances.toString().split(',') }) // .andWhere(new Brackets(qb => { // qb.where('note.userHost IN :instances', { instances: m.recommendedInstances }) // .orWhere('note.userHost IS NULL'); From f08acce023e1650422e404984530c0093d006216 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 00:57:15 -0700 Subject: [PATCH 03/42] =?UTF-8?q?=F0=9F=99=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index 18cf4944e5..ec7f225b33 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -59,6 +59,7 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const m = await fetchMeta(); + const formatted = `(${m.recommendedInstances.map(v => JSON.stringify(v.toString())).join(', ')})`; if (m.disableRecommendedTimeline) { if (user == null || (!user.isAdmin && !user.isModerator)) { throw new ApiError(meta.errors.rtlDisabled); @@ -68,7 +69,7 @@ export default define(meta, paramDef, async (ps, user) => { //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - .andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: m.recommendedInstances.toString().split(',') }) + .andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: formatted }) // .andWhere(new Brackets(qb => { // qb.where('note.userHost IN :instances', { instances: m.recommendedInstances }) // .orWhere('note.userHost IS NULL'); From 7a4ddeba16e7b92aedcb4de737a04cc66165192b Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:02:11 -0700 Subject: [PATCH 04/42] hail mairy --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index ec7f225b33..b4b4ba6742 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -59,7 +59,7 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const m = await fetchMeta(); - const formatted = `(${m.recommendedInstances.map(v => JSON.stringify(v.toString())).join(', ')})`; + const formattedInstances = `(${m.recommendedInstances.toString().split(',').map(v => JSON.stringify(v.toString())).join(', ')})`; if (m.disableRecommendedTimeline) { if (user == null || (!user.isAdmin && !user.isModerator)) { throw new ApiError(meta.errors.rtlDisabled); @@ -69,7 +69,7 @@ export default define(meta, paramDef, async (ps, user) => { //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - .andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: formatted }) + .andWhere('(note.userHost IN :instances)', { instances: formattedInstances }) // .andWhere(new Brackets(qb => { // qb.where('note.userHost IN :instances', { instances: m.recommendedInstances }) // .orWhere('note.userHost IS NULL'); From f9d9bd9f5079fabd2b489c71716605667497b843 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:04:20 -0700 Subject: [PATCH 05/42] certified typeorm moment --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index b4b4ba6742..82cbf132fd 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -69,7 +69,7 @@ export default define(meta, paramDef, async (ps, user) => { //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - .andWhere('(note.userHost IN :instances)', { instances: formattedInstances }) + .andWhere(`(note.userHost IN ${formattedInstances})`) // .andWhere(new Brackets(qb => { // qb.where('note.userHost IN :instances', { instances: m.recommendedInstances }) // .orWhere('note.userHost IS NULL'); From 1ae895d098ed62e82ad01c752c4aa8ad85606bbf Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:07:46 -0700 Subject: [PATCH 06/42] im stuff --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index 82cbf132fd..fb48bcc355 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -69,7 +69,7 @@ export default define(meta, paramDef, async (ps, user) => { //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - .andWhere(`(note.userHost IN ${formattedInstances})`) + .andWhere(`(note.userHost = ANY (ARRAY[${m.recommendedInstances}])`) // .andWhere(new Brackets(qb => { // qb.where('note.userHost IN :instances', { instances: m.recommendedInstances }) // .orWhere('note.userHost IS NULL'); From 6aaf8cbd7dc23865b82978693c765da0ae6e68d6 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:09:44 -0700 Subject: [PATCH 07/42] debug log --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index fb48bcc355..20a73798dc 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -66,10 +66,12 @@ export default define(meta, paramDef, async (ps, user) => { } } + const cursed = `(note.userHost = ANY (ARRAY[${m.recommendedInstances}])`; + console.log(cursed); //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - .andWhere(`(note.userHost = ANY (ARRAY[${m.recommendedInstances}])`) + .andWhere(cursed) // .andWhere(new Brackets(qb => { // qb.where('note.userHost IN :instances', { instances: m.recommendedInstances }) // .orWhere('note.userHost IS NULL'); From 82813ffe7b70b889fa2a52f66f658f6f4d250357 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:13:08 -0700 Subject: [PATCH 08/42] not a fan of js/ts --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index 20a73798dc..c95159ef40 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -59,14 +59,14 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const m = await fetchMeta(); - const formattedInstances = `(${m.recommendedInstances.toString().split(',').map(v => JSON.stringify(v.toString())).join(', ')})`; + const formattedInstances = `(${m.recommendedInstances.toString().split(',').map(v => JSON.stringify(`'${v.toString()}'`)).join(', ')})`; if (m.disableRecommendedTimeline) { if (user == null || (!user.isAdmin && !user.isModerator)) { throw new ApiError(meta.errors.rtlDisabled); } } - const cursed = `(note.userHost = ANY (ARRAY[${m.recommendedInstances}])`; + const cursed = `(note.userHost = ANY (ARRAY${m.recommendedInstances.toString().split(',')})`; console.log(cursed); //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), From 5289de0cf0c8a8ed69e4d7d6ba57eeab22656ee2 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:19:56 -0700 Subject: [PATCH 09/42] istg --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index c95159ef40..a6de9f9f42 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -59,14 +59,14 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const m = await fetchMeta(); - const formattedInstances = `(${m.recommendedInstances.toString().split(',').map(v => JSON.stringify(`'${v.toString()}'`)).join(', ')})`; + // const formattedInstances = `(${m.recommendedInstances.toString().split(',').map(v => JSON.stringify(`'${v.toString()}'`)).join(', ')})`; if (m.disableRecommendedTimeline) { if (user == null || (!user.isAdmin && !user.isModerator)) { throw new ApiError(meta.errors.rtlDisabled); } } - const cursed = `(note.userHost = ANY (ARRAY${m.recommendedInstances.toString().split(',')})`; + const cursed = `(note.userHost = ANY (ARRAY["${m.recommendedInstances.join('","')}"])`; console.log(cursed); //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), From 30bedee17b8968548b4390b701da1fd380726f86 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:21:27 -0700 Subject: [PATCH 10/42] missing parenthesis --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index a6de9f9f42..2678585460 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -66,7 +66,7 @@ export default define(meta, paramDef, async (ps, user) => { } } - const cursed = `(note.userHost = ANY (ARRAY["${m.recommendedInstances.join('","')}"])`; + const cursed = `(note.userHost = ANY (ARRAY["${m.recommendedInstances.join('","')}"]))`; console.log(cursed); //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), From 90ecb119dbaf844c97a4b382f151bcace953999c Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:26:07 -0700 Subject: [PATCH 11/42] postgres can kiss my ass --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index 2678585460..723938195a 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -66,7 +66,7 @@ export default define(meta, paramDef, async (ps, user) => { } } - const cursed = `(note.userHost = ANY (ARRAY["${m.recommendedInstances.join('","')}"]))`; + const cursed = `(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'::string[]))`; console.log(cursed); //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), From 5e612a96f54aae657b231463312d951bc7044def Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:28:03 -0700 Subject: [PATCH 12/42] didnt need `::string[]` i think --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index 723938195a..82f211a869 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -66,7 +66,7 @@ export default define(meta, paramDef, async (ps, user) => { } } - const cursed = `(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'::string[]))`; + const cursed = `(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'))`; console.log(cursed); //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), From 42de210a6c56cf7712a25e29d40d457e784df354 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:30:17 -0700 Subject: [PATCH 13/42] hide caption button --- package.json | 2 +- packages/client/src/components/media-caption.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 437d985646..4abe46d5cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.118.1-calc.rc.4.13", + "version": "12.118.1-calc.rc.5", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/components/media-caption.vue b/packages/client/src/components/media-caption.vue index 49ad51b597..c75dbed5b8 100644 --- a/packages/client/src/components/media-caption.vue +++ b/packages/client/src/components/media-caption.vue @@ -12,7 +12,7 @@
{{ $ts.ok }} - {{ $ts.caption }} + {{ $ts.cancel }}
From e7fa99de86bfa23fa441a5c58fe16de149061980 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:30:38 -0700 Subject: [PATCH 14/42] Remove debug log --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index 82f211a869..b86f644477 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -67,15 +67,10 @@ export default define(meta, paramDef, async (ps, user) => { } const cursed = `(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'))`; - console.log(cursed); //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) .andWhere(cursed) - // .andWhere(new Brackets(qb => { - // qb.where('note.userHost IN :instances', { instances: m.recommendedInstances }) - // .orWhere('note.userHost IS NULL'); - // })) .andWhere('(note.visibility = \'public\')') .innerJoinAndSelect('note.user', 'user') .leftJoinAndSelect('user.avatar', 'avatar') From 8d9596d209f2065789a02ab895f234feea92db02 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:32:50 -0700 Subject: [PATCH 15/42] Clean up --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index b86f644477..ae2d582745 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -59,18 +59,16 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const m = await fetchMeta(); - // const formattedInstances = `(${m.recommendedInstances.toString().split(',').map(v => JSON.stringify(`'${v.toString()}'`)).join(', ')})`; if (m.disableRecommendedTimeline) { if (user == null || (!user.isAdmin && !user.isModerator)) { throw new ApiError(meta.errors.rtlDisabled); } } - const cursed = `(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'))`; //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - .andWhere(cursed) + .andWhere(`(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'))`) .andWhere('(note.visibility = \'public\')') .innerJoinAndSelect('note.user', 'user') .leftJoinAndSelect('user.avatar', 'avatar') From d50ad16ac8157aad6a466a07bfb9980f3d4b6178 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:35:18 -0700 Subject: [PATCH 16/42] no longer beta! --- CALCKEY.md | 2 +- package.json | 2 +- packages/client/src/pages/admin/settings.vue | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CALCKEY.md b/CALCKEY.md index 9644a0fc61..dacaf77eea 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -20,7 +20,6 @@ ## Work in progress -- Recommended instances timeline - OCR image captioning - Admin custom CSS - Improve accesibility score @@ -35,6 +34,7 @@ - Yarn 3 - Fix Dockerfile @hanna - Saner defaults +- Recommended instances timeline - Star as default reaction - Recommended Instances timeline - Rosé Pine by default (+ non-themable elements made Rosé Pine) diff --git a/package.json b/package.json index 4abe46d5cc..ce203bf1e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.118.1-calc.rc.5", + "version": "12.118.1-calc.rc.5.1", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/pages/admin/settings.vue b/packages/client/src/pages/admin/settings.vue index ed8ae6ed89..101c4a6b4d 100644 --- a/packages/client/src/pages/admin/settings.vue +++ b/packages/client/src/pages/admin/settings.vue @@ -56,7 +56,6 @@ {{ i18n.ts.enableRecommendedTimeline }} - From 0cdd5c22410a4ebd2aa72c85eb5b6939e869b45e Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:52:32 -0700 Subject: [PATCH 17/42] fix streaming --- package.json | 2 +- .../src/server/api/stream/channels/recommended-timeline.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ce203bf1e6..fa1ae45456 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.118.1-calc.rc.5.1", + "version": "12.118.1-calc.rc.6", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/backend/src/server/api/stream/channels/recommended-timeline.ts b/packages/backend/src/server/api/stream/channels/recommended-timeline.ts index 4d4b324f9a..c0625aec8a 100644 --- a/packages/backend/src/server/api/stream/channels/recommended-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/recommended-timeline.ts @@ -30,7 +30,7 @@ export default class extends Channel { // フォローしているチャンネルの投稿 の場合だけ const meta = await fetchMeta(); if (!( - ((note.user.host == null || meta.recommendedInstances.includes(note.user.host)) && note.visibility === 'public') + ((note.user.host != null && meta.recommendedInstances.includes(note.user.host)) && note.visibility === 'public') )) return; // Ignore notes from instances the user has muted From 9ec3f97505cfcd27685069bcbb27a1d7552af012 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 02:09:09 -0700 Subject: [PATCH 18/42] Seperate splash screen settings in admin panel --- locales/en-US.yml | 1 + locales/ja-JP.yml | 1 + package.json | 2 +- packages/client/src/pages/admin/settings.vue | 24 ++++++++++++-------- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index d7e8c224b7..f64a7c20d1 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -912,6 +912,7 @@ showUpdates: "Show a popup when Calckey updates" recommendedInstances: "Recommended instances" recommendedInstancesDescription: "Recommended instances seperated by line breaks to appear in the recommended timeline. Do NOT add `https://`, ONLY the domain." caption: "Auto Caption" +splash: "Splash Screen" _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 ac7154de2a..ecd30b42d8 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -912,6 +912,7 @@ showUpdates: "Calckeyの更新時にポップアップを表示する" recommendedInstances: "推奨インスタンス" recommendedInstancesDescription: "推奨タイムラインに表示するために改行で区切られた推奨インスタンス。`https://`を追加しないでください。ドメインのみを追加してください。" caption: "自動キャプション" +splash: "スプラッシュスクリーン" _sensitiveMediaDetection: description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てることができます。サーバーの負荷が少し増えます。" diff --git a/package.json b/package.json index fa1ae45456..6fe1d479de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.118.1-calc.rc.6", + "version": "12.118.1-calc.rc.7", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/pages/admin/settings.vue b/packages/client/src/pages/admin/settings.vue index 101c4a6b4d..43d1f43f94 100644 --- a/packages/client/src/pages/admin/settings.vue +++ b/packages/client/src/pages/admin/settings.vue @@ -34,16 +34,6 @@ - - - - - - - - - - @@ -66,6 +56,20 @@ {{ i18n.ts.disablingTimelinesInfo }} + + + + + + + + + + + + + + From 3a1daaeaed4b3e30f4b9ba569cb14473caddc386 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 02:33:07 -0700 Subject: [PATCH 19/42] Custom --- README.md | 5 +++++ custom/instance.css | 7 +++++++ gulpfile.js | 5 +++++ packages/backend/src/server/web/views/base.pug | 1 + 4 files changed, 18 insertions(+) create mode 100644 custom/instance.css diff --git a/README.md b/README.md index c991819659..06d3e01e06 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,11 @@ cp ../misskey/.config/default.yml ./.config/default.yml # replace `../misskey/` # cp -r ../misskey/files . # if you don't use object storage ``` +## 💅 Customize + +- To add custom CSS for all users, edit `/custom/instance.css`. +- To add static assets (such as images for the splash screen), place them in the `/custom/` folder. They'll then be avaliable with `https://yourinstance.tld/static-assets/filename.png`. + ## 🚀 Build and launch! ### `git pull` and run these steps to update Calckey in the future! diff --git a/custom/instance.css b/custom/instance.css new file mode 100644 index 0000000000..9a70e66426 --- /dev/null +++ b/custom/instance.css @@ -0,0 +1,7 @@ +/* +* !!! WARNING !!! +* Editing this file may cause your instance to break for EVERYONE. +* Please know what you're doing and test it out with regular user custom CSS. +* With that said, GLHF! +* This may eventuallly be replaced with a function in the admin panel. + */ diff --git a/gulpfile.js b/gulpfile.js index 90f8ebaabe..c407ba0e28 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -15,6 +15,10 @@ gulp.task('copy:backend:views', () => gulp.src('./packages/backend/src/server/web/views/**/*').pipe(gulp.dest('./packages/backend/built/server/web/views')) ); +gulp.task('copy:backend:custom', () => + gulp.src('./custom/*').pipe(gulp.dest('./packages/backend/assets/')) +); + gulp.task('copy:client:fonts', () => gulp.src('./packages/client/node_modules/three/examples/fonts/**/*').pipe(gulp.dest('./built/_client_dist_/fonts/')) ); @@ -35,6 +39,7 @@ gulp.task('copy:client:locales', cb => { cb(); }); + gulp.task('build:backend:script', () => { return gulp.src(['./packages/backend/src/server/web/boot.js', './packages/backend/src/server/web/bios.js', './packages/backend/src/server/web/cli.js']) .pipe(replace('LANGS', JSON.stringify(Object.keys(locales)))) diff --git a/packages/backend/src/server/web/views/base.pug b/packages/backend/src/server/web/views/base.pug index 416f4d818f..925bd6ba90 100644 --- a/packages/backend/src/server/web/views/base.pug +++ b/packages/backend/src/server/web/views/base.pug @@ -36,6 +36,7 @@ html link(rel='prefetch' href='/static-assets/badges/not-found.png') link(rel='prefetch' href='/static-assets/badges/error.png') link(rel='stylesheet' href='/assets/fontawesome/css/all.css') + link(rel='stylesheet' href='/static-assets/instance.css') link(rel='modulepreload' href=`/assets/${clientEntry.file}`) each href in clientEntry.css From b2829fa7bf58f040220b8953cff111281f90194f Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 02:34:00 -0700 Subject: [PATCH 20/42] typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 06d3e01e06..36606c12d8 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ cp ../misskey/.config/default.yml ./.config/default.yml # replace `../misskey/` ## 💅 Customize - To add custom CSS for all users, edit `/custom/instance.css`. -- To add static assets (such as images for the splash screen), place them in the `/custom/` folder. They'll then be avaliable with `https://yourinstance.tld/static-assets/filename.png`. +- To add static assets (such as images for the splash screen), place them in the `/custom/` folder. They'll then be avaliable on `https://yourinstance.tld/static-assets/filename.png`. ## 🚀 Build and launch! From 1514757198ecdd45dbc4294dbb2e1b31d3713467 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 02:37:12 -0700 Subject: [PATCH 21/42] fix gulpfile --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index c407ba0e28..2eaeac0f34 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -58,7 +58,7 @@ gulp.task('build:backend:style', () => { }); gulp.task('build', gulp.parallel( - 'copy:client:locales', 'copy:backend:views', 'build:backend:script', 'build:backend:style', 'copy:client:fonts', 'copy:client:fontawesome' + 'copy:client:locales', 'copy:backend:views', 'copy:backend:custom', 'build:backend:script', 'build:backend:style', 'copy:client:fonts', 'copy:client:fontawesome' )); gulp.task('default', gulp.task('build')); From 9addbd1e2bc7cf0dfbc1228c954ba71e4d874fe7 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 02:40:51 -0700 Subject: [PATCH 22/42] fix caption in admin settings --- package.json | 2 +- packages/client/src/pages/admin/settings.vue | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 6fe1d479de..286fef7a84 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.118.1-calc.rc.7", + "version": "12.118.1-calc.rc.8", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/pages/admin/settings.vue b/packages/client/src/pages/admin/settings.vue index 43d1f43f94..bcdc7ea020 100644 --- a/packages/client/src/pages/admin/settings.vue +++ b/packages/client/src/pages/admin/settings.vue @@ -46,8 +46,10 @@ {{ i18n.ts.enableRecommendedTimeline }} - - + + + + From 072be6870f61fad913d88de88cfbb1b00368a86f Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 10:35:46 -0700 Subject: [PATCH 23/42] Move splash below theme --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 286fef7a84..392ab08931 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.118.1-calc.rc.8", +"version": "12.118.1-calc.rc.8", "codename": "aqua", "repository": { "type": "git", From ea01259b963e7fee1d4f335a4e3a03201e102196 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 10:35:47 -0700 Subject: [PATCH 24/42] Splash below theme --- packages/client/src/pages/admin/settings.vue | 28 ++++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/client/src/pages/admin/settings.vue b/packages/client/src/pages/admin/settings.vue index bcdc7ea020..2871abab25 100644 --- a/packages/client/src/pages/admin/settings.vue +++ b/packages/client/src/pages/admin/settings.vue @@ -58,20 +58,6 @@ {{ i18n.ts.disablingTimelinesInfo }} - - - - - - - - - - - - - - @@ -107,6 +93,20 @@ + + + + + + + + + + + + + + From d9b8450efb30c033d64b0e5bab69d40c33e4d00f Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 11:12:56 -0700 Subject: [PATCH 25/42] Togglable guest timeline --- CALCKEY.md | 1 + locales/en-US.yml | 1 + locales/ja-JP.yml | 1 + packages/backend/migration/1660068273737GuestTimeline.js | 9 +++++++++ packages/backend/src/models/entities/meta.ts | 5 +++++ packages/backend/src/server/api/endpoints/meta.ts | 6 ++++++ packages/backend/src/server/nodeinfo.ts | 1 + packages/client/src/pages/admin/settings.vue | 4 ++++ packages/client/src/router.ts | 5 +++++ packages/client/src/ui/visitor/b.vue | 2 +- packages/client/src/ui/visitor/header.vue | 2 +- 11 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 packages/backend/migration/1660068273737GuestTimeline.js diff --git a/CALCKEY.md b/CALCKEY.md index dacaf77eea..e25034a463 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -68,6 +68,7 @@ - 👍 also triggers generic like/favorite - [Add additional background for acrylic popups if backdrop-filter is unsupported](https://github.com/misskey-dev/misskey/pull/8671) - [Timeline page for non-login users](https://github.com/misskey-dev/misskey/pull/8927) + - Made toggleable by instance admins, off by default - [Add parameters to MFM rotate](https://github.com/misskey-dev/misskey/pull/8549) - Many changes from [Foundkey](https://akkoma.dev/FoundKeyGang/Foundkey) - 0ece67b04c3f0365057624c1068808276ccab981: refactor pages/auth.form.vue to composition API diff --git a/locales/en-US.yml b/locales/en-US.yml index f64a7c20d1..9ac13a7e90 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -324,6 +324,7 @@ disconnectService: "Disconnect" enableLocalTimeline: "Enable local timeline" enableGlobalTimeline: "Enable global timeline" enableRecommendedTimeline: "Enable recommended timeline" +enableGuestTimeline: "Enable timelines for non-logged in users" disablingTimelinesInfo: "Adminstrators and Moderators will always have access to all timelines, even if they are not enabled." registration: "Register" enableRegistration: "Enable new user registration" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index ecd30b42d8..bb159aba37 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -324,6 +324,7 @@ disconnectService: "切断する" enableLocalTimeline: "ローカルタイムラインを有効にする" enableGlobalTimeline: "グローバルタイムラインを有効にする" enableRecommendedTimeline: "推奨されるタイムラインを有効にする" +enableGuestTimeline: "非ログインユーザーのタイムラインを有効にする" disablingTimelinesInfo: "これらのタイムラインを無効化しても、利便性のため管理者およびモデレーターは引き続き利用することができます。" registration: "登録" enableRegistration: "誰でも新規登録できるようにする" diff --git a/packages/backend/migration/1660068273737GuestTimeline.js b/packages/backend/migration/1660068273737GuestTimeline.js new file mode 100644 index 0000000000..cabea72012 --- /dev/null +++ b/packages/backend/migration/1660068273737GuestTimeline.js @@ -0,0 +1,9 @@ +export class GuestTimeline1660068273737 { + name = 'GuestTimeline1660068273737' + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" ADD "enableGuestTimeline" boolean NOT NULL DEFAULT true`); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableGuestTimeline"`); + } + } diff --git a/packages/backend/src/models/entities/meta.ts b/packages/backend/src/models/entities/meta.ts index 63a4193aaa..3c1612c36a 100644 --- a/packages/backend/src/models/entities/meta.ts +++ b/packages/backend/src/models/entities/meta.ts @@ -57,6 +57,11 @@ export class Meta { }) public disableGlobalTimeline: boolean; + @Column('boolean', { + default: false, + }) + public enableGuestTimeline: boolean; + @Column('boolean', { default: false, }) diff --git a/packages/backend/src/server/api/endpoints/meta.ts b/packages/backend/src/server/api/endpoints/meta.ts index ca7edc352d..43a3524c19 100644 --- a/packages/backend/src/server/api/endpoints/meta.ts +++ b/packages/backend/src/server/api/endpoints/meta.ts @@ -88,6 +88,10 @@ export const meta = { type: 'boolean', optional: false, nullable: false, }, + enableGuestTimeline: { + type: 'boolean', + optional: false, nullable: false, + }, driveCapacityPerLocalUserMb: { type: 'number', optional: false, nullable: false, @@ -366,6 +370,7 @@ export default define(meta, paramDef, async (ps, me) => { disableLocalTimeline: instance.disableLocalTimeline, disableRecommendedTimeline: instance.disableRecommendedTimeline, disableGlobalTimeline: instance.disableGlobalTimeline, + enableGuestTimeline: instance.enableGuestTimeline, driveCapacityPerLocalUserMb: instance.localDriveCapacityMb, driveCapacityPerRemoteUserMb: instance.remoteDriveCapacityMb, emailRequiredForSignup: instance.emailRequiredForSignup, @@ -423,6 +428,7 @@ export default define(meta, paramDef, async (ps, me) => { localTimeLine: !instance.disableLocalTimeline, recommendedTimeline: !instance.disableRecommendedTimeline, globalTimeLine: !instance.disableGlobalTimeline, + guestTimeline: instance.enableGuestTimeline, emailRequiredForSignup: instance.emailRequiredForSignup, elasticsearch: config.elasticsearch ? true : false, hcaptcha: instance.enableHcaptcha, diff --git a/packages/backend/src/server/nodeinfo.ts b/packages/backend/src/server/nodeinfo.ts index b4216d9d92..4e3cb63882 100644 --- a/packages/backend/src/server/nodeinfo.ts +++ b/packages/backend/src/server/nodeinfo.ts @@ -69,6 +69,7 @@ const nodeinfo2 = async () => { disableLocalTimeline: meta.disableLocalTimeline, disableRecommendedTimeline: meta.disableRecommendedTimeline, disableGlobalTimeline: meta.disableGlobalTimeline, + enableGuestTimeline: meta.enableGuestTimeline, emailRequiredForSignup: meta.emailRequiredForSignup, enableHcaptcha: meta.enableHcaptcha, enableRecaptcha: meta.enableRecaptcha, diff --git a/packages/client/src/pages/admin/settings.vue b/packages/client/src/pages/admin/settings.vue index 2871abab25..d5cf776f80 100644 --- a/packages/client/src/pages/admin/settings.vue +++ b/packages/client/src/pages/admin/settings.vue @@ -55,6 +55,7 @@ {{ i18n.ts.enableLocalTimeline }} {{ i18n.ts.enableGlobalTimeline }} + {{ i18n.ts.enableGuestTimeline }} {{ i18n.ts.disablingTimelinesInfo }} @@ -198,6 +199,7 @@ let defaultDarkTheme: any = $ref(null); let enableLocalTimeline: boolean = $ref(false); let enableGlobalTimeline: boolean = $ref(false); let enableRecommendedTimeline: boolean = $ref(false); +let enableGuestTimeline: boolean = $ref(false); let pinnedUsers: string = $ref(''); let customMOTD: string = $ref(''); let recommendedInstances: string = $ref(''); @@ -229,6 +231,7 @@ async function init() { enableLocalTimeline = !meta.disableLocalTimeline; enableGlobalTimeline = !meta.disableGlobalTimeline; enableRecommendedTimeline = !meta.disableRecommendedTimeline; + enableGuestTimeline = meta.enableGuestTimeline; pinnedUsers = meta.pinnedUsers.join('\n'); customMOTD = meta.customMOTD.join('\n'); customSplashIcons = meta.customSplashIcons.join('\n'); @@ -261,6 +264,7 @@ function save() { disableLocalTimeline: !enableLocalTimeline, disableGlobalTimeline: !enableGlobalTimeline, disableRecommendedTimeline: !enableRecommendedTimeline, + enableGuestTimeline: enableGuestTimeline, pinnedUsers: pinnedUsers.split('\n'), customMOTD: customMOTD.split('\n'), customSplashIcons: customSplashIcons.split('\n'), diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index 29b2eb5909..322f9bc123 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -4,6 +4,10 @@ import { $i, iAmModerator } from '@/account'; import MkLoading from '@/pages/_loading_.vue'; import MkError from '@/pages/_error_.vue'; import { ui } from '@/config'; +import * as os from '@/os'; + +const meta = await os.api('admin/meta'); +const guestTimeline = meta.enableGuestTimeline; const page = (loader: AsyncComponentLoader) => defineAsyncComponent({ loader: loader, @@ -456,6 +460,7 @@ export const routes = [{ }, { path: '/timeline', component: page(() => import('./pages/timeline.vue')), + loginRequired: guestTimeline, }, { name: 'index', path: '/', diff --git a/packages/client/src/ui/visitor/b.vue b/packages/client/src/ui/visitor/b.vue index bb0c59e4ff..e2c70d7341 100644 --- a/packages/client/src/ui/visitor/b.vue +++ b/packages/client/src/ui/visitor/b.vue @@ -77,7 +77,7 @@ const announcements = { endpoint: 'announcements', limit: 10, }; -const isTimelineAvailable = !instance.disableLocalTimeline || !instance.disableRecommendedTimeline || !instance.disableGlobalTimeline; +const isTimelineAvailable = instance.enableGuestTimeline && (!instance.disableLocalTimeline || !instance.disableRecommendedTimeline || !instance.disableGlobalTimeline); let showMenu = $ref(false); let isDesktop = $ref(window.innerWidth >= DESKTOP_THRESHOLD); let narrow = $ref(window.innerWidth < 1280); diff --git a/packages/client/src/ui/visitor/header.vue b/packages/client/src/ui/visitor/header.vue index 6b4dd1ded2..80a3a34914 100644 --- a/packages/client/src/ui/visitor/header.vue +++ b/packages/client/src/ui/visitor/header.vue @@ -60,7 +60,7 @@ export default defineComponent({ return { narrow: null, showMenu: false, - isTimelineAvailable: !instance.disableLocalTimeline || !instance.disableRecommendedTimeline || !instance.disableGlobalTimeline, + isTimelineAvailable: instance.enableGuestTimeline && (!instance.disableLocalTimeline || !instance.disableRecommendedTimeline || !instance.disableGlobalTimeline), }; }, From 5c164119f1d91c15de86a054efba4fdb1bccf25b Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 11:14:14 -0700 Subject: [PATCH 26/42] default false --- packages/backend/migration/1660068273737GuestTimeline.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/migration/1660068273737GuestTimeline.js b/packages/backend/migration/1660068273737GuestTimeline.js index cabea72012..23d3bc51b0 100644 --- a/packages/backend/migration/1660068273737GuestTimeline.js +++ b/packages/backend/migration/1660068273737GuestTimeline.js @@ -1,7 +1,7 @@ export class GuestTimeline1660068273737 { name = 'GuestTimeline1660068273737' async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "enableGuestTimeline" boolean NOT NULL DEFAULT true`); + await queryRunner.query(`ALTER TABLE "meta" ADD "enableGuestTimeline" boolean NOT NULL DEFAULT false`); } async down(queryRunner) { await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableGuestTimeline"`); From c845d196953495e867b24ff8c4c02fd05d67f30d Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 11:14:40 -0700 Subject: [PATCH 27/42] rc 9 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 392ab08931..bd70df3173 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", -"version": "12.118.1-calc.rc.8", +"version": "12.118.1-calc.rc.9", "codename": "aqua", "repository": { "type": "git", From 19a2c32836c3df9312bbbb0be3a42f96c0f7e72e Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 11:19:03 -0700 Subject: [PATCH 28/42] no async --- packages/client/src/router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index 322f9bc123..8edfa03f3b 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -6,7 +6,7 @@ import MkError from '@/pages/_error_.vue'; import { ui } from '@/config'; import * as os from '@/os'; -const meta = await os.api('admin/meta'); +const meta = os.api('admin/meta'); const guestTimeline = meta.enableGuestTimeline; const page = (loader: AsyncComponentLoader) => defineAsyncComponent({ From 47c19181f829a4678f66649a0e0049e766d13ffc Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 11:23:23 -0700 Subject: [PATCH 29/42] welcome explore button to `/explore` --- packages/client/src/pages/welcome.entrance.a.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/pages/welcome.entrance.a.vue b/packages/client/src/pages/welcome.entrance.a.vue index a2eec58f02..ba7c54f9ad 100644 --- a/packages/client/src/pages/welcome.entrance.a.vue +++ b/packages/client/src/pages/welcome.entrance.a.vue @@ -35,7 +35,7 @@
{{ i18n.ts.signup }} {{ i18n.ts.login }} - Explore + Explore
From da83fd1ef2586b0f0418eec416afb95e45bb80af Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 13:00:14 -0700 Subject: [PATCH 30/42] fix: :fire: Remove meta implementation in routing for now --- packages/backend/src/server/api/endpoints/admin/meta.ts | 1 + .../backend/src/server/api/endpoints/admin/update-meta.ts | 5 +++++ packages/client/src/router.ts | 6 ++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index 71a217d935..afe5889145 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -398,6 +398,7 @@ export default define(meta, paramDef, async (ps, me) => { disableLocalTimeline: instance.disableLocalTimeline, disableRecommendedTimeline: instance.disableRecommendedTimeline, disableGlobalTimeline: instance.disableGlobalTimeline, + enableGuestTimeline: instance.enableGuestTimeline, driveCapacityPerLocalUserMb: instance.localDriveCapacityMb, driveCapacityPerRemoteUserMb: instance.remoteDriveCapacityMb, emailRequiredForSignup: instance.emailRequiredForSignup, 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 0220c4a7ca..26745339b9 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -18,6 +18,7 @@ export const paramDef = { disableLocalTimeline: { type: 'boolean', nullable: true }, disableRecommendedTimeline: { type: 'boolean', nullable: true }, disableGlobalTimeline: { type: 'boolean', nullable: true }, + enableGuestTimeline: { type: 'boolean', nullable: true }, useStarForReactionFallback: { type: 'boolean', nullable: true }, recommendedInstances: { type: 'array', nullable: true, items: { type: 'string', @@ -141,6 +142,10 @@ export default define(meta, paramDef, async (ps, me) => { set.disableGlobalTimeline = ps.disableGlobalTimeline; } + if (typeof ps.enableGuestTimeline === 'boolean') { + set.enableGuestTimeline = ps.enableGuestTimeline; + } + if (typeof ps.useStarForReactionFallback === 'boolean') { set.useStarForReactionFallback = ps.useStarForReactionFallback; } diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index 8edfa03f3b..89f89461c9 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -4,10 +4,8 @@ import { $i, iAmModerator } from '@/account'; import MkLoading from '@/pages/_loading_.vue'; import MkError from '@/pages/_error_.vue'; import { ui } from '@/config'; -import * as os from '@/os'; -const meta = os.api('admin/meta'); -const guestTimeline = meta.enableGuestTimeline; +// const guestTimeline = nodeinfo.meta.enableGuestTimeline; const page = (loader: AsyncComponentLoader) => defineAsyncComponent({ loader: loader, @@ -460,7 +458,7 @@ export const routes = [{ }, { path: '/timeline', component: page(() => import('./pages/timeline.vue')), - loginRequired: guestTimeline, + // loginRequired: guestTimeline, }, { name: 'index', path: '/', From 4fcf5b10815715c28982b38b63cd2496c6ac1275 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 13:07:17 -0700 Subject: [PATCH 31/42] =?UTF-8?q?feat:=20=E2=9C=A8=20togglable=20guest=20t?= =?UTF-8?q?imeline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit default false rc 9 no async welcome explore button to `/explore` fix: :fire: Remove meta implementation in routing for now --- CALCKEY.md | 1 + locales/en-US.yml | 1 + locales/ja-JP.yml | 1 + package.json | 2 +- packages/backend/migration/1660068273737GuestTimeline.js | 9 +++++++++ packages/backend/src/models/entities/meta.ts | 5 +++++ packages/backend/src/server/api/endpoints/admin/meta.ts | 1 + .../src/server/api/endpoints/admin/update-meta.ts | 5 +++++ packages/backend/src/server/api/endpoints/meta.ts | 6 ++++++ packages/backend/src/server/nodeinfo.ts | 1 + packages/client/src/pages/admin/settings.vue | 4 ++++ packages/client/src/pages/welcome.entrance.a.vue | 2 +- packages/client/src/router.ts | 3 +++ packages/client/src/ui/visitor/b.vue | 2 +- packages/client/src/ui/visitor/header.vue | 2 +- 15 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 packages/backend/migration/1660068273737GuestTimeline.js diff --git a/CALCKEY.md b/CALCKEY.md index dacaf77eea..e25034a463 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -68,6 +68,7 @@ - 👍 also triggers generic like/favorite - [Add additional background for acrylic popups if backdrop-filter is unsupported](https://github.com/misskey-dev/misskey/pull/8671) - [Timeline page for non-login users](https://github.com/misskey-dev/misskey/pull/8927) + - Made toggleable by instance admins, off by default - [Add parameters to MFM rotate](https://github.com/misskey-dev/misskey/pull/8549) - Many changes from [Foundkey](https://akkoma.dev/FoundKeyGang/Foundkey) - 0ece67b04c3f0365057624c1068808276ccab981: refactor pages/auth.form.vue to composition API diff --git a/locales/en-US.yml b/locales/en-US.yml index f64a7c20d1..9ac13a7e90 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -324,6 +324,7 @@ disconnectService: "Disconnect" enableLocalTimeline: "Enable local timeline" enableGlobalTimeline: "Enable global timeline" enableRecommendedTimeline: "Enable recommended timeline" +enableGuestTimeline: "Enable timelines for non-logged in users" disablingTimelinesInfo: "Adminstrators and Moderators will always have access to all timelines, even if they are not enabled." registration: "Register" enableRegistration: "Enable new user registration" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index ecd30b42d8..bb159aba37 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -324,6 +324,7 @@ disconnectService: "切断する" enableLocalTimeline: "ローカルタイムラインを有効にする" enableGlobalTimeline: "グローバルタイムラインを有効にする" enableRecommendedTimeline: "推奨されるタイムラインを有効にする" +enableGuestTimeline: "非ログインユーザーのタイムラインを有効にする" disablingTimelinesInfo: "これらのタイムラインを無効化しても、利便性のため管理者およびモデレーターは引き続き利用することができます。" registration: "登録" enableRegistration: "誰でも新規登録できるようにする" diff --git a/package.json b/package.json index 392ab08931..bd70df3173 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", -"version": "12.118.1-calc.rc.8", +"version": "12.118.1-calc.rc.9", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/backend/migration/1660068273737GuestTimeline.js b/packages/backend/migration/1660068273737GuestTimeline.js new file mode 100644 index 0000000000..23d3bc51b0 --- /dev/null +++ b/packages/backend/migration/1660068273737GuestTimeline.js @@ -0,0 +1,9 @@ +export class GuestTimeline1660068273737 { + name = 'GuestTimeline1660068273737' + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" ADD "enableGuestTimeline" boolean NOT NULL DEFAULT false`); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableGuestTimeline"`); + } + } diff --git a/packages/backend/src/models/entities/meta.ts b/packages/backend/src/models/entities/meta.ts index 63a4193aaa..3c1612c36a 100644 --- a/packages/backend/src/models/entities/meta.ts +++ b/packages/backend/src/models/entities/meta.ts @@ -57,6 +57,11 @@ export class Meta { }) public disableGlobalTimeline: boolean; + @Column('boolean', { + default: false, + }) + public enableGuestTimeline: boolean; + @Column('boolean', { default: false, }) diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index 71a217d935..afe5889145 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -398,6 +398,7 @@ export default define(meta, paramDef, async (ps, me) => { disableLocalTimeline: instance.disableLocalTimeline, disableRecommendedTimeline: instance.disableRecommendedTimeline, disableGlobalTimeline: instance.disableGlobalTimeline, + enableGuestTimeline: instance.enableGuestTimeline, driveCapacityPerLocalUserMb: instance.localDriveCapacityMb, driveCapacityPerRemoteUserMb: instance.remoteDriveCapacityMb, emailRequiredForSignup: instance.emailRequiredForSignup, 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 0220c4a7ca..26745339b9 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -18,6 +18,7 @@ export const paramDef = { disableLocalTimeline: { type: 'boolean', nullable: true }, disableRecommendedTimeline: { type: 'boolean', nullable: true }, disableGlobalTimeline: { type: 'boolean', nullable: true }, + enableGuestTimeline: { type: 'boolean', nullable: true }, useStarForReactionFallback: { type: 'boolean', nullable: true }, recommendedInstances: { type: 'array', nullable: true, items: { type: 'string', @@ -141,6 +142,10 @@ export default define(meta, paramDef, async (ps, me) => { set.disableGlobalTimeline = ps.disableGlobalTimeline; } + if (typeof ps.enableGuestTimeline === 'boolean') { + set.enableGuestTimeline = ps.enableGuestTimeline; + } + if (typeof ps.useStarForReactionFallback === 'boolean') { set.useStarForReactionFallback = ps.useStarForReactionFallback; } diff --git a/packages/backend/src/server/api/endpoints/meta.ts b/packages/backend/src/server/api/endpoints/meta.ts index ca7edc352d..43a3524c19 100644 --- a/packages/backend/src/server/api/endpoints/meta.ts +++ b/packages/backend/src/server/api/endpoints/meta.ts @@ -88,6 +88,10 @@ export const meta = { type: 'boolean', optional: false, nullable: false, }, + enableGuestTimeline: { + type: 'boolean', + optional: false, nullable: false, + }, driveCapacityPerLocalUserMb: { type: 'number', optional: false, nullable: false, @@ -366,6 +370,7 @@ export default define(meta, paramDef, async (ps, me) => { disableLocalTimeline: instance.disableLocalTimeline, disableRecommendedTimeline: instance.disableRecommendedTimeline, disableGlobalTimeline: instance.disableGlobalTimeline, + enableGuestTimeline: instance.enableGuestTimeline, driveCapacityPerLocalUserMb: instance.localDriveCapacityMb, driveCapacityPerRemoteUserMb: instance.remoteDriveCapacityMb, emailRequiredForSignup: instance.emailRequiredForSignup, @@ -423,6 +428,7 @@ export default define(meta, paramDef, async (ps, me) => { localTimeLine: !instance.disableLocalTimeline, recommendedTimeline: !instance.disableRecommendedTimeline, globalTimeLine: !instance.disableGlobalTimeline, + guestTimeline: instance.enableGuestTimeline, emailRequiredForSignup: instance.emailRequiredForSignup, elasticsearch: config.elasticsearch ? true : false, hcaptcha: instance.enableHcaptcha, diff --git a/packages/backend/src/server/nodeinfo.ts b/packages/backend/src/server/nodeinfo.ts index b4216d9d92..4e3cb63882 100644 --- a/packages/backend/src/server/nodeinfo.ts +++ b/packages/backend/src/server/nodeinfo.ts @@ -69,6 +69,7 @@ const nodeinfo2 = async () => { disableLocalTimeline: meta.disableLocalTimeline, disableRecommendedTimeline: meta.disableRecommendedTimeline, disableGlobalTimeline: meta.disableGlobalTimeline, + enableGuestTimeline: meta.enableGuestTimeline, emailRequiredForSignup: meta.emailRequiredForSignup, enableHcaptcha: meta.enableHcaptcha, enableRecaptcha: meta.enableRecaptcha, diff --git a/packages/client/src/pages/admin/settings.vue b/packages/client/src/pages/admin/settings.vue index 2871abab25..d5cf776f80 100644 --- a/packages/client/src/pages/admin/settings.vue +++ b/packages/client/src/pages/admin/settings.vue @@ -55,6 +55,7 @@ {{ i18n.ts.enableLocalTimeline }} {{ i18n.ts.enableGlobalTimeline }} + {{ i18n.ts.enableGuestTimeline }} {{ i18n.ts.disablingTimelinesInfo }} @@ -198,6 +199,7 @@ let defaultDarkTheme: any = $ref(null); let enableLocalTimeline: boolean = $ref(false); let enableGlobalTimeline: boolean = $ref(false); let enableRecommendedTimeline: boolean = $ref(false); +let enableGuestTimeline: boolean = $ref(false); let pinnedUsers: string = $ref(''); let customMOTD: string = $ref(''); let recommendedInstances: string = $ref(''); @@ -229,6 +231,7 @@ async function init() { enableLocalTimeline = !meta.disableLocalTimeline; enableGlobalTimeline = !meta.disableGlobalTimeline; enableRecommendedTimeline = !meta.disableRecommendedTimeline; + enableGuestTimeline = meta.enableGuestTimeline; pinnedUsers = meta.pinnedUsers.join('\n'); customMOTD = meta.customMOTD.join('\n'); customSplashIcons = meta.customSplashIcons.join('\n'); @@ -261,6 +264,7 @@ function save() { disableLocalTimeline: !enableLocalTimeline, disableGlobalTimeline: !enableGlobalTimeline, disableRecommendedTimeline: !enableRecommendedTimeline, + enableGuestTimeline: enableGuestTimeline, pinnedUsers: pinnedUsers.split('\n'), customMOTD: customMOTD.split('\n'), customSplashIcons: customSplashIcons.split('\n'), diff --git a/packages/client/src/pages/welcome.entrance.a.vue b/packages/client/src/pages/welcome.entrance.a.vue index a2eec58f02..ba7c54f9ad 100644 --- a/packages/client/src/pages/welcome.entrance.a.vue +++ b/packages/client/src/pages/welcome.entrance.a.vue @@ -35,7 +35,7 @@
{{ i18n.ts.signup }} {{ i18n.ts.login }} - Explore + Explore
diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index 29b2eb5909..89f89461c9 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -5,6 +5,8 @@ import MkLoading from '@/pages/_loading_.vue'; import MkError from '@/pages/_error_.vue'; import { ui } from '@/config'; +// const guestTimeline = nodeinfo.meta.enableGuestTimeline; + const page = (loader: AsyncComponentLoader) => defineAsyncComponent({ loader: loader, loadingComponent: MkLoading, @@ -456,6 +458,7 @@ export const routes = [{ }, { path: '/timeline', component: page(() => import('./pages/timeline.vue')), + // loginRequired: guestTimeline, }, { name: 'index', path: '/', diff --git a/packages/client/src/ui/visitor/b.vue b/packages/client/src/ui/visitor/b.vue index bb0c59e4ff..e2c70d7341 100644 --- a/packages/client/src/ui/visitor/b.vue +++ b/packages/client/src/ui/visitor/b.vue @@ -77,7 +77,7 @@ const announcements = { endpoint: 'announcements', limit: 10, }; -const isTimelineAvailable = !instance.disableLocalTimeline || !instance.disableRecommendedTimeline || !instance.disableGlobalTimeline; +const isTimelineAvailable = instance.enableGuestTimeline && (!instance.disableLocalTimeline || !instance.disableRecommendedTimeline || !instance.disableGlobalTimeline); let showMenu = $ref(false); let isDesktop = $ref(window.innerWidth >= DESKTOP_THRESHOLD); let narrow = $ref(window.innerWidth < 1280); diff --git a/packages/client/src/ui/visitor/header.vue b/packages/client/src/ui/visitor/header.vue index 6b4dd1ded2..80a3a34914 100644 --- a/packages/client/src/ui/visitor/header.vue +++ b/packages/client/src/ui/visitor/header.vue @@ -60,7 +60,7 @@ export default defineComponent({ return { narrow: null, showMenu: false, - isTimelineAvailable: !instance.disableLocalTimeline || !instance.disableRecommendedTimeline || !instance.disableGlobalTimeline, + isTimelineAvailable: instance.enableGuestTimeline && (!instance.disableLocalTimeline || !instance.disableRecommendedTimeline || !instance.disableGlobalTimeline), }; }, From 4370ef7b1bafdcfa0bd8b19989254c0f95f750fa Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 15:38:30 -0700 Subject: [PATCH 32/42] fix: :alembic: Attempt to fix routing --- packages/client/src/router.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index 89f89461c9..0c85662e3d 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -3,9 +3,10 @@ import { Router } from '@/nirax'; import { $i, iAmModerator } from '@/account'; import MkLoading from '@/pages/_loading_.vue'; import MkError from '@/pages/_error_.vue'; +import { api } from '@/os'; import { ui } from '@/config'; -// const guestTimeline = nodeinfo.meta.enableGuestTimeline; +const guestTimeline = await api('meta', { detail: false }).enableGuestTimeline; const page = (loader: AsyncComponentLoader) => defineAsyncComponent({ loader: loader, @@ -458,7 +459,7 @@ export const routes = [{ }, { path: '/timeline', component: page(() => import('./pages/timeline.vue')), - // loginRequired: guestTimeline, + loginRequired: guestTimeline, }, { name: 'index', path: '/', From 50417674b2baf34615080b581c7cd0bd01c4b371 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 15:40:15 -0700 Subject: [PATCH 33/42] fix: :pencil2: Async typo --- packages/client/src/router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index 0c85662e3d..63041fd364 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -6,7 +6,7 @@ import MkError from '@/pages/_error_.vue'; import { api } from '@/os'; import { ui } from '@/config'; -const guestTimeline = await api('meta', { detail: false }).enableGuestTimeline; +const guestTimeline = api('meta', { detail: false }).enableGuestTimeline; const page = (loader: AsyncComponentLoader) => defineAsyncComponent({ loader: loader, From 8f441fd0f4a89e95e4b473ab5f63e980ccd469d0 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 15:44:44 -0700 Subject: [PATCH 34/42] chore: :loud_sound: Test logging --- packages/client/src/router.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index 63041fd364..acfa7171b0 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -6,7 +6,12 @@ import MkError from '@/pages/_error_.vue'; import { api } from '@/os'; import { ui } from '@/config'; -const guestTimeline = api('meta', { detail: false }).enableGuestTimeline; +const meta = await api('meta', { + detail: false +}); +const guestTimeline = meta.enableGuestTimeline; +console.log(meta); +console.log(guestTimeline); const page = (loader: AsyncComponentLoader) => defineAsyncComponent({ loader: loader, From 92af0d39fe9e29b88700d1ad0688d1001a570abf Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 15:46:07 -0700 Subject: [PATCH 35/42] fix: :pencil2: Same typo as before... --- package.json | 2 +- packages/client/src/router.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index bd70df3173..354d20b991 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", -"version": "12.118.1-calc.rc.9", +"version": "12.118.1-calc.rc.9.2", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index acfa7171b0..0e37d29d57 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -6,7 +6,7 @@ import MkError from '@/pages/_error_.vue'; import { api } from '@/os'; import { ui } from '@/config'; -const meta = await api('meta', { +const meta = api('meta', { detail: false }); const guestTimeline = meta.enableGuestTimeline; From 69a2a2902314f3830d54db66ba11a8535314568c Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 15:52:56 -0700 Subject: [PATCH 36/42] chore: :alembic: More debugging --- packages/client/src/router.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index 0e37d29d57..4f1c9dc899 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -8,10 +8,16 @@ import { ui } from '@/config'; const meta = api('meta', { detail: false +}).then((meta) => { + console.log(meta); + console.log(meta[0]); + console.log(meta[1]); + console.log(meta[0][0]); + // const guestTimeline = meta.enableGuestTimeline; + // console.log(guestTimeline); }); -const guestTimeline = meta.enableGuestTimeline; -console.log(meta); -console.log(guestTimeline); + +const guestTimeline = true; const page = (loader: AsyncComponentLoader) => defineAsyncComponent({ loader: loader, From 0ef9dd3519f937e3321f7cb788022b10f6064bc7 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 15:53:16 -0700 Subject: [PATCH 37/42] chore: :bookmark: Bump to .3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 354d20b991..b38bcadfd6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", -"version": "12.118.1-calc.rc.9.2", +"version": "12.118.1-calc.rc.9.3", "codename": "aqua", "repository": { "type": "git", From 4f0030ecc82824cc122bb2aad8a8791f75abc51a Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 16:12:20 -0700 Subject: [PATCH 38/42] fix: :lock: Remove timeline source if not logged in and guest tl isn't enabled --- packages/client/src/pages/timeline.vue | 6 +++++- packages/client/src/router.ts | 19 ++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/client/src/pages/timeline.vue b/packages/client/src/pages/timeline.vue index 21fc8080f5..c6a9a9c1bc 100644 --- a/packages/client/src/pages/timeline.vue +++ b/packages/client/src/pages/timeline.vue @@ -38,6 +38,7 @@ const XTutorial = defineAsyncComponent(() => import('./timeline.tutorial.vue')); const isLocalTimelineAvailable = !instance.disableLocalTimeline || ($i != null && ($i.isModerator || $i.isAdmin)); const isRecommendedTimelineAvailable = !instance.disableRecommendedTimeline || ($i != null && ($i.isModerator || $i.isAdmin)); const isGlobalTimelineAvailable = !instance.disableGlobalTimeline || ($i != null && ($i.isModerator || $i.isAdmin)); +const enableGuestTimeline = instance.enableGuestTimeline; const keymap = { 't': focus, }; @@ -47,7 +48,10 @@ const rootEl = $ref(); let queue = $ref(0); let srcWhenNotSignin = $ref(isLocalTimelineAvailable ? 'local' : 'global'); -const src = $computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin), set: (x) => saveSrc(x) }); +let src = $computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin), set: (x) => saveSrc(x) }); +if (!enableGuestTimeline) { + src = $computed({}); +} watch ($$(src), () => queue = 0); diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index 4f1c9dc899..2112c7aeb2 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -6,18 +6,15 @@ import MkError from '@/pages/_error_.vue'; import { api } from '@/os'; import { ui } from '@/config'; -const meta = api('meta', { - detail: false -}).then((meta) => { - console.log(meta); - console.log(meta[0]); - console.log(meta[1]); - console.log(meta[0][0]); - // const guestTimeline = meta.enableGuestTimeline; - // console.log(guestTimeline); -}); +function getGuestTimelineStatus() { + api('meta', { + detail: false + }).then((meta) => { + return meta.enableGuestTimeline; + }); +} -const guestTimeline = true; +const guestTimeline = getGuestTimelineStatus(); const page = (loader: AsyncComponentLoader) => defineAsyncComponent({ loader: loader, From 3fd553b82bf491145eab606bc9d065ccee785119 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 16:13:53 -0700 Subject: [PATCH 39/42] fix: :bug: No computed on declared var --- package.json | 2 +- packages/client/src/pages/timeline.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b38bcadfd6..829614b44d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", -"version": "12.118.1-calc.rc.9.3", +"version": "12.118.1-calc.rc.9.4", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/pages/timeline.vue b/packages/client/src/pages/timeline.vue index c6a9a9c1bc..54663f4682 100644 --- a/packages/client/src/pages/timeline.vue +++ b/packages/client/src/pages/timeline.vue @@ -50,7 +50,7 @@ let queue = $ref(0); let srcWhenNotSignin = $ref(isLocalTimelineAvailable ? 'local' : 'global'); let src = $computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin), set: (x) => saveSrc(x) }); if (!enableGuestTimeline) { - src = $computed({}); + src = {}; } watch ($$(src), () => queue = 0); From 7e9c16501e14638b437aed597c007a39209ef220 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 16:15:58 -0700 Subject: [PATCH 40/42] fix: :bug: Allow timeline if logged in, loll --- package.json | 2 +- packages/client/src/pages/timeline.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 829614b44d..00797437fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", -"version": "12.118.1-calc.rc.9.4", +"version": "12.118.1-calc.rc.9.5", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/pages/timeline.vue b/packages/client/src/pages/timeline.vue index 54663f4682..cb53d8472c 100644 --- a/packages/client/src/pages/timeline.vue +++ b/packages/client/src/pages/timeline.vue @@ -49,7 +49,7 @@ const rootEl = $ref(); let queue = $ref(0); let srcWhenNotSignin = $ref(isLocalTimelineAvailable ? 'local' : 'global'); let src = $computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin), set: (x) => saveSrc(x) }); -if (!enableGuestTimeline) { +if (!enableGuestTimeline && !$i) { src = {}; } From dc00651c616986dc3b593d557e2d68d438f4ae8a Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 16:22:55 -0700 Subject: [PATCH 41/42] fix: :bug: timeline secured --- package.json | 2 +- packages/client/src/pages/timeline.vue | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 00797437fe..01c57a1711 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", -"version": "12.118.1-calc.rc.9.5", +"version": "12.118.1-calc.rc.9.6", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/pages/timeline.vue b/packages/client/src/pages/timeline.vue index cb53d8472c..7afb233f77 100644 --- a/packages/client/src/pages/timeline.vue +++ b/packages/client/src/pages/timeline.vue @@ -48,10 +48,10 @@ const rootEl = $ref(); let queue = $ref(0); let srcWhenNotSignin = $ref(isLocalTimelineAvailable ? 'local' : 'global'); -let src = $computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin), set: (x) => saveSrc(x) }); -if (!enableGuestTimeline && !$i) { - src = {}; +if (!enableGuestTimeline) { + srcWhenNotSignin = ''; } +const src = $computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin), set: (x) => saveSrc(x) }); watch ($$(src), () => queue = 0); From c5cea77bcdb1a14f91d65044f058dadc6ef68558 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 16:27:43 -0700 Subject: [PATCH 42/42] fix: :bug: Remove header tabs if guest not enabled and not logged in --- packages/client/src/pages/timeline.vue | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/client/src/pages/timeline.vue b/packages/client/src/pages/timeline.vue index 7afb233f77..035db9e97f 100644 --- a/packages/client/src/pages/timeline.vue +++ b/packages/client/src/pages/timeline.vue @@ -126,12 +126,7 @@ const headerActions = $computed(() => [{ title: i18n.ts.antennas, iconOnly: true, handler: chooseAntenna, -}, /* { - icon: 'fas fa-satellite-dish', - title: i18n.ts.channel, - iconOnly: true, - handler: chooseChannel, -}, */ { +}, { icon: 'fas fa-calendar-alt', title: i18n.ts.jumpToSpecifiedDate, iconOnly: true, @@ -168,7 +163,7 @@ const headerTabs = $computed(() => [{ iconOnly: true, }] : [])]); -const headerTabsWhenNotLogin = $computed(() => [ +let headerTabsWhenNotLogin = $computed(() => [ ...(isLocalTimelineAvailable ? [{ key: 'local', title: i18n.ts._timelines.local, @@ -183,6 +178,10 @@ const headerTabsWhenNotLogin = $computed(() => [ }] : []), ]); +if (!enableGuestTimeline) { + headerTabsWhenNotLogin = []; +} + definePageMetadata(computed(() => ({ title: i18n.ts.timeline, icon: src === 'local' ? 'fas fa-user-group' : src === 'social' ? 'fas fa-handshake-simple' : src === 'recommended' ? 'fas fa-signs-post' : src === 'global' ? 'fas fa-globe' : 'fas fa-home',