Merge branch 'develop' into enh-14786
This commit is contained in:
commit
e1c80bafc5
13
CHANGELOG.md
13
CHANGELOG.md
|
@ -1,13 +1,18 @@
|
||||||
## Unreleased
|
## 2024.10.2
|
||||||
|
|
||||||
### General
|
### General
|
||||||
- Feat: コンテンツの表示にログインを必須にできるように
|
- Feat: コンテンツの表示にログインを必須にできるように
|
||||||
|
- Feat: 過去のノートを非公開化/フォロワーのみ表示可能にできるように
|
||||||
|
|
||||||
### Client
|
### Client
|
||||||
- Enhance: Bull DashboardでRelationship Queueの状態も確認できるように
|
- Enhance: Bull DashboardでRelationship Queueの状態も確認できるように
|
||||||
(Cherry-picked from https://github.com/MisskeyIO/misskey/pull/751)
|
(Cherry-picked from https://github.com/MisskeyIO/misskey/pull/751)
|
||||||
- Enhance: ドライブでソートができるように
|
- Enhance: ドライブでソートができるように
|
||||||
|
- Enhance: 「単なるラッキー」の取得条件を変更
|
||||||
- Enhance: 投稿フォームでEscキーを押したときIME入力中ならフォームを閉じないように( #10866 )
|
- Enhance: 投稿フォームでEscキーを押したときIME入力中ならフォームを閉じないように( #10866 )
|
||||||
|
- Enhance: MiAuth, OAuthの認可画面の改善
|
||||||
|
- どのアカウントで認証しようとしているのかがわかるように
|
||||||
|
- 認証するアカウントを切り替えられるように
|
||||||
- Enhance: 時刻表示を常に絶対時刻(年/月/日 時:分:秒)にできるように
|
- Enhance: 時刻表示を常に絶対時刻(年/月/日 時:分:秒)にできるように
|
||||||
- Fix: 通知の範囲指定の設定項目が必要ない通知設定でも範囲指定の設定がでている問題を修正
|
- Fix: 通知の範囲指定の設定項目が必要ない通知設定でも範囲指定の設定がでている問題を修正
|
||||||
- Fix: Turnstileが失敗・期限切れした際にも成功扱いとなってしまう問題を修正
|
- Fix: Turnstileが失敗・期限切れした際にも成功扱いとなってしまう問題を修正
|
||||||
|
@ -15,8 +20,8 @@
|
||||||
- Fix: デッキのタイムラインカラムで「センシティブなファイルを含むノートを表示」設定が使用できなかった問題を修正
|
- Fix: デッキのタイムラインカラムで「センシティブなファイルを含むノートを表示」設定が使用できなかった問題を修正
|
||||||
|
|
||||||
### Server
|
### Server
|
||||||
-
|
- Fix: Nested proxy requestsを検出した際にブロックするように
|
||||||
|
[ghsa-gq5q-c77c-v236](https://github.com/misskey-dev/misskey/security/advisories/ghsa-gq5q-c77c-v236)
|
||||||
|
|
||||||
## 2024.10.1
|
## 2024.10.1
|
||||||
|
|
||||||
|
|
|
@ -3806,6 +3806,18 @@ export interface Locale extends ILocale {
|
||||||
* 1ヶ月
|
* 1ヶ月
|
||||||
*/
|
*/
|
||||||
"oneMonth": string;
|
"oneMonth": string;
|
||||||
|
/**
|
||||||
|
* 3ヶ月
|
||||||
|
*/
|
||||||
|
"threeMonths": string;
|
||||||
|
/**
|
||||||
|
* 1年
|
||||||
|
*/
|
||||||
|
"oneYear": string;
|
||||||
|
/**
|
||||||
|
* 3日
|
||||||
|
*/
|
||||||
|
"threeDays": string;
|
||||||
/**
|
/**
|
||||||
* 反映されるまで時間がかかる場合があります。
|
* 反映されるまで時間がかかる場合があります。
|
||||||
*/
|
*/
|
||||||
|
@ -5198,6 +5210,10 @@ export interface Locale extends ILocale {
|
||||||
* ロックダウン
|
* ロックダウン
|
||||||
*/
|
*/
|
||||||
"lockdown": string;
|
"lockdown": string;
|
||||||
|
/**
|
||||||
|
* アカウントを選択してください
|
||||||
|
*/
|
||||||
|
"pleaseSelectAccount": string;
|
||||||
/**
|
/**
|
||||||
* 常に絶対時刻で表示する
|
* 常に絶対時刻で表示する
|
||||||
*/
|
*/
|
||||||
|
@ -5208,7 +5224,7 @@ export interface Locale extends ILocale {
|
||||||
*/
|
*/
|
||||||
"requireSigninToViewContents": string;
|
"requireSigninToViewContents": string;
|
||||||
/**
|
/**
|
||||||
* あなたが作成した全てのノートなどのコンテンツを表示するのにログインを必須にします。クローラーから情報を収集されるのを防ぐ効果が期待できます。
|
* あなたが作成した全てのノートなどのコンテンツを表示するのにログインを必須にします。クローラーに情報が収集されるのを防ぐ効果が期待できます。
|
||||||
*/
|
*/
|
||||||
"requireSigninToViewContentsDescription1": string;
|
"requireSigninToViewContentsDescription1": string;
|
||||||
/**
|
/**
|
||||||
|
@ -5219,6 +5235,34 @@ export interface Locale extends ILocale {
|
||||||
* リモートサーバーに連合されたコンテンツでは、これらの制限が適用されない場合があります。
|
* リモートサーバーに連合されたコンテンツでは、これらの制限が適用されない場合があります。
|
||||||
*/
|
*/
|
||||||
"requireSigninToViewContentsDescription3": string;
|
"requireSigninToViewContentsDescription3": string;
|
||||||
|
/**
|
||||||
|
* 過去のノートをフォロワーのみ表示可能にする
|
||||||
|
*/
|
||||||
|
"makeNotesFollowersOnlyBefore": string;
|
||||||
|
/**
|
||||||
|
* この機能が有効になっている間、設定された日時より過去、または設定された時間を経過しているノートがフォロワーのみ表示可能になります。無効に戻すと、ノートの公開状態も元に戻ります。
|
||||||
|
*/
|
||||||
|
"makeNotesFollowersOnlyBeforeDescription": string;
|
||||||
|
/**
|
||||||
|
* 過去のノートを非公開化する
|
||||||
|
*/
|
||||||
|
"makeNotesHiddenBefore": string;
|
||||||
|
/**
|
||||||
|
* この機能が有効になっている間、設定された日時より過去、または設定された時間を経過しているノートが自分のみ表示可能(非公開化)になります。無効に戻すと、ノートの公開状態も元に戻ります。
|
||||||
|
*/
|
||||||
|
"makeNotesHiddenBeforeDescription": string;
|
||||||
|
/**
|
||||||
|
* リモートサーバーに連合されたノートには効果が及ばない場合があります。
|
||||||
|
*/
|
||||||
|
"mayNotEffectForFederatedNotes": string;
|
||||||
|
/**
|
||||||
|
* 指定した時間を経過しているノート
|
||||||
|
*/
|
||||||
|
"notesHavePassedSpecifiedPeriod": string;
|
||||||
|
/**
|
||||||
|
* 指定した日時より前のノート
|
||||||
|
*/
|
||||||
|
"notesOlderThanSpecifiedDateAndTime": string;
|
||||||
};
|
};
|
||||||
"_abuseUserReport": {
|
"_abuseUserReport": {
|
||||||
/**
|
/**
|
||||||
|
@ -8412,14 +8456,26 @@ export interface Locale extends ILocale {
|
||||||
* アプリケーションに戻っています
|
* アプリケーションに戻っています
|
||||||
*/
|
*/
|
||||||
"callback": string;
|
"callback": string;
|
||||||
|
/**
|
||||||
|
* アクセスを許可しました
|
||||||
|
*/
|
||||||
|
"accepted": string;
|
||||||
/**
|
/**
|
||||||
* アクセスを拒否しました
|
* アクセスを拒否しました
|
||||||
*/
|
*/
|
||||||
"denied": string;
|
"denied": string;
|
||||||
|
/**
|
||||||
|
* 以下のユーザーとして操作しています
|
||||||
|
*/
|
||||||
|
"scopeUser": string;
|
||||||
/**
|
/**
|
||||||
* アプリケーションにアクセス許可を与えるには、ログインが必要です。
|
* アプリケーションにアクセス許可を与えるには、ログインが必要です。
|
||||||
*/
|
*/
|
||||||
"pleaseLogin": string;
|
"pleaseLogin": string;
|
||||||
|
/**
|
||||||
|
* アクセスを許可すると、自動で以下のURLに遷移します
|
||||||
|
*/
|
||||||
|
"byClickingYouWillBeRedirectedToThisUrl": string;
|
||||||
};
|
};
|
||||||
"_antennaSources": {
|
"_antennaSources": {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -947,6 +947,9 @@ oneHour: "1時間"
|
||||||
oneDay: "1日"
|
oneDay: "1日"
|
||||||
oneWeek: "1週間"
|
oneWeek: "1週間"
|
||||||
oneMonth: "1ヶ月"
|
oneMonth: "1ヶ月"
|
||||||
|
threeMonths: "3ヶ月"
|
||||||
|
oneYear: "1年"
|
||||||
|
threeDays: "3日"
|
||||||
reflectMayTakeTime: "反映されるまで時間がかかる場合があります。"
|
reflectMayTakeTime: "反映されるまで時間がかかる場合があります。"
|
||||||
failedToFetchAccountInformation: "アカウント情報の取得に失敗しました"
|
failedToFetchAccountInformation: "アカウント情報の取得に失敗しました"
|
||||||
rateLimitExceeded: "レート制限を超えました"
|
rateLimitExceeded: "レート制限を超えました"
|
||||||
|
@ -1295,13 +1298,21 @@ yourNameContainsProhibitedWords: "変更しようとした名前に禁止され
|
||||||
yourNameContainsProhibitedWordsDescription: "名前に禁止されている文字列が含まれています。この名前を使用したい場合は、サーバー管理者にお問い合わせください。"
|
yourNameContainsProhibitedWordsDescription: "名前に禁止されている文字列が含まれています。この名前を使用したい場合は、サーバー管理者にお問い合わせください。"
|
||||||
thisContentsAreMarkedAsSigninRequiredByAuthor: "投稿者により、表示にはログインが必要と設定されています"
|
thisContentsAreMarkedAsSigninRequiredByAuthor: "投稿者により、表示にはログインが必要と設定されています"
|
||||||
lockdown: "ロックダウン"
|
lockdown: "ロックダウン"
|
||||||
|
pleaseSelectAccount: "アカウントを選択してください"
|
||||||
alwaysUseAbsoluteTime: "常に絶対時刻で表示する"
|
alwaysUseAbsoluteTime: "常に絶対時刻で表示する"
|
||||||
|
|
||||||
_accountSettings:
|
_accountSettings:
|
||||||
requireSigninToViewContents: "コンテンツの表示にログインを必須にする"
|
requireSigninToViewContents: "コンテンツの表示にログインを必須にする"
|
||||||
requireSigninToViewContentsDescription1: "あなたが作成した全てのノートなどのコンテンツを表示するのにログインを必須にします。クローラーから情報を収集されるのを防ぐ効果が期待できます。"
|
requireSigninToViewContentsDescription1: "あなたが作成した全てのノートなどのコンテンツを表示するのにログインを必須にします。クローラーに情報が収集されるのを防ぐ効果が期待できます。"
|
||||||
requireSigninToViewContentsDescription2: "URLプレビュー(OGP)、Webページへの埋め込み、ノートの引用に対応していないサーバーからの表示も不可になります。"
|
requireSigninToViewContentsDescription2: "URLプレビュー(OGP)、Webページへの埋め込み、ノートの引用に対応していないサーバーからの表示も不可になります。"
|
||||||
requireSigninToViewContentsDescription3: "リモートサーバーに連合されたコンテンツでは、これらの制限が適用されない場合があります。"
|
requireSigninToViewContentsDescription3: "リモートサーバーに連合されたコンテンツでは、これらの制限が適用されない場合があります。"
|
||||||
|
makeNotesFollowersOnlyBefore: "過去のノートをフォロワーのみ表示可能にする"
|
||||||
|
makeNotesFollowersOnlyBeforeDescription: "この機能が有効になっている間、設定された日時より過去、または設定された時間を経過しているノートがフォロワーのみ表示可能になります。無効に戻すと、ノートの公開状態も元に戻ります。"
|
||||||
|
makeNotesHiddenBefore: "過去のノートを非公開化する"
|
||||||
|
makeNotesHiddenBeforeDescription: "この機能が有効になっている間、設定された日時より過去、または設定された時間を経過しているノートが自分のみ表示可能(非公開化)になります。無効に戻すと、ノートの公開状態も元に戻ります。"
|
||||||
|
mayNotEffectForFederatedNotes: "リモートサーバーに連合されたノートには効果が及ばない場合があります。"
|
||||||
|
notesHavePassedSpecifiedPeriod: "指定した時間を経過しているノート"
|
||||||
|
notesOlderThanSpecifiedDateAndTime: "指定した日時より前のノート"
|
||||||
|
|
||||||
_abuseUserReport:
|
_abuseUserReport:
|
||||||
forward: "転送"
|
forward: "転送"
|
||||||
|
@ -2208,8 +2219,11 @@ _auth:
|
||||||
permissionAsk: "このアプリは次の権限を要求しています"
|
permissionAsk: "このアプリは次の権限を要求しています"
|
||||||
pleaseGoBack: "アプリケーションに戻ってやっていってください"
|
pleaseGoBack: "アプリケーションに戻ってやっていってください"
|
||||||
callback: "アプリケーションに戻っています"
|
callback: "アプリケーションに戻っています"
|
||||||
|
accepted: "アクセスを許可しました"
|
||||||
denied: "アクセスを拒否しました"
|
denied: "アクセスを拒否しました"
|
||||||
|
scopeUser: "以下のユーザーとして操作しています"
|
||||||
pleaseLogin: "アプリケーションにアクセス許可を与えるには、ログインが必要です。"
|
pleaseLogin: "アプリケーションにアクセス許可を与えるには、ログインが必要です。"
|
||||||
|
byClickingYouWillBeRedirectedToThisUrl: "アクセスを許可すると、自動で以下のURLに遷移します"
|
||||||
|
|
||||||
_antennaSources:
|
_antennaSources:
|
||||||
all: "全てのノート"
|
all: "全てのノート"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "misskey",
|
"name": "misskey",
|
||||||
"version": "2024.10.1",
|
"version": "2024.10.2-alpha.0",
|
||||||
"codename": "nasubi",
|
"codename": "nasubi",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
export class MakeNotesHiddenBefore1729486255072 {
|
||||||
|
name = 'MakeNotesHiddenBefore1729486255072'
|
||||||
|
|
||||||
|
async up(queryRunner) {
|
||||||
|
await queryRunner.query(`ALTER TABLE "user" ADD "makeNotesFollowersOnlyBefore" integer`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "user" ADD "makeNotesHiddenBefore" integer`);
|
||||||
|
}
|
||||||
|
|
||||||
|
async down(queryRunner) {
|
||||||
|
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "makeNotesHiddenBefore"`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "makeNotesFollowersOnlyBefore"`);
|
||||||
|
}
|
||||||
|
}
|
|
@ -84,6 +84,8 @@ function generateDummyUser(override?: Partial<MiUser>): MiUser {
|
||||||
isHibernated: false,
|
isHibernated: false,
|
||||||
isDeleted: false,
|
isDeleted: false,
|
||||||
requireSigninToViewContents: false,
|
requireSigninToViewContents: false,
|
||||||
|
makeNotesFollowersOnlyBefore: null,
|
||||||
|
makeNotesHiddenBefore: null,
|
||||||
emojis: [],
|
emojis: [],
|
||||||
score: 0,
|
score: 0,
|
||||||
host: null,
|
host: null,
|
||||||
|
|
|
@ -496,6 +496,8 @@ export class ApRendererService {
|
||||||
_misskey_summary: profile.description,
|
_misskey_summary: profile.description,
|
||||||
_misskey_followedMessage: profile.followedMessage,
|
_misskey_followedMessage: profile.followedMessage,
|
||||||
_misskey_requireSigninToViewContents: user.requireSigninToViewContents,
|
_misskey_requireSigninToViewContents: user.requireSigninToViewContents,
|
||||||
|
_misskey_makeNotesFollowersOnlyBefore: user.makeNotesFollowersOnlyBefore,
|
||||||
|
_misskey_makeNotesHiddenBefore: user.makeNotesHiddenBefore,
|
||||||
icon: avatar ? this.renderImage(avatar) : null,
|
icon: avatar ? this.renderImage(avatar) : null,
|
||||||
image: banner ? this.renderImage(banner) : null,
|
image: banner ? this.renderImage(banner) : null,
|
||||||
tag,
|
tag,
|
||||||
|
|
|
@ -556,6 +556,8 @@ const extension_context_definition = {
|
||||||
'_misskey_summary': 'misskey:_misskey_summary',
|
'_misskey_summary': 'misskey:_misskey_summary',
|
||||||
'_misskey_followedMessage': 'misskey:_misskey_followedMessage',
|
'_misskey_followedMessage': 'misskey:_misskey_followedMessage',
|
||||||
'_misskey_requireSigninToViewContents': 'misskey:_misskey_requireSigninToViewContents',
|
'_misskey_requireSigninToViewContents': 'misskey:_misskey_requireSigninToViewContents',
|
||||||
|
'_misskey_makeNotesFollowersOnlyBefore': 'misskey:_misskey_makeNotesFollowersOnlyBefore',
|
||||||
|
'_misskey_makeNotesHiddenBefore': 'misskey:_misskey_makeNotesHiddenBefore',
|
||||||
'isCat': 'misskey:isCat',
|
'isCat': 'misskey:isCat',
|
||||||
// vcard
|
// vcard
|
||||||
vcard: 'http://www.w3.org/2006/vcard/ns#',
|
vcard: 'http://www.w3.org/2006/vcard/ns#',
|
||||||
|
|
|
@ -357,6 +357,8 @@ export class ApPersonService implements OnModuleInit {
|
||||||
isBot,
|
isBot,
|
||||||
isCat: (person as any).isCat === true,
|
isCat: (person as any).isCat === true,
|
||||||
requireSigninToViewContents: (person as any).requireSigninToViewContents === true,
|
requireSigninToViewContents: (person as any).requireSigninToViewContents === true,
|
||||||
|
makeNotesFollowersOnlyBefore: (person as any).makeNotesFollowersOnlyBefore ?? null,
|
||||||
|
makeNotesHiddenBefore: (person as any).makeNotesHiddenBefore ?? null,
|
||||||
emojis,
|
emojis,
|
||||||
})) as MiRemoteUser;
|
})) as MiRemoteUser;
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,8 @@ export interface IObject {
|
||||||
_misskey_summary?: string;
|
_misskey_summary?: string;
|
||||||
_misskey_followedMessage?: string | null;
|
_misskey_followedMessage?: string | null;
|
||||||
_misskey_requireSigninToViewContents?: boolean;
|
_misskey_requireSigninToViewContents?: boolean;
|
||||||
|
_misskey_makeNotesFollowersOnlyBefore?: number | null;
|
||||||
|
_misskey_makeNotesHiddenBefore?: number | null;
|
||||||
published?: string;
|
published?: string;
|
||||||
cc?: ApObject;
|
cc?: ApObject;
|
||||||
to?: ApObject;
|
to?: ApObject;
|
||||||
|
|
|
@ -102,57 +102,83 @@ export class NoteEntityService implements OnModuleInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
private async hideNote(packedNote: Packed<'Note'>, meId: MiUser['id'] | null) {
|
private async hideNote(packedNote: Packed<'Note'>, meId: MiUser['id'] | null): Promise<void> {
|
||||||
|
// FIXME: このvisibility変更処理が当関数にあるのは若干不自然かもしれない(関数名を treatVisibility とかに変える手もある)
|
||||||
|
if (packedNote.visibility === 'public' || packedNote.visibility === 'home') {
|
||||||
|
const followersOnlyBefore = packedNote.user.makeNotesFollowersOnlyBefore;
|
||||||
|
if ((followersOnlyBefore != null)
|
||||||
|
&& (
|
||||||
|
(followersOnlyBefore <= 0 && (Date.now() - new Date(packedNote.createdAt).getTime() > 0 - (followersOnlyBefore * 1000)))
|
||||||
|
|| (followersOnlyBefore > 0 && (new Date(packedNote.createdAt).getTime() < followersOnlyBefore * 1000))
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
packedNote.visibility = 'followers';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (meId === packedNote.userId) return;
|
||||||
|
|
||||||
// TODO: isVisibleForMe を使うようにしても良さそう(型違うけど)
|
// TODO: isVisibleForMe を使うようにしても良さそう(型違うけど)
|
||||||
let hide = false;
|
let hide = false;
|
||||||
|
|
||||||
// visibility が specified かつ自分が指定されていなかったら非表示
|
if (packedNote.user.requireSigninToViewContents && meId == null) {
|
||||||
if (packedNote.visibility === 'specified') {
|
hide = true;
|
||||||
if (meId == null) {
|
}
|
||||||
hide = true;
|
|
||||||
} else if (meId === packedNote.userId) {
|
|
||||||
hide = false;
|
|
||||||
} else {
|
|
||||||
// 指定されているかどうか
|
|
||||||
const specified = packedNote.visibleUserIds!.some(id => meId === id);
|
|
||||||
|
|
||||||
if (specified) {
|
if (!hide) {
|
||||||
hide = false;
|
const hiddenBefore = packedNote.user.makeNotesHiddenBefore;
|
||||||
} else {
|
if ((hiddenBefore != null)
|
||||||
|
&& (
|
||||||
|
(hiddenBefore <= 0 && (Date.now() - new Date(packedNote.createdAt).getTime() > 0 - (hiddenBefore * 1000)))
|
||||||
|
|| (hiddenBefore > 0 && (new Date(packedNote.createdAt).getTime() < hiddenBefore * 1000))
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
hide = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// visibility が specified かつ自分が指定されていなかったら非表示
|
||||||
|
if (!hide) {
|
||||||
|
if (packedNote.visibility === 'specified') {
|
||||||
|
if (meId == null) {
|
||||||
hide = true;
|
hide = true;
|
||||||
|
} else {
|
||||||
|
// 指定されているかどうか
|
||||||
|
const specified = packedNote.visibleUserIds!.some(id => meId === id);
|
||||||
|
|
||||||
|
if (!specified) {
|
||||||
|
hide = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// visibility が followers かつ自分が投稿者のフォロワーでなかったら非表示
|
// visibility が followers かつ自分が投稿者のフォロワーでなかったら非表示
|
||||||
if (packedNote.visibility === 'followers') {
|
if (!hide) {
|
||||||
if (meId == null) {
|
if (packedNote.visibility === 'followers') {
|
||||||
hide = true;
|
if (meId == null) {
|
||||||
} else if (meId === packedNote.userId) {
|
hide = true;
|
||||||
hide = false;
|
} else if (packedNote.reply && (meId === packedNote.reply.userId)) {
|
||||||
} else if (packedNote.reply && (meId === packedNote.reply.userId)) {
|
// 自分の投稿に対するリプライ
|
||||||
// 自分の投稿に対するリプライ
|
hide = false;
|
||||||
hide = false;
|
} else if (packedNote.mentions && packedNote.mentions.some(id => meId === id)) {
|
||||||
} else if (packedNote.mentions && packedNote.mentions.some(id => meId === id)) {
|
// 自分へのメンション
|
||||||
// 自分へのメンション
|
hide = false;
|
||||||
hide = false;
|
} else {
|
||||||
} else {
|
// フォロワーかどうか
|
||||||
// フォロワーかどうか
|
// TODO: 当関数呼び出しごとにクエリが走るのは重そうだからなんとかする
|
||||||
const isFollowing = await this.followingsRepository.exists({
|
const isFollowing = await this.followingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
followeeId: packedNote.userId,
|
followeeId: packedNote.userId,
|
||||||
followerId: meId,
|
followerId: meId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
hide = !isFollowing;
|
hide = !isFollowing;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packedNote.user.requireSigninToViewContents && meId == null) {
|
|
||||||
hide = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hide) {
|
if (hide) {
|
||||||
packedNote.visibleUserIds = undefined;
|
packedNote.visibleUserIds = undefined;
|
||||||
packedNote.fileIds = [];
|
packedNote.fileIds = [];
|
||||||
|
@ -161,6 +187,7 @@ export class NoteEntityService implements OnModuleInit {
|
||||||
packedNote.poll = undefined;
|
packedNote.poll = undefined;
|
||||||
packedNote.cw = null;
|
packedNote.cw = null;
|
||||||
packedNote.isHidden = true;
|
packedNote.isHidden = true;
|
||||||
|
// TODO: hiddenReason みたいなのを提供しても良さそう
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -491,6 +491,8 @@ export class UserEntityService implements OnModuleInit {
|
||||||
isBot: user.isBot,
|
isBot: user.isBot,
|
||||||
isCat: user.isCat,
|
isCat: user.isCat,
|
||||||
requireSigninToViewContents: user.requireSigninToViewContents === false ? undefined : true,
|
requireSigninToViewContents: user.requireSigninToViewContents === false ? undefined : true,
|
||||||
|
makeNotesFollowersOnlyBefore: user.makeNotesFollowersOnlyBefore ?? undefined,
|
||||||
|
makeNotesHiddenBefore: user.makeNotesHiddenBefore ?? undefined,
|
||||||
instance: user.host ? this.federatedInstanceService.federatedInstanceCache.fetch(user.host).then(instance => instance ? {
|
instance: user.host ? this.federatedInstanceService.federatedInstanceCache.fetch(user.host).then(instance => instance ? {
|
||||||
name: instance.name,
|
name: instance.name,
|
||||||
softwareName: instance.softwareName,
|
softwareName: instance.softwareName,
|
||||||
|
|
|
@ -207,6 +207,18 @@ export class MiUser {
|
||||||
})
|
})
|
||||||
public requireSigninToViewContents: boolean;
|
public requireSigninToViewContents: boolean;
|
||||||
|
|
||||||
|
// in sec, マイナスで相対時間
|
||||||
|
@Column('integer', {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
public makeNotesFollowersOnlyBefore: number | null;
|
||||||
|
|
||||||
|
// in sec, マイナスで相対時間
|
||||||
|
@Column('integer', {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
public makeNotesHiddenBefore: number | null;
|
||||||
|
|
||||||
// アカウントが削除されたかどうかのフラグだが、完全に削除される際は物理削除なので実質削除されるまでの「削除が進行しているかどうか」のフラグ
|
// アカウントが削除されたかどうかのフラグだが、完全に削除される際は物理削除なので実質削除されるまでの「削除が進行しているかどうか」のフラグ
|
||||||
@Column('boolean', {
|
@Column('boolean', {
|
||||||
default: false,
|
default: false,
|
||||||
|
|
|
@ -119,6 +119,14 @@ export const packedUserLiteSchema = {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: true,
|
nullable: false, optional: true,
|
||||||
},
|
},
|
||||||
|
makeNotesFollowersOnlyBefore: {
|
||||||
|
type: 'number',
|
||||||
|
nullable: true, optional: true,
|
||||||
|
},
|
||||||
|
makeNotesHiddenBefore: {
|
||||||
|
type: 'number',
|
||||||
|
nullable: true, optional: true,
|
||||||
|
},
|
||||||
instance: {
|
instance: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
nullable: false, optional: true,
|
nullable: false, optional: true,
|
||||||
|
|
|
@ -319,6 +319,12 @@ export class FileServerService {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!request.headers['user-agent']) {
|
||||||
|
throw new StatusError('User-Agent is required', 400, 'User-Agent is required');
|
||||||
|
} else if (request.headers['user-agent'].toLowerCase().indexOf('misskey/') !== -1) {
|
||||||
|
throw new StatusError('Refusing to proxy a request from another proxy', 403, 'Proxy is recursive');
|
||||||
|
}
|
||||||
|
|
||||||
// Create temp file
|
// Create temp file
|
||||||
const file = await this.getStreamAndTypeFromUrl(url);
|
const file = await this.getStreamAndTypeFromUrl(url);
|
||||||
if (file === '404') {
|
if (file === '404') {
|
||||||
|
|
|
@ -180,6 +180,8 @@ export const paramDef = {
|
||||||
noCrawle: { type: 'boolean' },
|
noCrawle: { type: 'boolean' },
|
||||||
preventAiLearning: { type: 'boolean' },
|
preventAiLearning: { type: 'boolean' },
|
||||||
requireSigninToViewContents: { type: 'boolean' },
|
requireSigninToViewContents: { type: 'boolean' },
|
||||||
|
makeNotesFollowersOnlyBefore: { type: 'integer', nullable: true },
|
||||||
|
makeNotesHiddenBefore: { type: 'integer', nullable: true },
|
||||||
isBot: { type: 'boolean' },
|
isBot: { type: 'boolean' },
|
||||||
isCat: { type: 'boolean' },
|
isCat: { type: 'boolean' },
|
||||||
injectFeaturedNote: { type: 'boolean' },
|
injectFeaturedNote: { type: 'boolean' },
|
||||||
|
@ -336,6 +338,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
if (typeof ps.noCrawle === 'boolean') profileUpdates.noCrawle = ps.noCrawle;
|
if (typeof ps.noCrawle === 'boolean') profileUpdates.noCrawle = ps.noCrawle;
|
||||||
if (typeof ps.preventAiLearning === 'boolean') profileUpdates.preventAiLearning = ps.preventAiLearning;
|
if (typeof ps.preventAiLearning === 'boolean') profileUpdates.preventAiLearning = ps.preventAiLearning;
|
||||||
if (typeof ps.requireSigninToViewContents === 'boolean') updates.requireSigninToViewContents = ps.requireSigninToViewContents;
|
if (typeof ps.requireSigninToViewContents === 'boolean') updates.requireSigninToViewContents = ps.requireSigninToViewContents;
|
||||||
|
if ((typeof ps.makeNotesFollowersOnlyBefore === 'number') || (ps.makeNotesFollowersOnlyBefore === null)) updates.makeNotesFollowersOnlyBefore = ps.makeNotesFollowersOnlyBefore;
|
||||||
|
if ((typeof ps.makeNotesHiddenBefore === 'number') || (ps.makeNotesHiddenBefore === null)) updates.makeNotesHiddenBefore = ps.makeNotesHiddenBefore;
|
||||||
if (typeof ps.isCat === 'boolean') updates.isCat = ps.isCat;
|
if (typeof ps.isCat === 'boolean') updates.isCat = ps.isCat;
|
||||||
if (typeof ps.injectFeaturedNote === 'boolean') profileUpdates.injectFeaturedNote = ps.injectFeaturedNote;
|
if (typeof ps.injectFeaturedNote === 'boolean') profileUpdates.injectFeaturedNote = ps.injectFeaturedNote;
|
||||||
if (typeof ps.receiveAnnouncementEmail === 'boolean') profileUpdates.receiveAnnouncementEmail = ps.receiveAnnouncementEmail;
|
if (typeof ps.receiveAnnouncementEmail === 'boolean') profileUpdates.receiveAnnouncementEmail = ps.receiveAnnouncementEmail;
|
||||||
|
|
|
@ -12,7 +12,7 @@ import '@/style.scss';
|
||||||
import { mainBoot } from '@/boot/main-boot.js';
|
import { mainBoot } from '@/boot/main-boot.js';
|
||||||
import { subBoot } from '@/boot/sub-boot.js';
|
import { subBoot } from '@/boot/sub-boot.js';
|
||||||
|
|
||||||
const subBootPaths = ['/share', '/auth', '/miauth', '/signup-complete'];
|
const subBootPaths = ['/share', '/auth', '/miauth', '/oauth', '/signup-complete'];
|
||||||
|
|
||||||
if (subBootPaths.some(i => location.pathname === i || location.pathname.startsWith(i + '/'))) {
|
if (subBootPaths.some(i => location.pathname === i || location.pathname.startsWith(i + '/'))) {
|
||||||
subBoot();
|
subBoot();
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
|
|
||||||
import { defineAsyncComponent, reactive, ref } from 'vue';
|
import { defineAsyncComponent, reactive, ref } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
|
import { apiUrl } from '@@/js/config.js';
|
||||||
|
import type { MenuItem, MenuButton } from '@/types/menu.js';
|
||||||
import { showSuspendedDialog } from '@/scripts/show-suspended-dialog.js';
|
import { showSuspendedDialog } from '@/scripts/show-suspended-dialog.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { miLocalStorage } from '@/local-storage.js';
|
import { miLocalStorage } from '@/local-storage.js';
|
||||||
import type { MenuItem, MenuButton } from '@/types/menu.js';
|
|
||||||
import { del, get, set } from '@/scripts/idb-proxy.js';
|
import { del, get, set } from '@/scripts/idb-proxy.js';
|
||||||
import { apiUrl } from '@@/js/config.js';
|
|
||||||
import { waiting, popup, popupMenu, success, alert } from '@/os.js';
|
import { waiting, popup, popupMenu, success, alert } from '@/os.js';
|
||||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { unisonReload, reloadChannel } from '@/scripts/unison-reload.js';
|
import { unisonReload, reloadChannel } from '@/scripts/unison-reload.js';
|
||||||
|
@ -165,7 +165,18 @@ function fetchAccount(token: string, id?: string, forceShowDialog?: boolean): Pr
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateAccount(accountData: Partial<Account>) {
|
export function updateAccount(accountData: Account) {
|
||||||
|
if (!$i) return;
|
||||||
|
for (const key of Object.keys($i)) {
|
||||||
|
delete $i[key];
|
||||||
|
}
|
||||||
|
for (const [key, value] of Object.entries(accountData)) {
|
||||||
|
$i[key] = value;
|
||||||
|
}
|
||||||
|
miLocalStorage.setItem('account', JSON.stringify($i));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateAccountPartial(accountData: Partial<Account>) {
|
||||||
if (!$i) return;
|
if (!$i) return;
|
||||||
for (const [key, value] of Object.entries(accountData)) {
|
for (const [key, value] of Object.entries(accountData)) {
|
||||||
$i[key] = value;
|
$i[key] = value;
|
||||||
|
@ -224,26 +235,6 @@ export async function openAccountMenu(opts: {
|
||||||
}, ev: MouseEvent) {
|
}, ev: MouseEvent) {
|
||||||
if (!$i) return;
|
if (!$i) return;
|
||||||
|
|
||||||
function showSigninDialog() {
|
|
||||||
const { dispose } = popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), {}, {
|
|
||||||
done: (res: Misskey.entities.SigninFlowResponse & { finished: true }) => {
|
|
||||||
addAccount(res.id, res.i);
|
|
||||||
success();
|
|
||||||
},
|
|
||||||
closed: () => dispose(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function createAccount() {
|
|
||||||
const { dispose } = popup(defineAsyncComponent(() => import('@/components/MkSignupDialog.vue')), {}, {
|
|
||||||
done: (res: Misskey.entities.SignupResponse) => {
|
|
||||||
addAccount(res.id, res.token);
|
|
||||||
switchAccountWithToken(res.token);
|
|
||||||
},
|
|
||||||
closed: () => dispose(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function switchAccount(account: Misskey.entities.UserDetailed) {
|
async function switchAccount(account: Misskey.entities.UserDetailed) {
|
||||||
const storedAccounts = await getAccounts();
|
const storedAccounts = await getAccounts();
|
||||||
const found = storedAccounts.find(x => x.id === account.id);
|
const found = storedAccounts.find(x => x.id === account.id);
|
||||||
|
@ -312,10 +303,22 @@ export async function openAccountMenu(opts: {
|
||||||
text: i18n.ts.addAccount,
|
text: i18n.ts.addAccount,
|
||||||
children: [{
|
children: [{
|
||||||
text: i18n.ts.existingAccount,
|
text: i18n.ts.existingAccount,
|
||||||
action: () => { showSigninDialog(); },
|
action: () => {
|
||||||
|
getAccountWithSigninDialog().then(res => {
|
||||||
|
if (res != null) {
|
||||||
|
success();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
}, {
|
}, {
|
||||||
text: i18n.ts.createAccount,
|
text: i18n.ts.createAccount,
|
||||||
action: () => { createAccount(); },
|
action: () => {
|
||||||
|
getAccountWithSignupDialog().then(res => {
|
||||||
|
if (res != null) {
|
||||||
|
switchAccountWithToken(res.token);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
}],
|
}],
|
||||||
}, {
|
}, {
|
||||||
type: 'link',
|
type: 'link',
|
||||||
|
@ -336,6 +339,40 @@ export async function openAccountMenu(opts: {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getAccountWithSigninDialog(): Promise<{ id: string, token: string } | null> {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
const { dispose } = popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), {}, {
|
||||||
|
done: async (res: Misskey.entities.SigninFlowResponse & { finished: true }) => {
|
||||||
|
await addAccount(res.id, res.i);
|
||||||
|
resolve({ id: res.id, token: res.i });
|
||||||
|
},
|
||||||
|
cancelled: () => {
|
||||||
|
resolve(null);
|
||||||
|
},
|
||||||
|
closed: () => {
|
||||||
|
dispose();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getAccountWithSignupDialog(): Promise<{ id: string, token: string } | null> {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
const { dispose } = popup(defineAsyncComponent(() => import('@/components/MkSignupDialog.vue')), {}, {
|
||||||
|
done: async (res: Misskey.entities.SignupResponse) => {
|
||||||
|
await addAccount(res.id, res.token);
|
||||||
|
resolve({ id: res.id, token: res.token });
|
||||||
|
},
|
||||||
|
cancelled: () => {
|
||||||
|
resolve(null);
|
||||||
|
},
|
||||||
|
closed: () => {
|
||||||
|
dispose();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (_DEV_) {
|
if (_DEV_) {
|
||||||
(window as any).$i = $i;
|
(window as any).$i = $i;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { createApp, defineAsyncComponent, markRaw } from 'vue';
|
import { createApp, defineAsyncComponent, markRaw } from 'vue';
|
||||||
|
import { ui } from '@@/js/config.js';
|
||||||
import { common } from './common.js';
|
import { common } from './common.js';
|
||||||
import type * as Misskey from 'misskey-js';
|
import type * as Misskey from 'misskey-js';
|
||||||
import { ui } from '@@/js/config.js';
|
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { alert, confirm, popup, post, toast } from '@/os.js';
|
import { alert, confirm, popup, post, toast } from '@/os.js';
|
||||||
import { useStream } from '@/stream.js';
|
import { useStream } from '@/stream.js';
|
||||||
import * as sound from '@/scripts/sound.js';
|
import * as sound from '@/scripts/sound.js';
|
||||||
import { $i, signout, updateAccount } from '@/account.js';
|
import { $i, signout, updateAccountPartial } from '@/account.js';
|
||||||
import { instance } from '@/instance.js';
|
import { instance } from '@/instance.js';
|
||||||
import { ColdDeviceStorage, defaultStore } from '@/store.js';
|
import { ColdDeviceStorage, defaultStore } from '@/store.js';
|
||||||
import { reactionPicker } from '@/scripts/reaction-picker.js';
|
import { reactionPicker } from '@/scripts/reaction-picker.js';
|
||||||
|
@ -231,11 +231,41 @@ export async function mainBoot() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!claimedAchievements.includes('justPlainLucky')) {
|
if (!claimedAchievements.includes('justPlainLucky')) {
|
||||||
window.setInterval(() => {
|
let justPlainLuckyTimer: number | null = null;
|
||||||
|
let lastVisibilityChangedAt = Date.now();
|
||||||
|
|
||||||
|
function claimPlainLucky() {
|
||||||
|
if (document.visibilityState !== 'visible') {
|
||||||
|
if (justPlainLuckyTimer != null) window.clearTimeout(justPlainLuckyTimer);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (Math.floor(Math.random() * 20000) === 0) {
|
if (Math.floor(Math.random() * 20000) === 0) {
|
||||||
claimAchievement('justPlainLucky');
|
claimAchievement('justPlainLucky');
|
||||||
|
} else {
|
||||||
|
justPlainLuckyTimer = window.setTimeout(claimPlainLucky, 1000 * 10);
|
||||||
}
|
}
|
||||||
}, 1000 * 10);
|
}
|
||||||
|
|
||||||
|
window.addEventListener('visibilitychange', () => {
|
||||||
|
const now = Date.now();
|
||||||
|
|
||||||
|
if (document.visibilityState === 'visible') {
|
||||||
|
// タブを高速で切り替えたら取得処理が何度も走るのを防ぐ
|
||||||
|
if ((now - lastVisibilityChangedAt) < 1000 * 10) {
|
||||||
|
justPlainLuckyTimer = window.setTimeout(claimPlainLucky, 1000 * 10);
|
||||||
|
} else {
|
||||||
|
claimPlainLucky();
|
||||||
|
}
|
||||||
|
} else if (justPlainLuckyTimer != null) {
|
||||||
|
window.clearTimeout(justPlainLuckyTimer);
|
||||||
|
justPlainLuckyTimer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
lastVisibilityChangedAt = now;
|
||||||
|
}, { passive: true });
|
||||||
|
|
||||||
|
claimPlainLucky();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!claimedAchievements.includes('client30min')) {
|
if (!claimedAchievements.includes('client30min')) {
|
||||||
|
@ -291,11 +321,11 @@ export async function mainBoot() {
|
||||||
|
|
||||||
// 自分の情報が更新されたとき
|
// 自分の情報が更新されたとき
|
||||||
main.on('meUpdated', i => {
|
main.on('meUpdated', i => {
|
||||||
updateAccount(i);
|
updateAccountPartial(i);
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('readAllNotifications', () => {
|
main.on('readAllNotifications', () => {
|
||||||
updateAccount({
|
updateAccountPartial({
|
||||||
hasUnreadNotification: false,
|
hasUnreadNotification: false,
|
||||||
unreadNotificationsCount: 0,
|
unreadNotificationsCount: 0,
|
||||||
});
|
});
|
||||||
|
@ -303,39 +333,39 @@ export async function mainBoot() {
|
||||||
|
|
||||||
main.on('unreadNotification', () => {
|
main.on('unreadNotification', () => {
|
||||||
const unreadNotificationsCount = ($i?.unreadNotificationsCount ?? 0) + 1;
|
const unreadNotificationsCount = ($i?.unreadNotificationsCount ?? 0) + 1;
|
||||||
updateAccount({
|
updateAccountPartial({
|
||||||
hasUnreadNotification: true,
|
hasUnreadNotification: true,
|
||||||
unreadNotificationsCount,
|
unreadNotificationsCount,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('unreadMention', () => {
|
main.on('unreadMention', () => {
|
||||||
updateAccount({ hasUnreadMentions: true });
|
updateAccountPartial({ hasUnreadMentions: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('readAllUnreadMentions', () => {
|
main.on('readAllUnreadMentions', () => {
|
||||||
updateAccount({ hasUnreadMentions: false });
|
updateAccountPartial({ hasUnreadMentions: false });
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('unreadSpecifiedNote', () => {
|
main.on('unreadSpecifiedNote', () => {
|
||||||
updateAccount({ hasUnreadSpecifiedNotes: true });
|
updateAccountPartial({ hasUnreadSpecifiedNotes: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('readAllUnreadSpecifiedNotes', () => {
|
main.on('readAllUnreadSpecifiedNotes', () => {
|
||||||
updateAccount({ hasUnreadSpecifiedNotes: false });
|
updateAccountPartial({ hasUnreadSpecifiedNotes: false });
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('readAllAntennas', () => {
|
main.on('readAllAntennas', () => {
|
||||||
updateAccount({ hasUnreadAntenna: false });
|
updateAccountPartial({ hasUnreadAntenna: false });
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('unreadAntenna', () => {
|
main.on('unreadAntenna', () => {
|
||||||
updateAccount({ hasUnreadAntenna: true });
|
updateAccountPartial({ hasUnreadAntenna: true });
|
||||||
sound.playMisskeySfx('antenna');
|
sound.playMisskeySfx('antenna');
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('readAllAnnouncements', () => {
|
main.on('readAllAnnouncements', () => {
|
||||||
updateAccount({ hasUnreadAnnouncement: false });
|
updateAccountPartial({ hasUnreadAnnouncement: false });
|
||||||
});
|
});
|
||||||
|
|
||||||
// 個人宛てお知らせが発行されたとき
|
// 個人宛てお知らせが発行されたとき
|
||||||
|
|
|
@ -29,7 +29,7 @@ import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import MkModal from '@/components/MkModal.vue';
|
import MkModal from '@/components/MkModal.vue';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { $i, updateAccount } from '@/account.js';
|
import { $i, updateAccountPartial } from '@/account.js';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
announcement: Misskey.entities.Announcement;
|
announcement: Misskey.entities.Announcement;
|
||||||
|
@ -51,7 +51,7 @@ async function ok() {
|
||||||
|
|
||||||
modal.value?.close();
|
modal.value?.close();
|
||||||
misskeyApi('i/read-announcement', { announcementId: props.announcement.id });
|
misskeyApi('i/read-announcement', { announcementId: props.announcement.id });
|
||||||
updateAccount({
|
updateAccountPartial({
|
||||||
unreadAnnouncements: $i!.unreadAnnouncements.filter(a => a.id !== props.announcement.id),
|
unreadAnnouncements: $i!.unreadAnnouncements.filter(a => a.id !== props.announcement.id),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
import MkAuthConfirm from './MkAuthConfirm.vue';
|
||||||
|
void MkAuthConfirm;
|
|
@ -0,0 +1,450 @@
|
||||||
|
<!--
|
||||||
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div :class="$style.wrapper">
|
||||||
|
<Transition
|
||||||
|
mode="out-in"
|
||||||
|
:enterActiveClass="$style.transition_enterActive"
|
||||||
|
:leaveActiveClass="$style.transition_leaveActive"
|
||||||
|
:enterFromClass="$style.transition_enterFrom"
|
||||||
|
:leaveToClass="$style.transition_leaveTo"
|
||||||
|
|
||||||
|
:inert="_waiting"
|
||||||
|
>
|
||||||
|
<div v-if="phase === 'accountSelect'" key="accountSelect" :class="$style.root" class="_gaps">
|
||||||
|
<div :class="$style.header" class="_gaps_s">
|
||||||
|
<div :class="$style.iconFallback">
|
||||||
|
<i class="ti ti-user"></i>
|
||||||
|
</div>
|
||||||
|
<div :class="$style.headerText">{{ i18n.ts.pleaseSelectAccount }}</div>
|
||||||
|
</div>
|
||||||
|
<div :class="$style.accountSelectorRoot">
|
||||||
|
<div :class="$style.accountSelectorLabel">{{ i18n.ts.selectAccount }}</div>
|
||||||
|
<div :class="$style.accountSelectorList">
|
||||||
|
<template v-for="[id, user] in users">
|
||||||
|
<input :id="'account-' + id" v-model="selectedUser" type="radio" name="accountSelector" :value="id" :class="$style.accountSelectorRadio"/>
|
||||||
|
<label :for="'account-' + id" :class="$style.accountSelectorItem">
|
||||||
|
<MkAvatar :user="user" :class="$style.accountSelectorAvatar"/>
|
||||||
|
<div :class="$style.accountSelectorBody">
|
||||||
|
<MkUserName :user="user" :class="$style.accountSelectorName"/>
|
||||||
|
<MkAcct :user="user" :class="$style.accountSelectorAcct"/>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
</template>
|
||||||
|
<button class="_button" :class="[$style.accountSelectorItem, $style.accountSelectorAddAccountRoot]" @click="clickAddAccount">
|
||||||
|
<div :class="[$style.accountSelectorAvatar, $style.accountSelectorAddAccountAvatar]">
|
||||||
|
<i class="ti ti-user-plus"></i>
|
||||||
|
</div>
|
||||||
|
<div :class="[$style.accountSelectorBody, $style.accountSelectorName]">{{ i18n.ts.addAccount }}</div>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="_buttonsCenter">
|
||||||
|
<MkButton rounded gradate :disabled="selectedUser === null" @click="clickChooseAccount">{{ i18n.ts.continue }} <i class="ti ti-arrow-right"></i></MkButton>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="phase === 'consent'" key="consent" :class="$style.root" class="_gaps">
|
||||||
|
<div :class="$style.header" class="_gaps_s">
|
||||||
|
<img v-if="icon" :class="$style.icon" :src="getProxiedImageUrl(icon, 'preview')"/>
|
||||||
|
<div v-else :class="$style.iconFallback">
|
||||||
|
<i class="ti ti-apps"></i>
|
||||||
|
</div>
|
||||||
|
<div :class="$style.headerText">{{ name ? i18n.tsx._auth.shareAccess({ name }) : i18n.ts._auth.shareAccessAsk }}</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="permissions && permissions.length > 0" class="_gaps_s" :class="$style.permissionRoot">
|
||||||
|
<div>{{ name ? i18n.tsx._auth.permission({ name }) : i18n.ts._auth.permissionAsk }}</div>
|
||||||
|
<div :class="$style.permissionListWrapper">
|
||||||
|
<ul :class="$style.permissionList">
|
||||||
|
<li v-for="p in permissions" :key="p">{{ i18n.ts._permissions[p] }}</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<slot name="consentAdditionalInfo"></slot>
|
||||||
|
<div :class="$style.accountSelectorRoot">
|
||||||
|
<div :class="$style.accountSelectorLabel">
|
||||||
|
{{ i18n.ts._auth.scopeUser }} <button class="_textButton" @click="clickBackToAccountSelect">{{ i18n.ts.switchAccount }}</button>
|
||||||
|
</div>
|
||||||
|
<div :class="$style.accountSelectorList">
|
||||||
|
<div :class="[$style.accountSelectorItem, $style.static]">
|
||||||
|
<MkAvatar :user="users.get(selectedUser!)!" :class="$style.accountSelectorAvatar"/>
|
||||||
|
<div :class="$style.accountSelectorBody">
|
||||||
|
<MkUserName :user="users.get(selectedUser!)!" :class="$style.accountSelectorName"/>
|
||||||
|
<MkAcct :user="users.get(selectedUser!)!" :class="$style.accountSelectorAcct"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="_buttonsCenter">
|
||||||
|
<MkButton rounded @click="clickCancel">{{ i18n.ts.reject }}</MkButton>
|
||||||
|
<MkButton rounded gradate @click="clickAccept">{{ i18n.ts.accept }}</MkButton>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="phase === 'success'" key="success" :class="$style.root" class="_gaps_s">
|
||||||
|
<div :class="$style.header" class="_gaps_s">
|
||||||
|
<div :class="$style.iconFallback">
|
||||||
|
<i class="ti ti-check"></i>
|
||||||
|
</div>
|
||||||
|
<div :class="$style.headerText">{{ i18n.ts._auth.accepted }}</div>
|
||||||
|
<div :class="$style.headerTextSub">{{ i18n.ts._auth.pleaseGoBack }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="phase === 'denied'" key="denied" :class="$style.root" class="_gaps_s">
|
||||||
|
<div :class="$style.header" class="_gaps_s">
|
||||||
|
<div :class="$style.iconFallback">
|
||||||
|
<i class="ti ti-x"></i>
|
||||||
|
</div>
|
||||||
|
<div :class="$style.headerText">{{ i18n.ts._auth.denied }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="phase === 'failed'" key="failed" :class="$style.root" class="_gaps_s">
|
||||||
|
<div :class="$style.header" class="_gaps_s">
|
||||||
|
<div :class="$style.iconFallback">
|
||||||
|
<i class="ti ti-x"></i>
|
||||||
|
</div>
|
||||||
|
<div :class="$style.headerText">{{ i18n.ts.somethingHappened }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Transition>
|
||||||
|
<div v-if="_waiting" :class="$style.waitingRoot">
|
||||||
|
<MkLoading/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, computed } from 'vue';
|
||||||
|
import * as Misskey from 'misskey-js';
|
||||||
|
|
||||||
|
import MkButton from '@/components/MkButton.vue';
|
||||||
|
|
||||||
|
import { $i, getAccounts, getAccountWithSigninDialog, getAccountWithSignupDialog } from '@/account.js';
|
||||||
|
import { i18n } from '@/i18n.js';
|
||||||
|
import * as os from '@/os.js';
|
||||||
|
import { getProxiedImageUrl } from '@/scripts/media-proxy.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
name?: string;
|
||||||
|
icon?: string;
|
||||||
|
permissions?: (typeof Misskey.permissions[number])[];
|
||||||
|
manualWaiting?: boolean;
|
||||||
|
waitOnDeny?: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(ev: 'accept', token: string): void;
|
||||||
|
(ev: 'deny', token: string): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const waiting = ref(true);
|
||||||
|
const _waiting = computed(() => waiting.value || props.manualWaiting);
|
||||||
|
const phase = ref<'accountSelect' | 'consent' | 'success' | 'denied' | 'failed'>('accountSelect');
|
||||||
|
|
||||||
|
const selectedUser = ref<string | null>(null);
|
||||||
|
|
||||||
|
const users = ref(new Map<string, Misskey.entities.UserDetailed & { token: string; }>());
|
||||||
|
|
||||||
|
async function init() {
|
||||||
|
waiting.value = true;
|
||||||
|
|
||||||
|
users.value.clear();
|
||||||
|
|
||||||
|
if ($i) {
|
||||||
|
users.value.set($i.id, $i);
|
||||||
|
}
|
||||||
|
|
||||||
|
const accounts = await getAccounts();
|
||||||
|
|
||||||
|
const accountIdsToFetch = accounts.map(a => a.id).filter(id => !users.value.has(id));
|
||||||
|
|
||||||
|
if (accountIdsToFetch.length > 0) {
|
||||||
|
const usersRes = await misskeyApi('users/show', {
|
||||||
|
userIds: accountIdsToFetch,
|
||||||
|
});
|
||||||
|
|
||||||
|
for (const user of usersRes) {
|
||||||
|
if (users.value.has(user.id)) continue;
|
||||||
|
|
||||||
|
users.value.set(user.id, {
|
||||||
|
...user,
|
||||||
|
token: accounts.find(a => a.id === user.id)!.token,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
waiting.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
init();
|
||||||
|
|
||||||
|
function clickAddAccount(ev: MouseEvent) {
|
||||||
|
selectedUser.value = null;
|
||||||
|
|
||||||
|
os.popupMenu([{
|
||||||
|
text: i18n.ts.existingAccount,
|
||||||
|
action: () => {
|
||||||
|
getAccountWithSigninDialog().then(async (res) => {
|
||||||
|
if (res != null) {
|
||||||
|
os.success();
|
||||||
|
await init();
|
||||||
|
if (users.value.has(res.id)) {
|
||||||
|
selectedUser.value = res.id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
text: i18n.ts.createAccount,
|
||||||
|
action: () => {
|
||||||
|
getAccountWithSignupDialog().then(async (res) => {
|
||||||
|
if (res != null) {
|
||||||
|
os.success();
|
||||||
|
await init();
|
||||||
|
if (users.value.has(res.id)) {
|
||||||
|
selectedUser.value = res.id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}], ev.currentTarget ?? ev.target);
|
||||||
|
}
|
||||||
|
|
||||||
|
function clickChooseAccount() {
|
||||||
|
if (selectedUser.value === null) return;
|
||||||
|
|
||||||
|
phase.value = 'consent';
|
||||||
|
}
|
||||||
|
|
||||||
|
function clickBackToAccountSelect() {
|
||||||
|
selectedUser.value = null;
|
||||||
|
phase.value = 'accountSelect';
|
||||||
|
}
|
||||||
|
|
||||||
|
function clickCancel() {
|
||||||
|
if (selectedUser.value === null) return;
|
||||||
|
|
||||||
|
const user = users.value.get(selectedUser.value)!;
|
||||||
|
|
||||||
|
const token = user.token;
|
||||||
|
|
||||||
|
if (props.waitOnDeny) {
|
||||||
|
waiting.value = true;
|
||||||
|
}
|
||||||
|
emit('deny', token);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function clickAccept() {
|
||||||
|
if (selectedUser.value === null) return;
|
||||||
|
|
||||||
|
const user = users.value.get(selectedUser.value)!;
|
||||||
|
|
||||||
|
const token = user.token;
|
||||||
|
|
||||||
|
waiting.value = true;
|
||||||
|
emit('accept', token);
|
||||||
|
}
|
||||||
|
|
||||||
|
function showUI(state: 'success' | 'denied' | 'failed') {
|
||||||
|
phase.value = state;
|
||||||
|
waiting.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
showUI,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" module>
|
||||||
|
.transition_enterActive,
|
||||||
|
.transition_leaveActive {
|
||||||
|
transition: opacity 0.3s cubic-bezier(0,0,.35,1), transform 0.3s cubic-bezier(0,0,.35,1);
|
||||||
|
}
|
||||||
|
.transition_enterFrom {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateX(50px);
|
||||||
|
}
|
||||||
|
.transition_leaveTo {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateX(-50px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-x: clip;
|
||||||
|
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.waitingRoot {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: color-mix(in srgb, var(--MI_THEME-panel), transparent 50%);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 1;
|
||||||
|
cursor: wait;
|
||||||
|
}
|
||||||
|
|
||||||
|
.root {
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 100%;
|
||||||
|
padding: 48px 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
margin: 0 auto;
|
||||||
|
max-width: 320px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon,
|
||||||
|
.iconFallback {
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 54px;
|
||||||
|
height: 54px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 1px solid var(--MI_THEME-divider);
|
||||||
|
background-color: #fff;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconFallback {
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: var(--MI_THEME-accentedBg);
|
||||||
|
color: var(--MI_THEME-accent);
|
||||||
|
text-align: center;
|
||||||
|
line-height: 54px;
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headerText,
|
||||||
|
.headerTextSub {
|
||||||
|
text-align: center;
|
||||||
|
word-break: normal;
|
||||||
|
word-break: auto-phrase;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headerText {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.permissionRoot {
|
||||||
|
padding: 16px;
|
||||||
|
border-radius: var(--MI-radius);
|
||||||
|
background-color: var(--MI_THEME-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.permissionListWrapper {
|
||||||
|
max-height: 350px;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 12px;
|
||||||
|
border-radius: var(--MI-radius);
|
||||||
|
background-color: var(--MI_THEME-panel);
|
||||||
|
}
|
||||||
|
|
||||||
|
.permissionList {
|
||||||
|
margin: 0 0 0 1.5em;
|
||||||
|
padding: 0;
|
||||||
|
font-size: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.accountSelectorLabel {
|
||||||
|
font-size: 0.85em;
|
||||||
|
opacity: 0.7;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.accountSelectorList {
|
||||||
|
border-radius: var(--MI-radius);
|
||||||
|
border: 1px solid var(--MI_THEME-divider);
|
||||||
|
overflow: hidden;
|
||||||
|
overflow: clip;
|
||||||
|
}
|
||||||
|
|
||||||
|
.accountSelectorRadio {
|
||||||
|
position: absolute;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
pointer-events: none;
|
||||||
|
|
||||||
|
&:focus-visible + .accountSelectorItem {
|
||||||
|
outline: 2px solid var(--MI_THEME-accent);
|
||||||
|
outline-offset: -4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:checked:focus-visible + .accountSelectorItem {
|
||||||
|
outline-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:checked + .accountSelectorItem {
|
||||||
|
background: var(--MI_THEME-accent);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.accountSelectorItem {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 8px;
|
||||||
|
font-size: 14px;
|
||||||
|
-webkit-tap-highlight-color: transparent;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: var(--MI_THEME-buttonHoverBg);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.static {
|
||||||
|
cursor: unset;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.accountSelectorAddAccountRoot {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.accountSelectorBody {
|
||||||
|
padding: 0 8px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.accountSelectorAvatar {
|
||||||
|
width: 45px;
|
||||||
|
height: 45px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.accountSelectorAddAccountAvatar {
|
||||||
|
background-color: var(--MI_THEME-accentedBg);
|
||||||
|
color: var(--MI_THEME-accent);
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 45px;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.accountSelectorName {
|
||||||
|
display: block;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.accountSelectorAcct {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -26,11 +26,11 @@ import { onMounted, onUnmounted, shallowRef, ref } from 'vue';
|
||||||
import MkModal from './MkModal.vue';
|
import MkModal from './MkModal.vue';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
withOkButton: boolean;
|
withOkButton?: boolean;
|
||||||
withCloseButton: boolean;
|
withCloseButton?: boolean;
|
||||||
okButtonDisabled: boolean;
|
okButtonDisabled?: boolean;
|
||||||
width: number;
|
width?: number;
|
||||||
height: number;
|
height?: number;
|
||||||
}>(), {
|
}>(), {
|
||||||
withOkButton: false,
|
withOkButton: false,
|
||||||
withCloseButton: true,
|
withCloseButton: true,
|
||||||
|
|
|
@ -16,9 +16,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
@keydown.space.enter="show"
|
@keydown.space.enter="show"
|
||||||
>
|
>
|
||||||
<div ref="prefixEl" :class="$style.prefix"><slot name="prefix"></slot></div>
|
<div ref="prefixEl" :class="$style.prefix"><slot name="prefix"></slot></div>
|
||||||
<select
|
<div
|
||||||
ref="inputEl"
|
ref="inputEl"
|
||||||
v-model="v"
|
|
||||||
v-adaptive-border
|
v-adaptive-border
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
:class="$style.inputCore"
|
:class="$style.inputCore"
|
||||||
|
@ -26,55 +25,48 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
:required="required"
|
:required="required"
|
||||||
:readonly="readonly"
|
:readonly="readonly"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
@input="onInput"
|
|
||||||
@mousedown.prevent="() => {}"
|
@mousedown.prevent="() => {}"
|
||||||
@keydown.prevent="() => {}"
|
@keydown.prevent="() => {}"
|
||||||
>
|
>
|
||||||
<slot></slot>
|
<div style="pointer-events: none;">{{ currentValueText ?? '' }}</div>
|
||||||
</select>
|
<div style="display: none;">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div ref="suffixEl" :class="$style.suffix"><i class="ti ti-chevron-down" :class="[$style.chevron, { [$style.chevronOpening]: opening }]"></i></div>
|
<div ref="suffixEl" :class="$style.suffix"><i class="ti ti-chevron-down" :class="[$style.chevron, { [$style.chevronOpening]: opening }]"></i></div>
|
||||||
</div>
|
</div>
|
||||||
<div :class="$style.caption"><slot name="caption"></slot></div>
|
<div :class="$style.caption"><slot name="caption"></slot></div>
|
||||||
|
|
||||||
<MkButton v-if="manualSave && changed" primary :class="$style.save" @click="updated"><i class="ti ti-device-floppy"></i> {{ i18n.ts.save }}</MkButton>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, nextTick, ref, watch, computed, toRefs, VNode, useSlots, VNodeChild } from 'vue';
|
import { onMounted, nextTick, ref, watch, computed, toRefs, VNode, useSlots, VNodeChild } from 'vue';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
|
||||||
import * as os from '@/os.js';
|
|
||||||
import { useInterval } from '@@/js/use-interval.js';
|
import { useInterval } from '@@/js/use-interval.js';
|
||||||
import { i18n } from '@/i18n.js';
|
|
||||||
import type { MenuItem } from '@/types/menu.js';
|
import type { MenuItem } from '@/types/menu.js';
|
||||||
|
import * as os from '@/os.js';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
modelValue: string | null;
|
modelValue: string | number | null;
|
||||||
required?: boolean;
|
required?: boolean;
|
||||||
readonly?: boolean;
|
readonly?: boolean;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
autofocus?: boolean;
|
autofocus?: boolean;
|
||||||
inline?: boolean;
|
inline?: boolean;
|
||||||
manualSave?: boolean;
|
|
||||||
small?: boolean;
|
small?: boolean;
|
||||||
large?: boolean;
|
large?: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(ev: 'changeByUser', value: string | null): void;
|
(ev: 'update:modelValue', value: string | number | null): void;
|
||||||
(ev: 'update:modelValue', value: string | null): void;
|
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const slots = useSlots();
|
const slots = useSlots();
|
||||||
|
|
||||||
const { modelValue, autofocus } = toRefs(props);
|
const { modelValue, autofocus } = toRefs(props);
|
||||||
const v = ref(modelValue.value);
|
|
||||||
const focused = ref(false);
|
const focused = ref(false);
|
||||||
const opening = ref(false);
|
const opening = ref(false);
|
||||||
const changed = ref(false);
|
const currentValueText = ref<string | null>(null);
|
||||||
const invalid = ref(false);
|
|
||||||
const filled = computed(() => v.value !== '' && v.value != null);
|
|
||||||
const inputEl = ref<HTMLObjectElement | null>(null);
|
const inputEl = ref<HTMLObjectElement | null>(null);
|
||||||
const prefixEl = ref<HTMLElement | null>(null);
|
const prefixEl = ref<HTMLElement | null>(null);
|
||||||
const suffixEl = ref<HTMLElement | null>(null);
|
const suffixEl = ref<HTMLElement | null>(null);
|
||||||
|
@ -85,26 +77,6 @@ const height =
|
||||||
36;
|
36;
|
||||||
|
|
||||||
const focus = () => container.value?.focus();
|
const focus = () => container.value?.focus();
|
||||||
const onInput = (ev) => {
|
|
||||||
changed.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
const updated = () => {
|
|
||||||
changed.value = false;
|
|
||||||
emit('update:modelValue', v.value);
|
|
||||||
};
|
|
||||||
|
|
||||||
watch(modelValue, newValue => {
|
|
||||||
v.value = newValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(v, () => {
|
|
||||||
if (!props.manualSave) {
|
|
||||||
updated();
|
|
||||||
}
|
|
||||||
|
|
||||||
invalid.value = inputEl.value?.validity.badInput ?? true;
|
|
||||||
});
|
|
||||||
|
|
||||||
// このコンポーネントが作成された時、非表示状態である場合がある
|
// このコンポーネントが作成された時、非表示状態である場合がある
|
||||||
// 非表示状態だと要素の幅などは0になってしまうので、定期的に計算する
|
// 非表示状態だと要素の幅などは0になってしまうので、定期的に計算する
|
||||||
|
@ -134,6 +106,31 @@ onMounted(() => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(modelValue, () => {
|
||||||
|
const scanOptions = (options: VNodeChild[]) => {
|
||||||
|
for (const vnode of options) {
|
||||||
|
if (typeof vnode !== 'object' || vnode === null || Array.isArray(vnode)) continue;
|
||||||
|
if (vnode.type === 'optgroup') {
|
||||||
|
const optgroup = vnode;
|
||||||
|
if (Array.isArray(optgroup.children)) scanOptions(optgroup.children);
|
||||||
|
} else if (Array.isArray(vnode.children)) { // 何故かフラグメントになってくることがある
|
||||||
|
const fragment = vnode;
|
||||||
|
if (Array.isArray(fragment.children)) scanOptions(fragment.children);
|
||||||
|
} else if (vnode.props == null) { // v-if で条件が false のときにこうなる
|
||||||
|
// nop?
|
||||||
|
} else {
|
||||||
|
const option = vnode;
|
||||||
|
if (option.props?.value === modelValue.value) {
|
||||||
|
currentValueText.value = option.children as string;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
scanOptions(slots.default!());
|
||||||
|
}, { immediate: true });
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
if (opening.value) return;
|
if (opening.value) return;
|
||||||
focus();
|
focus();
|
||||||
|
@ -146,11 +143,9 @@ function show() {
|
||||||
const pushOption = (option: VNode) => {
|
const pushOption = (option: VNode) => {
|
||||||
menu.push({
|
menu.push({
|
||||||
text: option.children as string,
|
text: option.children as string,
|
||||||
active: computed(() => v.value === option.props?.value),
|
active: computed(() => modelValue.value === option.props?.value),
|
||||||
action: () => {
|
action: () => {
|
||||||
v.value = option.props?.value;
|
emit('update:modelValue', option.props?.value);
|
||||||
changed.value = true;
|
|
||||||
emit('changeByUser', v.value);
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -248,7 +243,8 @@ function show() {
|
||||||
.inputCore {
|
.inputCore {
|
||||||
appearance: none;
|
appearance: none;
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
display: block;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
height: v-bind("height + 'px'");
|
height: v-bind("height + 'px'");
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
|
@ -8,7 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
ref="dialog"
|
ref="dialog"
|
||||||
:width="500"
|
:width="500"
|
||||||
:height="600"
|
:height="600"
|
||||||
@close="dialog?.close()"
|
@close="onClose"
|
||||||
@closed="$emit('closed')"
|
@closed="$emit('closed')"
|
||||||
>
|
>
|
||||||
<template #header>{{ i18n.ts.signup }}</template>
|
<template #header>{{ i18n.ts.signup }}</template>
|
||||||
|
@ -22,7 +22,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
:leaveToClass="$style.transition_x_leaveTo"
|
:leaveToClass="$style.transition_x_leaveTo"
|
||||||
>
|
>
|
||||||
<template v-if="!isAcceptedServerRule">
|
<template v-if="!isAcceptedServerRule">
|
||||||
<XServerRules @done="isAcceptedServerRule = true" @cancel="dialog?.close()"/>
|
<XServerRules @done="isAcceptedServerRule = true" @cancel="onClose"/>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<XSignup :autoSet="autoSet" @signup="onSignup" @signupEmailPending="onSignupEmailPending"/>
|
<XSignup :autoSet="autoSet" @signup="onSignup" @signupEmailPending="onSignupEmailPending"/>
|
||||||
|
@ -48,6 +48,7 @@ const props = withDefaults(defineProps<{
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(ev: 'done', res: Misskey.entities.SignupResponse): void;
|
(ev: 'done', res: Misskey.entities.SignupResponse): void;
|
||||||
|
(ev: 'cancelled'): void;
|
||||||
(ev: 'closed'): void;
|
(ev: 'closed'): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
@ -55,6 +56,11 @@ const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
|
||||||
|
|
||||||
const isAcceptedServerRule = ref(false);
|
const isAcceptedServerRule = ref(false);
|
||||||
|
|
||||||
|
function onClose() {
|
||||||
|
emit('cancelled');
|
||||||
|
dialog.value?.close();
|
||||||
|
}
|
||||||
|
|
||||||
function onSignup(res: Misskey.entities.SignupResponse) {
|
function onSignup(res: Misskey.entities.SignupResponse) {
|
||||||
emit('done', res);
|
emit('done', res);
|
||||||
dialog.value?.close();
|
dialog.value?.close();
|
||||||
|
|
|
@ -55,7 +55,7 @@ import * as os from '@/os.js';
|
||||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
import { $i, updateAccount } from '@/account.js';
|
import { $i, updateAccountPartial } from '@/account.js';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
@ -90,7 +90,7 @@ async function read(target: Misskey.entities.Announcement): Promise<void> {
|
||||||
target.isRead = true;
|
target.isRead = true;
|
||||||
await misskeyApi('i/read-announcement', { announcementId: target.id });
|
await misskeyApi('i/read-announcement', { announcementId: target.id });
|
||||||
if ($i) {
|
if ($i) {
|
||||||
updateAccount({
|
updateAccountPartial({
|
||||||
unreadAnnouncements: $i.unreadAnnouncements.filter((a: { id: string; }) => a.id !== target.id),
|
unreadAnnouncements: $i.unreadAnnouncements.filter((a: { id: string; }) => a.id !== target.id),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ import * as os from '@/os.js';
|
||||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
import { $i, updateAccount } from '@/account.js';
|
import { $i, updateAccountPartial } from '@/account.js';
|
||||||
|
|
||||||
const paginationCurrent = {
|
const paginationCurrent = {
|
||||||
endpoint: 'announcements' as const,
|
endpoint: 'announcements' as const,
|
||||||
|
@ -94,7 +94,7 @@ async function read(target) {
|
||||||
return a;
|
return a;
|
||||||
});
|
});
|
||||||
misskeyApi('i/read-announcement', { announcementId: target.id });
|
misskeyApi('i/read-announcement', { announcementId: target.id });
|
||||||
updateAccount({
|
updateAccountPartial({
|
||||||
unreadAnnouncements: $i!.unreadAnnouncements.filter(a => a.id !== target.id),
|
unreadAnnouncements: $i!.unreadAnnouncements.filter(a => a.id !== target.id),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,95 +4,79 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<MkStickyContainer>
|
<div>
|
||||||
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
<MkAnimBg style="position: fixed; top: 0;"/>
|
||||||
<MkSpacer :contentMax="800">
|
<div :class="$style.formContainer">
|
||||||
<div v-if="$i">
|
<div :class="$style.form">
|
||||||
<div v-if="state == 'waiting'">
|
<MkAuthConfirm
|
||||||
<MkLoading/>
|
ref="authRoot"
|
||||||
</div>
|
:name="name"
|
||||||
<div v-if="state == 'denied'">
|
:icon="icon || undefined"
|
||||||
<p>{{ i18n.ts._auth.denied }}</p>
|
:permissions="_permissions"
|
||||||
</div>
|
@accept="onAccept"
|
||||||
<div v-else-if="state == 'accepted'" class="accepted">
|
@deny="onDeny"
|
||||||
<p v-if="callback">{{ i18n.ts._auth.callback }}<MkEllipsis/></p>
|
>
|
||||||
<p v-else>{{ i18n.ts._auth.pleaseGoBack }}</p>
|
<template #consentAdditionalInfo>
|
||||||
</div>
|
<div v-if="callback != null" :class="$style.redirectRoot">
|
||||||
<div v-else>
|
<div>{{ i18n.ts._auth.byClickingYouWillBeRedirectedToThisUrl }}</div>
|
||||||
<div v-if="_permissions.length > 0">
|
<div class="_monospace" :class="$style.redirectUrl">{{ callback }}</div>
|
||||||
<p v-if="name">{{ i18n.tsx._auth.permission({ name }) }}</p>
|
</div>
|
||||||
<p v-else>{{ i18n.ts._auth.permissionAsk }}</p>
|
</template>
|
||||||
<ul>
|
</MkAuthConfirm>
|
||||||
<li v-for="p in _permissions" :key="p">{{ i18n.ts._permissions[p] }}</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div v-if="name">{{ i18n.tsx._auth.shareAccess({ name }) }}</div>
|
|
||||||
<div v-else>{{ i18n.ts._auth.shareAccessAsk }}</div>
|
|
||||||
<div :class="$style.buttons">
|
|
||||||
<MkButton inline @click="deny">{{ i18n.ts.cancel }}</MkButton>
|
|
||||||
<MkButton inline primary @click="accept">{{ i18n.ts.accept }}</MkButton>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
</div>
|
||||||
<p :class="$style.loginMessage">{{ i18n.ts._auth.pleaseLogin }}</p>
|
</div>
|
||||||
<MkSignin @login="onLogin"/>
|
|
||||||
</div>
|
|
||||||
</MkSpacer>
|
|
||||||
</MkStickyContainer>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, computed } from 'vue';
|
import { computed, useTemplateRef } from 'vue';
|
||||||
import MkSignin from '@/components/MkSignin.vue';
|
import * as Misskey from 'misskey-js';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
|
||||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
import MkAnimBg from '@/components/MkAnimBg.vue';
|
||||||
import { $i, login } from '@/account.js';
|
import MkAuthConfirm from '@/components/MkAuthConfirm.vue';
|
||||||
|
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
session: string;
|
session: string;
|
||||||
callback?: string;
|
callback?: string;
|
||||||
name: string;
|
name?: string;
|
||||||
icon: string;
|
icon?: string;
|
||||||
permission: string; // コンマ区切り
|
permission?: string; // コンマ区切り
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const _permissions = props.permission ? props.permission.split(',') : [];
|
const _permissions = computed(() => {
|
||||||
|
return (props.permission ? props.permission.split(',').filter((p): p is typeof Misskey.permissions[number] => (Misskey.permissions as readonly string[]).includes(p)) : []);
|
||||||
|
});
|
||||||
|
|
||||||
const state = ref<string | null>(null);
|
const authRoot = useTemplateRef('authRoot');
|
||||||
|
|
||||||
async function accept(): Promise<void> {
|
async function onAccept(token: string) {
|
||||||
state.value = 'waiting';
|
|
||||||
await misskeyApi('miauth/gen-token', {
|
await misskeyApi('miauth/gen-token', {
|
||||||
session: props.session,
|
session: props.session,
|
||||||
name: props.name,
|
name: props.name,
|
||||||
iconUrl: props.icon,
|
iconUrl: props.icon,
|
||||||
permission: _permissions,
|
permission: _permissions.value,
|
||||||
|
}, token).catch(() => {
|
||||||
|
authRoot.value?.showUI('failed');
|
||||||
});
|
});
|
||||||
|
|
||||||
state.value = 'accepted';
|
if (props.callback && props.callback !== '') {
|
||||||
if (props.callback) {
|
|
||||||
const cbUrl = new URL(props.callback);
|
const cbUrl = new URL(props.callback);
|
||||||
if (['javascript:', 'file:', 'data:', 'mailto:', 'tel:'].includes(cbUrl.protocol)) throw new Error('invalid url');
|
if (['javascript:', 'file:', 'data:', 'mailto:', 'tel:'].includes(cbUrl.protocol)) throw new Error('invalid url');
|
||||||
cbUrl.searchParams.set('session', props.session);
|
cbUrl.searchParams.set('session', props.session);
|
||||||
location.href = cbUrl.href;
|
location.href = cbUrl.toString();
|
||||||
|
} else {
|
||||||
|
authRoot.value?.showUI('success');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function deny(): void {
|
function onDeny() {
|
||||||
state.value = 'denied';
|
authRoot.value?.showUI('denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
function onLogin(res): void {
|
|
||||||
login(res.i);
|
|
||||||
}
|
|
||||||
|
|
||||||
const headerActions = computed(() => []);
|
|
||||||
|
|
||||||
const headerTabs = computed(() => []);
|
|
||||||
|
|
||||||
definePageMetadata(() => ({
|
definePageMetadata(() => ({
|
||||||
title: 'MiAuth',
|
title: 'MiAuth',
|
||||||
icon: 'ti ti-apps',
|
icon: 'ti ti-apps',
|
||||||
|
@ -100,15 +84,38 @@ definePageMetadata(() => ({
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" module>
|
<style lang="scss" module>
|
||||||
.buttons {
|
.formContainer {
|
||||||
margin-top: 16px;
|
min-height: 100svh;
|
||||||
display: flex;
|
padding: 32px 32px calc(env(safe-area-inset-bottom, 0px) + 32px) 32px;
|
||||||
gap: 8px;
|
box-sizing: border-box;
|
||||||
flex-wrap: wrap;
|
display: grid;
|
||||||
|
place-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loginMessage {
|
.form {
|
||||||
text-align: center;
|
position: relative;
|
||||||
margin: 8px 0 24px;
|
z-index: 10;
|
||||||
|
border-radius: var(--MI-radius);
|
||||||
|
background-color: var(--MI_THEME-panel);
|
||||||
|
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
|
||||||
|
overflow: clip;
|
||||||
|
max-width: 500px;
|
||||||
|
width: calc(100vw - 64px);
|
||||||
|
height: min(65svh, calc(100svh - calc(env(safe-area-inset-bottom, 0px) + 64px)));
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
.redirectRoot {
|
||||||
|
padding: 16px;
|
||||||
|
border-radius: var(--MI-radius);
|
||||||
|
background-color: var(--MI_THEME-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.redirectUrl {
|
||||||
|
font-size: 90%;
|
||||||
|
padding: 12px;
|
||||||
|
border-radius: var(--MI-radius);
|
||||||
|
background-color: var(--MI_THEME-panel);
|
||||||
|
overflow-x: scroll;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -4,40 +4,28 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<MkStickyContainer>
|
<div>
|
||||||
<template #header><MkPageHeader/></template>
|
<MkAnimBg style="position: fixed; top: 0;"/>
|
||||||
<MkSpacer :contentMax="800">
|
<div :class="$style.formContainer">
|
||||||
<div v-if="$i">
|
<div :class="$style.form">
|
||||||
<div v-if="permissions.length > 0">
|
<MkAuthConfirm
|
||||||
<p v-if="name">{{ i18n.tsx._auth.permission({ name }) }}</p>
|
ref="authRoot"
|
||||||
<p v-else>{{ i18n.ts._auth.permissionAsk }}</p>
|
:name="name"
|
||||||
<ul>
|
:permissions="permissions"
|
||||||
<li v-for="p in permissions" :key="p">{{ i18n.ts._permissions[p] }}</li>
|
:waitOnDeny="true"
|
||||||
</ul>
|
@accept="onAccept"
|
||||||
</div>
|
@deny="onDeny"
|
||||||
<div v-if="name">{{ i18n.tsx._auth.shareAccess({ name }) }}</div>
|
/>
|
||||||
<div v-else>{{ i18n.ts._auth.shareAccessAsk }}</div>
|
|
||||||
<form :class="$style.buttons" action="/oauth/decision" accept-charset="utf-8" method="post">
|
|
||||||
<input name="login_token" type="hidden" :value="$i.token"/>
|
|
||||||
<input name="transaction_id" type="hidden" :value="transactionIdMeta?.content"/>
|
|
||||||
<MkButton inline name="cancel" value="cancel">{{ i18n.ts.cancel }}</MkButton>
|
|
||||||
<MkButton inline primary>{{ i18n.ts.accept }}</MkButton>
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
</div>
|
||||||
<p :class="$style.loginMessage">{{ i18n.ts._auth.pleaseLogin }}</p>
|
</div>
|
||||||
<MkSignin @login="onLogin"/>
|
|
||||||
</div>
|
|
||||||
</MkSpacer>
|
|
||||||
</MkStickyContainer>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import MkSignin from '@/components/MkSignin.vue';
|
import * as Misskey from 'misskey-js';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkAnimBg from '@/components/MkAnimBg.vue';
|
||||||
import { $i, login } from '@/account.js';
|
|
||||||
import { i18n } from '@/i18n.js';
|
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
|
import MkAuthConfirm from '@/components/MkAuthConfirm.vue';
|
||||||
|
|
||||||
const transactionIdMeta = document.querySelector<HTMLMetaElement>('meta[name="misskey:oauth:transaction-id"]');
|
const transactionIdMeta = document.querySelector<HTMLMetaElement>('meta[name="misskey:oauth:transaction-id"]');
|
||||||
if (transactionIdMeta) {
|
if (transactionIdMeta) {
|
||||||
|
@ -45,10 +33,44 @@ if (transactionIdMeta) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const name = document.querySelector<HTMLMetaElement>('meta[name="misskey:oauth:client-name"]')?.content;
|
const name = document.querySelector<HTMLMetaElement>('meta[name="misskey:oauth:client-name"]')?.content;
|
||||||
const permissions = document.querySelector<HTMLMetaElement>('meta[name="misskey:oauth:scope"]')?.content.split(' ') ?? [];
|
const permissions = document.querySelector<HTMLMetaElement>('meta[name="misskey:oauth:scope"]')?.content.split(' ').filter((p): p is typeof Misskey.permissions[number] => (Misskey.permissions as readonly string[]).includes(p)) ?? [];
|
||||||
|
|
||||||
function onLogin(res): void {
|
function doPost(token: string, decision: 'accept' | 'deny') {
|
||||||
login(res.i);
|
const form = document.createElement('form');
|
||||||
|
form.action = '/oauth/decision';
|
||||||
|
form.method = 'post';
|
||||||
|
form.acceptCharset = 'utf-8';
|
||||||
|
|
||||||
|
const loginToken = document.createElement('input');
|
||||||
|
loginToken.type = 'hidden';
|
||||||
|
loginToken.name = 'login_token';
|
||||||
|
loginToken.value = token;
|
||||||
|
form.appendChild(loginToken);
|
||||||
|
|
||||||
|
const transactionId = document.createElement('input');
|
||||||
|
transactionId.type = 'hidden';
|
||||||
|
transactionId.name = 'transaction_id';
|
||||||
|
transactionId.value = transactionIdMeta?.content ?? '';
|
||||||
|
form.appendChild(transactionId);
|
||||||
|
|
||||||
|
if (decision === 'deny') {
|
||||||
|
const cancel = document.createElement('input');
|
||||||
|
cancel.type = 'hidden';
|
||||||
|
cancel.name = 'cancel';
|
||||||
|
cancel.value = 'cancel';
|
||||||
|
form.appendChild(cancel);
|
||||||
|
}
|
||||||
|
|
||||||
|
document.body.appendChild(form);
|
||||||
|
form.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function onAccept(token: string) {
|
||||||
|
doPost(token, 'accept');
|
||||||
|
}
|
||||||
|
|
||||||
|
function onDeny(token: string) {
|
||||||
|
doPost(token, 'deny');
|
||||||
}
|
}
|
||||||
|
|
||||||
definePageMetadata(() => ({
|
definePageMetadata(() => ({
|
||||||
|
@ -58,15 +80,24 @@ definePageMetadata(() => ({
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" module>
|
<style lang="scss" module>
|
||||||
.buttons {
|
.formContainer {
|
||||||
margin-top: 16px;
|
min-height: 100svh;
|
||||||
display: flex;
|
padding: 32px 32px calc(env(safe-area-inset-bottom, 0px) + 32px) 32px;
|
||||||
gap: 8px;
|
box-sizing: border-box;
|
||||||
flex-wrap: wrap;
|
display: grid;
|
||||||
|
place-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loginMessage {
|
.form {
|
||||||
text-align: center;
|
position: relative;
|
||||||
margin: 8px 0 24px;
|
z-index: 10;
|
||||||
|
border-radius: var(--MI-radius);
|
||||||
|
background-color: var(--MI_THEME-panel);
|
||||||
|
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
|
||||||
|
overflow: clip;
|
||||||
|
max-width: 500px;
|
||||||
|
width: calc(100vw - 64px);
|
||||||
|
height: min(65svh, calc(100svh - calc(env(safe-area-inset-bottom, 0px) + 64px)));
|
||||||
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -84,7 +84,7 @@ import FormSection from '@/components/form/section.vue';
|
||||||
import MkFolder from '@/components/MkFolder.vue';
|
import MkFolder from '@/components/MkFolder.vue';
|
||||||
import MkLink from '@/components/MkLink.vue';
|
import MkLink from '@/components/MkLink.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import { signinRequired, updateAccount } from '@/account.js';
|
import { signinRequired, updateAccountPartial } from '@/account.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
|
||||||
const $i = signinRequired();
|
const $i = signinRequired();
|
||||||
|
@ -123,7 +123,7 @@ async function unregisterTOTP(): Promise<void> {
|
||||||
password: auth.result.password,
|
password: auth.result.password,
|
||||||
token: auth.result.token,
|
token: auth.result.token,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
updateAccount({
|
updateAccountPartial({
|
||||||
twoFactorEnabled: false,
|
twoFactorEnabled: false,
|
||||||
});
|
});
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
|
|
@ -19,13 +19,13 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { defineAsyncComponent, ref, computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import type * as Misskey from 'misskey-js';
|
import type * as Misskey from 'misskey-js';
|
||||||
import FormSuspense from '@/components/form/suspense.vue';
|
import FormSuspense from '@/components/form/suspense.vue';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { getAccounts, addAccount as addAccounts, removeAccount as _removeAccount, login, $i } from '@/account.js';
|
import { getAccounts, removeAccount as _removeAccount, login, $i, getAccountWithSigninDialog, getAccountWithSignupDialog } from '@/account.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
import MkUserCardMini from '@/components/MkUserCardMini.vue';
|
import MkUserCardMini from '@/components/MkUserCardMini.vue';
|
||||||
|
@ -74,23 +74,19 @@ async function removeAccount(account: Misskey.entities.UserDetailed) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function addExistingAccount() {
|
function addExistingAccount() {
|
||||||
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), {}, {
|
getAccountWithSigninDialog().then((res) => {
|
||||||
done: async (res: Misskey.entities.SigninFlowResponse & { finished: true }) => {
|
if (res != null) {
|
||||||
await addAccounts(res.id, res.i);
|
|
||||||
os.success();
|
os.success();
|
||||||
init();
|
init();
|
||||||
},
|
}
|
||||||
closed: () => dispose(),
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createAccount() {
|
function createAccount() {
|
||||||
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkSignupDialog.vue')), {}, {
|
getAccountWithSignupDialog().then((res) => {
|
||||||
done: async (res: Misskey.entities.SignupResponse) => {
|
if (res != null) {
|
||||||
await addAccounts(res.id, res.token);
|
|
||||||
switchAccountWithToken(res.token);
|
switchAccountWithToken(res.token);
|
||||||
},
|
}
|
||||||
closed: () => dispose(),
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,17 +45,89 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</MkSwitch>
|
</MkSwitch>
|
||||||
|
|
||||||
<FormSection>
|
<FormSection>
|
||||||
<template #label>{{ i18n.ts.lockdown }}</template>
|
<template #label>{{ i18n.ts.lockdown }}<span class="_beta">{{ i18n.ts.beta }}</span></template>
|
||||||
|
|
||||||
<div class="_gaps_m">
|
<div class="_gaps_m">
|
||||||
<MkSwitch v-model="requireSigninToViewContents" @update:modelValue="save()">
|
<MkSwitch v-model="requireSigninToViewContents" @update:modelValue="save()">
|
||||||
{{ i18n.ts._accountSettings.requireSigninToViewContents }}<span class="_beta">{{ i18n.ts.beta }}</span>
|
{{ i18n.ts._accountSettings.requireSigninToViewContents }}
|
||||||
<template #caption>
|
<template #caption>
|
||||||
<div>{{ i18n.ts._accountSettings.requireSigninToViewContentsDescription1 }}</div>
|
<div>{{ i18n.ts._accountSettings.requireSigninToViewContentsDescription1 }}</div>
|
||||||
<div><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.requireSigninToViewContentsDescription2 }}</div>
|
<div><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.requireSigninToViewContentsDescription2 }}</div>
|
||||||
<div><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.requireSigninToViewContentsDescription3 }}</div>
|
<div><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.requireSigninToViewContentsDescription3 }}</div>
|
||||||
</template>
|
</template>
|
||||||
</MkSwitch>
|
</MkSwitch>
|
||||||
|
|
||||||
|
<FormSlot>
|
||||||
|
<template #label>{{ i18n.ts._accountSettings.makeNotesFollowersOnlyBefore }}</template>
|
||||||
|
|
||||||
|
<div class="_gaps_s">
|
||||||
|
<MkSelect :modelValue="makeNotesFollowersOnlyBefore_type" @update:modelValue="makeNotesFollowersOnlyBefore = $event === 'relative' ? -604800 : $event === 'absolute' ? Math.floor(Date.now() / 1000) : null">
|
||||||
|
<option :value="null">{{ i18n.ts.none }}</option>
|
||||||
|
<option value="relative">{{ i18n.ts._accountSettings.notesHavePassedSpecifiedPeriod }}</option>
|
||||||
|
<option value="absolute">{{ i18n.ts._accountSettings.notesOlderThanSpecifiedDateAndTime }}</option>
|
||||||
|
</MkSelect>
|
||||||
|
|
||||||
|
<MkSelect v-if="makeNotesFollowersOnlyBefore_type === 'relative'" v-model="makeNotesFollowersOnlyBefore">
|
||||||
|
<option :value="-3600">{{ i18n.ts.oneHour }}</option>
|
||||||
|
<option :value="-86400">{{ i18n.ts.oneDay }}</option>
|
||||||
|
<option :value="-259200">{{ i18n.ts.threeDays }}</option>
|
||||||
|
<option :value="-604800">{{ i18n.ts.oneWeek }}</option>
|
||||||
|
<option :value="-2592000">{{ i18n.ts.oneMonth }}</option>
|
||||||
|
<option :value="-7776000">{{ i18n.ts.threeMonths }}</option>
|
||||||
|
<option :value="-31104000">{{ i18n.ts.oneYear }}</option>
|
||||||
|
</MkSelect>
|
||||||
|
|
||||||
|
<MkInput
|
||||||
|
v-if="makeNotesFollowersOnlyBefore_type === 'absolute'"
|
||||||
|
:modelValue="formatDateTimeString(new Date(makeNotesFollowersOnlyBefore * 1000), 'yyyy-MM-dd')"
|
||||||
|
type="date"
|
||||||
|
:manualSave="true"
|
||||||
|
@update:modelValue="makeNotesFollowersOnlyBefore = Math.floor(new Date($event).getTime() / 1000)"
|
||||||
|
>
|
||||||
|
</MkInput>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<template #caption>
|
||||||
|
<div>{{ i18n.ts._accountSettings.makeNotesFollowersOnlyBeforeDescription }}</div>
|
||||||
|
<div><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.mayNotEffectForFederatedNotes }}</div>
|
||||||
|
</template>
|
||||||
|
</FormSlot>
|
||||||
|
|
||||||
|
<FormSlot>
|
||||||
|
<template #label>{{ i18n.ts._accountSettings.makeNotesHiddenBefore }}</template>
|
||||||
|
|
||||||
|
<div class="_gaps_s">
|
||||||
|
<MkSelect :modelValue="makeNotesHiddenBefore_type" @update:modelValue="makeNotesHiddenBefore = $event === 'relative' ? -604800 : $event === 'absolute' ? Math.floor(Date.now() / 1000) : null">
|
||||||
|
<option :value="null">{{ i18n.ts.none }}</option>
|
||||||
|
<option value="relative">{{ i18n.ts._accountSettings.notesHavePassedSpecifiedPeriod }}</option>
|
||||||
|
<option value="absolute">{{ i18n.ts._accountSettings.notesOlderThanSpecifiedDateAndTime }}</option>
|
||||||
|
</MkSelect>
|
||||||
|
|
||||||
|
<MkSelect v-if="makeNotesHiddenBefore_type === 'relative'" v-model="makeNotesHiddenBefore">
|
||||||
|
<option :value="-3600">{{ i18n.ts.oneHour }}</option>
|
||||||
|
<option :value="-86400">{{ i18n.ts.oneDay }}</option>
|
||||||
|
<option :value="-259200">{{ i18n.ts.threeDays }}</option>
|
||||||
|
<option :value="-604800">{{ i18n.ts.oneWeek }}</option>
|
||||||
|
<option :value="-2592000">{{ i18n.ts.oneMonth }}</option>
|
||||||
|
<option :value="-7776000">{{ i18n.ts.threeMonths }}</option>
|
||||||
|
<option :value="-31104000">{{ i18n.ts.oneYear }}</option>
|
||||||
|
</MkSelect>
|
||||||
|
|
||||||
|
<MkInput
|
||||||
|
v-if="makeNotesHiddenBefore_type === 'absolute'"
|
||||||
|
:modelValue="formatDateTimeString(new Date(makeNotesHiddenBefore * 1000), 'yyyy-MM-dd')"
|
||||||
|
type="date"
|
||||||
|
:manualSave="true"
|
||||||
|
@update:modelValue="makeNotesHiddenBefore = Math.floor(new Date($event).getTime() / 1000)"
|
||||||
|
>
|
||||||
|
</MkInput>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<template #caption>
|
||||||
|
<div>{{ i18n.ts._accountSettings.makeNotesHiddenBeforeDescription }}</div>
|
||||||
|
<div><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.mayNotEffectForFederatedNotes }}</div>
|
||||||
|
</template>
|
||||||
|
</FormSlot>
|
||||||
</div>
|
</div>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
|
|
||||||
|
@ -87,7 +159,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed, watch } from 'vue';
|
||||||
import MkSwitch from '@/components/MkSwitch.vue';
|
import MkSwitch from '@/components/MkSwitch.vue';
|
||||||
import MkSelect from '@/components/MkSelect.vue';
|
import MkSelect from '@/components/MkSelect.vue';
|
||||||
import FormSection from '@/components/form/section.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
|
@ -97,6 +169,9 @@ import { defaultStore } from '@/store.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { signinRequired } from '@/account.js';
|
import { signinRequired } from '@/account.js';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
|
import FormSlot from '@/components/form/slot.vue';
|
||||||
|
import { formatDateTimeString } from '@/scripts/format-time-string.js';
|
||||||
|
import MkInput from '@/components/MkInput.vue';
|
||||||
|
|
||||||
const $i = signinRequired();
|
const $i = signinRequired();
|
||||||
|
|
||||||
|
@ -106,6 +181,8 @@ const noCrawle = ref($i.noCrawle);
|
||||||
const preventAiLearning = ref($i.preventAiLearning);
|
const preventAiLearning = ref($i.preventAiLearning);
|
||||||
const isExplorable = ref($i.isExplorable);
|
const isExplorable = ref($i.isExplorable);
|
||||||
const requireSigninToViewContents = ref($i.requireSigninToViewContents ?? false);
|
const requireSigninToViewContents = ref($i.requireSigninToViewContents ?? false);
|
||||||
|
const makeNotesFollowersOnlyBefore = ref($i.makeNotesFollowersOnlyBefore ?? null);
|
||||||
|
const makeNotesHiddenBefore = ref($i.makeNotesHiddenBefore ?? null);
|
||||||
const hideOnlineStatus = ref($i.hideOnlineStatus);
|
const hideOnlineStatus = ref($i.hideOnlineStatus);
|
||||||
const publicReactions = ref($i.publicReactions);
|
const publicReactions = ref($i.publicReactions);
|
||||||
const followingVisibility = ref($i.followingVisibility);
|
const followingVisibility = ref($i.followingVisibility);
|
||||||
|
@ -116,6 +193,30 @@ const defaultNoteLocalOnly = computed(defaultStore.makeGetterSetter('defaultNote
|
||||||
const rememberNoteVisibility = computed(defaultStore.makeGetterSetter('rememberNoteVisibility'));
|
const rememberNoteVisibility = computed(defaultStore.makeGetterSetter('rememberNoteVisibility'));
|
||||||
const keepCw = computed(defaultStore.makeGetterSetter('keepCw'));
|
const keepCw = computed(defaultStore.makeGetterSetter('keepCw'));
|
||||||
|
|
||||||
|
const makeNotesFollowersOnlyBefore_type = computed(() => {
|
||||||
|
if (makeNotesFollowersOnlyBefore.value == null) {
|
||||||
|
return null;
|
||||||
|
} else if (makeNotesFollowersOnlyBefore.value >= 0) {
|
||||||
|
return 'absolute';
|
||||||
|
} else {
|
||||||
|
return 'relative';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const makeNotesHiddenBefore_type = computed(() => {
|
||||||
|
if (makeNotesHiddenBefore.value == null) {
|
||||||
|
return null;
|
||||||
|
} else if (makeNotesHiddenBefore.value >= 0) {
|
||||||
|
return 'absolute';
|
||||||
|
} else {
|
||||||
|
return 'relative';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
watch([makeNotesFollowersOnlyBefore, makeNotesHiddenBefore], () => {
|
||||||
|
save();
|
||||||
|
});
|
||||||
|
|
||||||
function save() {
|
function save() {
|
||||||
misskeyApi('i/update', {
|
misskeyApi('i/update', {
|
||||||
isLocked: !!isLocked.value,
|
isLocked: !!isLocked.value,
|
||||||
|
@ -124,6 +225,8 @@ function save() {
|
||||||
preventAiLearning: !!preventAiLearning.value,
|
preventAiLearning: !!preventAiLearning.value,
|
||||||
isExplorable: !!isExplorable.value,
|
isExplorable: !!isExplorable.value,
|
||||||
requireSigninToViewContents: !!requireSigninToViewContents.value,
|
requireSigninToViewContents: !!requireSigninToViewContents.value,
|
||||||
|
makeNotesFollowersOnlyBefore: makeNotesFollowersOnlyBefore.value,
|
||||||
|
makeNotesHiddenBefore: makeNotesHiddenBefore.value,
|
||||||
hideOnlineStatus: !!hideOnlineStatus.value,
|
hideOnlineStatus: !!hideOnlineStatus.value,
|
||||||
publicReactions: !!publicReactions.value,
|
publicReactions: !!publicReactions.value,
|
||||||
followingVisibility: followingVisibility.value,
|
followingVisibility: followingVisibility.value,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"name": "misskey-js",
|
"name": "misskey-js",
|
||||||
"version": "2024.10.1",
|
"version": "2024.10.2-alpha.0",
|
||||||
"description": "Misskey SDK for JavaScript",
|
"description": "Misskey SDK for JavaScript",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./built/index.js",
|
"main": "./built/index.js",
|
||||||
|
|
|
@ -3737,6 +3737,8 @@ export type components = {
|
||||||
isBot?: boolean;
|
isBot?: boolean;
|
||||||
isCat?: boolean;
|
isCat?: boolean;
|
||||||
requireSigninToViewContents?: boolean;
|
requireSigninToViewContents?: boolean;
|
||||||
|
makeNotesFollowersOnlyBefore?: number | null;
|
||||||
|
makeNotesHiddenBefore?: number | null;
|
||||||
instance?: {
|
instance?: {
|
||||||
name: string | null;
|
name: string | null;
|
||||||
softwareName: string | null;
|
softwareName: string | null;
|
||||||
|
@ -19846,6 +19848,8 @@ export type operations = {
|
||||||
noCrawle?: boolean;
|
noCrawle?: boolean;
|
||||||
preventAiLearning?: boolean;
|
preventAiLearning?: boolean;
|
||||||
requireSigninToViewContents?: boolean;
|
requireSigninToViewContents?: boolean;
|
||||||
|
makeNotesFollowersOnlyBefore?: number | null;
|
||||||
|
makeNotesHiddenBefore?: number | null;
|
||||||
isBot?: boolean;
|
isBot?: boolean;
|
||||||
isCat?: boolean;
|
isCat?: boolean;
|
||||||
injectFeaturedNote?: boolean;
|
injectFeaturedNote?: boolean;
|
||||||
|
|
Loading…
Reference in New Issue