From 31af36e57eb48b60f108ca5e550c153aa9ec35ba Mon Sep 17 00:00:00 2001 From: CherryKitten Date: Mon, 28 Nov 2022 23:43:24 +0100 Subject: [PATCH 01/18] Don't hardcode locales --- locales/index.js | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/locales/index.js b/locales/index.js index 92cd9b467c..3be17d471e 100644 --- a/locales/index.js +++ b/locales/index.js @@ -13,33 +13,14 @@ const merge = (...args) => args.reduce((a, c) => ({ .reduce((a, [k, v]) => (a[k] = merge(v, c[k]), a), {}) }), {}); -const languages = [ - 'ar-SA', - 'cs-CZ', - 'da-DK', - 'de-DE', - 'en-US', - 'es-ES', - 'fr-FR', - 'id-ID', - 'it-IT', - 'ja-JP', - 'ja-KS', - 'kab-KAB', - 'kn-IN', - 'ko-KR', - 'nl-NL', - 'no-NO', - 'pl-PL', - 'pt-PT', - 'ru-RU', - 'sk-SK', - 'ug-CN', - 'uk-UA', - 'vi-VN', - 'zh-CN', - 'zh-TW', -]; +languages = [] + +fs.readdirSync(__dirname).forEach((file) => { + if (file.includes('.yml')){ + file = file.slice(0, file.indexOf('.')) + languages.push(file) + } +}) const primaries = { 'en': 'US', From 7e3c34495e1e4dde7fdbc6f09bfd4f007f808da1 Mon Sep 17 00:00:00 2001 From: CherryKitten Date: Tue, 29 Nov 2022 01:05:16 +0100 Subject: [PATCH 02/18] Add custom locales --- .gitignore | 1 + locales/index.js | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index a4e0313996..fcab9e323e 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,7 @@ api-docs.json ormconfig.json /custom packages/backend/assets/instance.css +/locales/custom # blender backups *.blend1 diff --git a/locales/index.js b/locales/index.js index 3be17d471e..94643a76ee 100644 --- a/locales/index.js +++ b/locales/index.js @@ -4,6 +4,8 @@ const fs = require('fs'); const yaml = require('js-yaml'); +let languages = [] +let languages_custom = [] const merge = (...args) => args.reduce((a, c) => ({ ...a, @@ -13,12 +15,18 @@ const merge = (...args) => args.reduce((a, c) => ({ .reduce((a, [k, v]) => (a[k] = merge(v, c[k]), a), {}) }), {}); -languages = [] fs.readdirSync(__dirname).forEach((file) => { if (file.includes('.yml')){ file = file.slice(0, file.indexOf('.')) - languages.push(file) + languages.push(file); + } +}) + +fs.readdirSync(__dirname + '/custom').forEach((file) => { + if (file.includes('.yml')){ + file = file.slice(0, file.indexOf('.')) + languages_custom.push(file); } }) @@ -32,6 +40,8 @@ const primaries = { const clean = (text) => text.replace(new RegExp(String.fromCodePoint(0x08), 'g'), ''); const locales = languages.reduce((a, c) => (a[c] = yaml.load(clean(fs.readFileSync(`${__dirname}/${c}.yml`, 'utf-8'))) || {}, a), {}); +const locales_custom = languages_custom.reduce((a, c) => (a[c] = yaml.load(clean(fs.readFileSync(`${__dirname}/custom/${c}.yml`, 'utf-8'))) || {}, a), {}); +Object.assign(locales, locales_custom) module.exports = Object.entries(locales) .reduce((a, [k ,v]) => (a[k] = (() => { From 43961da9236cc81a82ef078fec5cd69e13927963 Mon Sep 17 00:00:00 2001 From: CherryKitten Date: Tue, 29 Nov 2022 01:15:07 +0100 Subject: [PATCH 03/18] docs: custom locales --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9bf4083470..a62a56d668 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ psql postgres -c "create database calckey with encoding = 'UTF8';" - 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/` directory. They'll then be avaliable on `https://yourinstance.tld/static-assets/filename.ext`. +- To add custom locales, create a directory `/locales/custom/` and place custom locale files in there. If you name your custom locale the same as an existing locale, it will overwrite it. If you give it a unique name, it will be added to the list. - To update custom assets without rebuilding, just run `yarn run gulp`. ## ๐Ÿง‘โ€๐Ÿ”ฌ Configuring a new instance From efbce8e28727f45bce53199c0fce8215784c32ca Mon Sep 17 00:00:00 2001 From: CherryKitten Date: Tue, 29 Nov 2022 22:27:08 +0100 Subject: [PATCH 04/18] Docs: Add info for custom locale naming --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a62a56d668..a9d1397b37 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ psql postgres -c "create database calckey with encoding = 'UTF8';" - 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/` directory. They'll then be avaliable on `https://yourinstance.tld/static-assets/filename.ext`. -- To add custom locales, create a directory `/locales/custom/` and place custom locale files in there. If you name your custom locale the same as an existing locale, it will overwrite it. If you give it a unique name, it will be added to the list. +- To add custom locales, create a directory `/locales/custom/` and place custom locale files in there. If you name your custom locale the same as an existing locale, it will overwrite it. If you give it a unique name, it will be added to the list. Also make sure that the first part of the filename matches the locale you're basing it on. (Example: `en-FOO.yml`) - To update custom assets without rebuilding, just run `yarn run gulp`. ## ๐Ÿง‘โ€๐Ÿ”ฌ Configuring a new instance From 439d0628626b2ca129990c37e958c316a731bdb3 Mon Sep 17 00:00:00 2001 From: CherryKitten Date: Tue, 29 Nov 2022 23:08:37 +0100 Subject: [PATCH 05/18] Rework `custom` behaviour --- .gitignore | 1 - custom/{ => assets}/instance.css | 0 custom/locales/.gitkeep | 0 gulpfile.js | 2 +- locales/index.js | 4 ++-- 5 files changed, 3 insertions(+), 4 deletions(-) rename custom/{ => assets}/instance.css (100%) create mode 100644 custom/locales/.gitkeep diff --git a/.gitignore b/.gitignore index fcab9e323e..a4e0313996 100644 --- a/.gitignore +++ b/.gitignore @@ -52,7 +52,6 @@ api-docs.json ormconfig.json /custom packages/backend/assets/instance.css -/locales/custom # blender backups *.blend1 diff --git a/custom/instance.css b/custom/assets/instance.css similarity index 100% rename from custom/instance.css rename to custom/assets/instance.css diff --git a/custom/locales/.gitkeep b/custom/locales/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/gulpfile.js b/gulpfile.js index 86f860e568..89a6acb839 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -16,7 +16,7 @@ gulp.task('copy:backend:views', () => ); gulp.task('copy:backend:custom', () => - gulp.src('./custom/*').pipe(gulp.dest('./packages/backend/assets/')) + gulp.src('./custom/assets/*').pipe(gulp.dest('./packages/backend/assets/')) ); gulp.task('copy:client:fonts', () => diff --git a/locales/index.js b/locales/index.js index 94643a76ee..7399bb5a18 100644 --- a/locales/index.js +++ b/locales/index.js @@ -23,7 +23,7 @@ fs.readdirSync(__dirname).forEach((file) => { } }) -fs.readdirSync(__dirname + '/custom').forEach((file) => { +fs.readdirSync(__dirname + '/../custom/locales').forEach((file) => { if (file.includes('.yml')){ file = file.slice(0, file.indexOf('.')) languages_custom.push(file); @@ -40,7 +40,7 @@ const primaries = { const clean = (text) => text.replace(new RegExp(String.fromCodePoint(0x08), 'g'), ''); const locales = languages.reduce((a, c) => (a[c] = yaml.load(clean(fs.readFileSync(`${__dirname}/${c}.yml`, 'utf-8'))) || {}, a), {}); -const locales_custom = languages_custom.reduce((a, c) => (a[c] = yaml.load(clean(fs.readFileSync(`${__dirname}/custom/${c}.yml`, 'utf-8'))) || {}, a), {}); +const locales_custom = languages_custom.reduce((a, c) => (a[c] = yaml.load(clean(fs.readFileSync(`${__dirname}/../custom/locales/${c}.yml`, 'utf-8'))) || {}, a), {}); Object.assign(locales, locales_custom) module.exports = Object.entries(locales) From 20dc59c342d5ee22746a5f9c67a561ce1a8f3373 Mon Sep 17 00:00:00 2001 From: CherryKitten Date: Wed, 30 Nov 2022 19:51:12 +0100 Subject: [PATCH 06/18] docs: reflect last change in readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a9d1397b37..5c4037a2ce 100644 --- a/README.md +++ b/README.md @@ -95,9 +95,9 @@ psql postgres -c "create database calckey with encoding = 'UTF8';" ## ๐Ÿ’… 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/` directory. They'll then be avaliable on `https://yourinstance.tld/static-assets/filename.ext`. -- To add custom locales, create a directory `/locales/custom/` and place custom locale files in there. If you name your custom locale the same as an existing locale, it will overwrite it. If you give it a unique name, it will be added to the list. Also make sure that the first part of the filename matches the locale you're basing it on. (Example: `en-FOO.yml`) +- To add custom CSS for all users, edit `./custom/assets/instance.css`. +- To add static assets (such as images for the splash screen), place them in the `./custom/assets/` directory. They'll then be avaliable on `https://yourinstance.tld/static-assets/filename.ext`. +- To add custom locales, place them in the `./custom/locales/` directory. If you name your custom locale the same as an existing locale, it will overwrite it. If you give it a unique name, it will be added to the list. Also make sure that the first part of the filename matches the locale you're basing it on. (Example: `en-FOO.yml`) - To update custom assets without rebuilding, just run `yarn run gulp`. ## ๐Ÿง‘โ€๐Ÿ”ฌ Configuring a new instance From 3ff6433fab7a88b8904a8f93c100f89b6f14a8c6 Mon Sep 17 00:00:00 2001 From: skeh Date: Thu, 1 Dec 2022 07:45:08 +0000 Subject: [PATCH 07/18] Merge pull request 'hotfix/misskey-forkbomb' (#8) from hotfix/misskey-forkbomb into stage Reviewed-on: https://code.vtopia.live/Vtopia/MissV/pulls/8 --- .../backend/src/remote/activitypub/kernel/update/index.ts | 2 +- packages/backend/src/remote/activitypub/models/person.ts | 8 ++++---- .../backend/src/remote/activitypub/models/question.ts | 4 ++-- packages/backend/src/remote/activitypub/resolver.ts | 8 ++++++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/backend/src/remote/activitypub/kernel/update/index.ts b/packages/backend/src/remote/activitypub/kernel/update/index.ts index 9e8a81bb39..022be0ad8e 100644 --- a/packages/backend/src/remote/activitypub/kernel/update/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/update/index.ts @@ -26,7 +26,7 @@ export default async (actor: CacheableRemoteUser, activity: IUpdate): Promise console.log(e)); + await updateQuestion(object, resolver).catch(e => console.log(e)); return `ok: Question updated`; } else { return `skip: Unknown type: ${getApType(object)}`; diff --git a/packages/backend/src/remote/activitypub/models/person.ts b/packages/backend/src/remote/activitypub/models/person.ts index 6097e3b6ed..5ef04588e9 100644 --- a/packages/backend/src/remote/activitypub/models/person.ts +++ b/packages/backend/src/remote/activitypub/models/person.ts @@ -271,7 +271,7 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise logger.error(err)); + await updateFeatured(user!.id, resolver).catch(err => logger.error(err)); return user!; } @@ -384,7 +384,7 @@ export async function updatePerson(uri: string, resolver?: Resolver | null, hint followerSharedInbox: person.sharedInbox || (person.endpoints ? person.endpoints.sharedInbox : undefined), }); - await updateFeatured(exist.id).catch(err => logger.error(err)); + await updateFeatured(exist.id, resolver).catch(err => logger.error(err)); } /** @@ -462,14 +462,14 @@ export function analyzeAttachments(attachments: IObject | IObject[] | undefined) return { fields, services }; } -export async function updateFeatured(userId: User['id']) { +export async function updateFeatured(userId: User['id'], resolver?: Resolver) { const user = await Users.findOneByOrFail({ id: userId }); if (!Users.isRemoteUser(user)) return; if (!user.featured) return; logger.info(`Updating the featured: ${user.uri}`); - const resolver = new Resolver(); + if (resolver == null) resolver = new Resolver(); // Resolve to (Ordered)Collection Object const collection = await resolver.resolveCollection(user.featured); diff --git a/packages/backend/src/remote/activitypub/models/question.ts b/packages/backend/src/remote/activitypub/models/question.ts index f0321fdf2f..94a50d4f71 100644 --- a/packages/backend/src/remote/activitypub/models/question.ts +++ b/packages/backend/src/remote/activitypub/models/question.ts @@ -40,7 +40,7 @@ export async function extractPollFromQuestion(source: string | IObject, resolver * @param uri URI of AP Question object * @returns true if updated */ -export async function updateQuestion(value: any) { +export async function updateQuestion(value: any, resolver?: Resolver) { const uri = typeof value === 'string' ? value : value.id; // URIใŒใ“ใฎใ‚ตใƒผใƒใƒผใ‚’ๆŒ‡ใ—ใฆใ„ใ‚‹ใชใ‚‰ใ‚นใ‚ญใƒƒใƒ— @@ -55,7 +55,7 @@ export async function updateQuestion(value: any) { //#endregion // resolve new Question object - const resolver = new Resolver(); + if (resolver == null) resolver = new Resolver(); const question = await resolver.resolve(value) as IQuestion; apLogger.debug(`fetched question: ${JSON.stringify(question, null, 2)}`); diff --git a/packages/backend/src/remote/activitypub/resolver.ts b/packages/backend/src/remote/activitypub/resolver.ts index 5c9d44292e..94227e4db5 100644 --- a/packages/backend/src/remote/activitypub/resolver.ts +++ b/packages/backend/src/remote/activitypub/resolver.ts @@ -19,9 +19,11 @@ import renderFollow from '@/remote/activitypub/renderer/follow.js'; export default class Resolver { private history: Set; private user?: ILocalUser; + private recursionLimit?: number; - constructor() { + constructor(recursionLimit = 100) { this.history = new Set(); + this.recursionLimit = recursionLimit; } public getHistory(): string[] { @@ -59,7 +61,9 @@ export default class Resolver { if (this.history.has(value)) { throw new Error('cannot resolve already resolved one'); } - + if (this.recursionLimit && this.history.size > this.recursionLimit) { + throw new Error('hit recursion limit'); + } this.history.add(value); const host = extractDbHost(value); From 20e78ff1ce8826300ba82ffcbcd926b55a41173c Mon Sep 17 00:00:00 2001 From: thatonecalculator Date: Thu, 1 Dec 2022 00:32:28 -0800 Subject: [PATCH 08/18] Thank you MissV for forkbomb fix --- CALCKEY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CALCKEY.md b/CALCKEY.md index 976cad22b2..892c79607c 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -89,6 +89,7 @@ - Patron list - Animations respect reduced motion - Obliteration of Ai-chan +- MissV: [fix Misskey Forkbomb](https://code.vtopia.live/Vtopia/MissV/commit/40b23c070bd4adbb3188c73546c6c625138fb3c1) - [Make showing ads optional](https://github.com/misskey-dev/misskey/pull/8996) - [Tapping avatar in mobile opens account modal](https://github.com/misskey-dev/misskey/pull/9056) - [OAuth bearer token authentication](https://github.com/misskey-dev/misskey/pull/9021) From c825d6c5baf6b55d28a0b32f173740f6cb8ce5cf Mon Sep 17 00:00:00 2001 From: thatonecalculator Date: Thu, 1 Dec 2022 00:34:37 -0800 Subject: [PATCH 09/18] 7 --- package.json | 2 +- packages/client/src/pages/messaging/messaging-room.message.vue | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/package.json b/package.json index 05510cafb8..2651c05f5c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "12.119.0-calc.18-rc.6", + "version": "12.119.0-calc.18-rc.7", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/pages/messaging/messaging-room.message.vue b/packages/client/src/pages/messaging/messaging-room.message.vue index 9e2af50466..7e66dfcc2d 100644 --- a/packages/client/src/pages/messaging/messaging-room.message.vue +++ b/packages/client/src/pages/messaging/messaging-room.message.vue @@ -90,7 +90,6 @@ function del(): void { min-height: 38px; border-radius: 16px; max-width: 100%; - margin-left: 4%; & + * { clear: both; @@ -215,8 +214,6 @@ function del(): void { > .balloon { $color: var(--X4); - margin-right: 4%; - margin-left: 0%; background: $color; &.noText { From 9bd397ce88f84493fbdf79b75a16e6f40f41d35a Mon Sep 17 00:00:00 2001 From: thatonecalculator Date: Thu, 1 Dec 2022 22:39:50 -0800 Subject: [PATCH 10/18] No hover cursor on mobile --- packages/client/src/components/MkNote.vue | 4 ++++ packages/client/src/components/MkNoteDetailed.vue | 9 ++++++++- packages/client/src/components/MkNoteSub.vue | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/MkNote.vue b/packages/client/src/components/MkNote.vue index 20d2bbee47..613203091b 100644 --- a/packages/client/src/components/MkNote.vue +++ b/packages/client/src/components/MkNote.vue @@ -428,6 +428,10 @@ function readPromo() { padding: 28px 32px 18px; cursor: pointer; + @media (pointer: coarse) { + cursor: default; + } + > .avatar { flex-shrink: 0; display: block; diff --git a/packages/client/src/components/MkNoteDetailed.vue b/packages/client/src/components/MkNoteDetailed.vue index 54d7ec0ca9..2deb184416 100644 --- a/packages/client/src/components/MkNoteDetailed.vue +++ b/packages/client/src/components/MkNoteDetailed.vue @@ -347,7 +347,10 @@ if (appearNote.replyId) { > .reply-to-more { opacity: 0.7; cursor: pointer; - + + @media (pointer: coarse) { + cursor: default; + } } > .renote { @@ -546,6 +549,10 @@ if (appearNote.replyId) { > .reply { border-top: solid 0.5px var(--divider); cursor: pointer; + + @media (pointer: coarse) { + cursor: default; + } } > .reply, .reply-to, .reply-to-more { diff --git a/packages/client/src/components/MkNoteSub.vue b/packages/client/src/components/MkNoteSub.vue index c1943920df..5a3539222c 100644 --- a/packages/client/src/components/MkNoteSub.vue +++ b/packages/client/src/components/MkNoteSub.vue @@ -88,6 +88,10 @@ const replies: misskey.entities.Note[] = props.conversation?.filter(item => item flex: 1; min-width: 0; cursor: pointer; + + @media (pointer: coarse) { + cursor: default; + } > .header { margin-bottom: 2px; From 01c19e4f5599ff72e495632c35b32380c2da850e Mon Sep 17 00:00:00 2001 From: thatonecalculator Date: Thu, 1 Dec 2022 23:11:11 -0800 Subject: [PATCH 11/18] Renote confirmation (closes #9051 & #9166) --- CALCKEY.md | 1 + .../client/src/components/MkRenoteButton.vue | 59 ++++++++++++------- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/CALCKEY.md b/CALCKEY.md index 892c79607c..dfcb191e41 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -89,6 +89,7 @@ - Patron list - Animations respect reduced motion - Obliteration of Ai-chan +- Undo renote button inside original note - MissV: [fix Misskey Forkbomb](https://code.vtopia.live/Vtopia/MissV/commit/40b23c070bd4adbb3188c73546c6c625138fb3c1) - [Make showing ads optional](https://github.com/misskey-dev/misskey/pull/8996) - [Tapping avatar in mobile opens account modal](https://github.com/misskey-dev/misskey/pull/9056) diff --git a/packages/client/src/components/MkRenoteButton.vue b/packages/client/src/components/MkRenoteButton.vue index c3cc5794e8..7550c4ab02 100644 --- a/packages/client/src/components/MkRenoteButton.vue +++ b/packages/client/src/components/MkRenoteButton.vue @@ -55,29 +55,45 @@ useTooltip(buttonRef, async (showing) => { const renote = (viaKeyboard = false, ev?: MouseEvent) => { pleaseLogin(); - if (defaultStore.state.seperateRenoteQuote) { - os.api('notes/create', { - renoteId: props.note.id, - visibility: props.note.visibility, - }); - const el = ev && (ev.currentTarget ?? ev.target) as HTMLElement | null | undefined; - if (el) { - const rect = el.getBoundingClientRect(); - const x = rect.left + (el.offsetWidth / 2); - const y = rect.top + (el.offsetHeight / 2); - os.popup(Ripple, { x, y }, {}, 'end'); - } - } else { - os.popupMenu([{ - text: i18n.ts.renote, - icon: 'ph-repeat-bold ph-lg', + let buttonActions = [{ + text: i18n.ts.renote, + icon: 'ph-repeat-bold ph-lg', + action: () => { + os.api('notes/create', { + renoteId: props.note.id, + visibility: props.note.visibility, + }); + const el = ev && (ev.currentTarget ?? ev.target) as HTMLElement | null | undefined; + if (el) { + const rect = el.getBoundingClientRect(); + const x = rect.left + (el.offsetWidth / 2); + const y = rect.top + (el.offsetHeight / 2); + os.popup(Ripple, { x, y }, {}, 'end'); + } + }, + }]; + let users; + os.api('notes/renotes', { + noteId: props.note.id, + limit: 11, + }).then((renotes) => { + users = renotes.map(x => x.user); + }); + const hasRenotedBefore = users.includes($i); + + if (hasRenotedBefore) { + buttonActions.push({ + text: i18n.ts.unrenote, + icon: 'ph-eraser-bold ph-lg', action: () => { - os.api('notes/create', { - renoteId: props.note.id, - visibility: props.note.visibility, + os.api('notes/unrenote', { + noteId: props.note.id, }); }, - }, { + }); + } + if (!defaultStore.state.seperateRenoteQuote) { + buttonActions.push({ text: i18n.ts.quote, icon: 'ph-quotes-bold ph-lg', action: () => { @@ -85,10 +101,9 @@ const renote = (viaKeyboard = false, ev?: MouseEvent) => { renote: props.note, }); }, - }], buttonRef.value, { - viaKeyboard, }); } + os.popupMenu(buttonActions, buttonRef.value, { viaKeyboard }); }; From e649a465ed28e65b33211191d093970ab3fe043a Mon Sep 17 00:00:00 2001 From: thatonecalculator Date: Thu, 1 Dec 2022 23:13:08 -0800 Subject: [PATCH 12/18] Release candidate 8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2651c05f5c..53e6b1abd9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "12.119.0-calc.18-rc.7", + "version": "12.119.0-calc.18-rc.8", "codename": "aqua", "repository": { "type": "git", From 25fa34d97c588726c18bcefdfbd09188ab5fb1ce Mon Sep 17 00:00:00 2001 From: thatonecalculator Date: Thu, 1 Dec 2022 23:19:37 -0800 Subject: [PATCH 13/18] fix --- package.json | 2 +- packages/client/src/components/MkRenoteButton.vue | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 53e6b1abd9..a4923241d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "12.119.0-calc.18-rc.8", + "version": "12.119.0-calc.18-rc.9", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/components/MkRenoteButton.vue b/packages/client/src/components/MkRenoteButton.vue index 7550c4ab02..cee5687720 100644 --- a/packages/client/src/components/MkRenoteButton.vue +++ b/packages/client/src/components/MkRenoteButton.vue @@ -53,7 +53,7 @@ useTooltip(buttonRef, async (showing) => { }, {}, 'closed'); }); -const renote = (viaKeyboard = false, ev?: MouseEvent) => { +const renote = async (viaKeyboard = false, ev?: MouseEvent) => { pleaseLogin(); let buttonActions = [{ text: i18n.ts.renote, @@ -72,13 +72,12 @@ const renote = (viaKeyboard = false, ev?: MouseEvent) => { } }, }]; - let users; - os.api('notes/renotes', { + const renotes = await os.api('notes/renotes', { noteId: props.note.id, limit: 11, - }).then((renotes) => { - users = renotes.map(x => x.user); }); + + const users = renotes.map(x => x.user); const hasRenotedBefore = users.includes($i); if (hasRenotedBefore) { From c965188ea700e15e66c2c37bfce269b138db404f Mon Sep 17 00:00:00 2001 From: thatonecalculator Date: Thu, 1 Dec 2022 23:22:43 -0800 Subject: [PATCH 14/18] fix --- package.json | 2 +- packages/client/src/components/MkRenoteButton.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a4923241d3..4d0963fc3f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "12.119.0-calc.18-rc.9", + "version": "12.119.0-calc.18-rc.10", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/components/MkRenoteButton.vue b/packages/client/src/components/MkRenoteButton.vue index cee5687720..39dce49488 100644 --- a/packages/client/src/components/MkRenoteButton.vue +++ b/packages/client/src/components/MkRenoteButton.vue @@ -77,8 +77,8 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => { limit: 11, }); - const users = renotes.map(x => x.user); - const hasRenotedBefore = users.includes($i); + const users = renotes.map(x => x.user.id); + const hasRenotedBefore = users.includes($i.id); if (hasRenotedBefore) { buttonActions.push({ From 69d828332b6831c0a97b202c9717804d1e5888c4 Mon Sep 17 00:00:00 2001 From: thatonecalculator Date: Thu, 1 Dec 2022 23:28:16 -0800 Subject: [PATCH 15/18] Consistent styling --- package.json | 2 +- packages/client/src/components/MkRenoteButton.vue | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4d0963fc3f..d732f2f79f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "12.119.0-calc.18-rc.10", + "version": "12.119.0-calc.18-rc.11", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/components/MkRenoteButton.vue b/packages/client/src/components/MkRenoteButton.vue index 39dce49488..3b7cc7a025 100644 --- a/packages/client/src/components/MkRenoteButton.vue +++ b/packages/client/src/components/MkRenoteButton.vue @@ -58,6 +58,7 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => { let buttonActions = [{ text: i18n.ts.renote, icon: 'ph-repeat-bold ph-lg', + danger: false, action: () => { os.api('notes/create', { renoteId: props.note.id, @@ -83,7 +84,8 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => { if (hasRenotedBefore) { buttonActions.push({ text: i18n.ts.unrenote, - icon: 'ph-eraser-bold ph-lg', + icon: 'ph-trash-bold ph-lg', + danger: true, action: () => { os.api('notes/unrenote', { noteId: props.note.id, @@ -95,6 +97,7 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => { buttonActions.push({ text: i18n.ts.quote, icon: 'ph-quotes-bold ph-lg', + danger: false, action: () => { os.post({ renote: props.note, From ea6c1ebee202c9065805540394aaeaab1cb41527 Mon Sep 17 00:00:00 2001 From: thatonecalculator Date: Thu, 1 Dec 2022 23:37:25 -0800 Subject: [PATCH 16/18] take back button after quote button if combined --- .../client/src/components/MkRenoteButton.vue | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/packages/client/src/components/MkRenoteButton.vue b/packages/client/src/components/MkRenoteButton.vue index 3b7cc7a025..ffba924f95 100644 --- a/packages/client/src/components/MkRenoteButton.vue +++ b/packages/client/src/components/MkRenoteButton.vue @@ -55,6 +55,15 @@ useTooltip(buttonRef, async (showing) => { const renote = async (viaKeyboard = false, ev?: MouseEvent) => { pleaseLogin(); + + const renotes = await os.api('notes/renotes', { + noteId: props.note.id, + limit: 11, + }); + + const users = renotes.map(x => x.user.id); + const hasRenotedBefore = users.includes($i.id); + let buttonActions = [{ text: i18n.ts.renote, icon: 'ph-repeat-bold ph-lg', @@ -73,26 +82,7 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => { } }, }]; - const renotes = await os.api('notes/renotes', { - noteId: props.note.id, - limit: 11, - }); - const users = renotes.map(x => x.user.id); - const hasRenotedBefore = users.includes($i.id); - - if (hasRenotedBefore) { - buttonActions.push({ - text: i18n.ts.unrenote, - icon: 'ph-trash-bold ph-lg', - danger: true, - action: () => { - os.api('notes/unrenote', { - noteId: props.note.id, - }); - }, - }); - } if (!defaultStore.state.seperateRenoteQuote) { buttonActions.push({ text: i18n.ts.quote, @@ -105,6 +95,19 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => { }, }); } + + if (hasRenotedBefore) { + buttonActions.push({ + text: i18n.ts.unrenote, + icon: 'ph-trash-bold ph-lg', + danger: true, + action: () => { + os.api('notes/unrenote', { + noteId: props.note.id, + }); + }, + }); + } os.popupMenu(buttonActions, buttonRef.value, { viaKeyboard }); }; From 36785ee87c1b8a16237fcc2504ce379acf0dc3a2 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Fri, 2 Dec 2022 20:46:56 +0000 Subject: [PATCH 17/18] Add more patrons! --- patrons.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patrons.json b/patrons.json index 65306d72f8..6d6af60415 100644 --- a/patrons.json +++ b/patrons.json @@ -4,6 +4,8 @@ "@shoq@newsroom.social", "@pikadude@erisly.social", "@sage@stop.voring.me", - "@sky@therian.club" + "@sky@therian.club", + "@panos@electricrequiem.com", + "@redhunt07@www.foxyhole.io", ] } From e6ebae074c9629b3406e6b87c010126990c441a9 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Fri, 2 Dec 2022 20:48:19 +0000 Subject: [PATCH 18/18] Trailing comma --- patrons.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patrons.json b/patrons.json index 6d6af60415..194c0e98c3 100644 --- a/patrons.json +++ b/patrons.json @@ -6,6 +6,6 @@ "@sage@stop.voring.me", "@sky@therian.club", "@panos@electricrequiem.com", - "@redhunt07@www.foxyhole.io", + "@redhunt07@www.foxyhole.io" ] }