Compare commits
36 Commits
2023.12.0-
...
2023.11.1
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9784d10c62 | ||
![]() |
0c2dd33593 | ||
![]() |
3043b5256d | ||
![]() |
7e7138c0eb | ||
![]() |
f964ef163b | ||
![]() |
0e6cd577cc | ||
![]() |
7adc8fcaf5 | ||
![]() |
e57b536767 | ||
![]() |
f32915b515 | ||
![]() |
a8d45d4b0d | ||
![]() |
4e24aff408 | ||
![]() |
e64a81aa1d | ||
![]() |
7093662ce5 | ||
![]() |
32c741154d | ||
![]() |
407a965c1d | ||
![]() |
de6348e8a0 | ||
![]() |
9ad57324db | ||
![]() |
94690c835e | ||
![]() |
c5d2dba28d | ||
![]() |
272e0c874f | ||
![]() |
d429f810a9 | ||
![]() |
75b28d6782 | ||
![]() |
8b1362ab03 | ||
![]() |
a096f621cf | ||
![]() |
f54a9542bb | ||
![]() |
a52bbc7c8d | ||
![]() |
59768bdf3f | ||
![]() |
1e67e9c661 | ||
![]() |
ae517a99a7 | ||
![]() |
b23a9b1a88 | ||
![]() |
5bd68aa3e0 | ||
![]() |
647ce174b3 | ||
![]() |
02c8fd9de5 | ||
![]() |
1ba49b614d | ||
![]() |
40de14415c | ||
![]() |
7c9330a02f |
@@ -8,7 +8,7 @@
|
|||||||
"version": "8.9.2"
|
"version": "8.9.2"
|
||||||
},
|
},
|
||||||
"ghcr.io/devcontainers/features/node:1": {
|
"ghcr.io/devcontainers/features/node:1": {
|
||||||
"version": "20.10.0"
|
"version": "20.5.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"forwardPorts": [3000],
|
"forwardPorts": [3000],
|
||||||
|
150
.github/workflows/get-api-diff.yml
vendored
150
.github/workflows/get-api-diff.yml
vendored
@@ -6,33 +6,37 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- develop
|
- develop
|
||||||
paths:
|
|
||||||
- packages/backend/**
|
|
||||||
- .github/workflows/get-api-diff.yml
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
get-from-misskey:
|
get-base:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [20.10.0]
|
node-version: [20.5.1]
|
||||||
api-json-name: [api-base.json, api-head.json]
|
|
||||||
include:
|
services:
|
||||||
- api-json-name: api-base.json
|
db:
|
||||||
repo-name: ${{ github.event.pull_request.base.repo.full_name }}
|
image: postgres:13
|
||||||
ref: ${{ github.base_ref }}
|
ports:
|
||||||
- api-json-name: api-head.json
|
- 5432:5432
|
||||||
repo-name: ${{ github.event.pull_request.head.repo.full_name }}
|
env:
|
||||||
ref: ${{ github.head_ref }}
|
POSTGRES_DB: misskey
|
||||||
|
POSTGRES_HOST_AUTH_METHOD: trust
|
||||||
|
POSTGRES_USER: example-misskey-user
|
||||||
|
POSTGRESS_PASS: example-misskey-pass
|
||||||
|
redis:
|
||||||
|
image: redis:7
|
||||||
|
ports:
|
||||||
|
- 6379:6379
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.1
|
- uses: actions/checkout@v4.1.1
|
||||||
with:
|
with:
|
||||||
repository: ${{ matrix.repo-name }}
|
repository: ${{ github.event.pull_request.base.repo.full_name }}
|
||||||
ref: ${{ matrix.ref }}
|
ref: ${{ github.base_ref }}
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v2
|
uses: pnpm/action-setup@v2
|
||||||
@@ -52,15 +56,121 @@ jobs:
|
|||||||
run: cp .config/example.yml .config/default.yml
|
run: cp .config/example.yml .config/default.yml
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
- name: Generate API JSON
|
- name : Migrate
|
||||||
run: pnpm --filter backend generate-api-json
|
run: pnpm migrate
|
||||||
- name: Copy API.json
|
- name: Launch misskey
|
||||||
run: cp packages/backend/built/api.json ${{ matrix.api-json-name }}
|
run: |
|
||||||
|
screen -S misskey -dm pnpm run dev
|
||||||
|
sleep 30s
|
||||||
|
- name: Wait for Misskey to be ready
|
||||||
|
run: |
|
||||||
|
MAX_RETRIES=12
|
||||||
|
RETRY_DELAY=5
|
||||||
|
count=0
|
||||||
|
until $(curl --output /dev/null --silent --head --fail http://localhost:3000) || [[ $count -eq $MAX_RETRIES ]]; do
|
||||||
|
printf '.'
|
||||||
|
sleep $RETRY_DELAY
|
||||||
|
count=$((count + 1))
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ $count -eq $MAX_RETRIES ]]; then
|
||||||
|
echo "Failed to connect to Misskey after $MAX_RETRIES attempts."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
- id: fetch
|
||||||
|
name: Get api.json from Misskey
|
||||||
|
run: |
|
||||||
|
RESULT=$(curl --retry 5 --retry-delay 5 --retry-max-time 60 http://localhost:3000/api.json)
|
||||||
|
echo $RESULT > api-base.json
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: api-artifact
|
name: api-artifact
|
||||||
path: ${{ matrix.api-json-name }}
|
path: api-base.json
|
||||||
|
- name: Kill Misskey Job
|
||||||
|
run: screen -S misskey -X quit
|
||||||
|
|
||||||
|
get-head:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [20.5.1]
|
||||||
|
|
||||||
|
services:
|
||||||
|
db:
|
||||||
|
image: postgres:13
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
env:
|
||||||
|
POSTGRES_DB: misskey
|
||||||
|
POSTGRES_HOST_AUTH_METHOD: trust
|
||||||
|
POSTGRES_USER: example-misskey-user
|
||||||
|
POSTGRESS_PASS: example-misskey-pass
|
||||||
|
redis:
|
||||||
|
image: redis:7
|
||||||
|
ports:
|
||||||
|
- 6379:6379
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4.1.1
|
||||||
|
with:
|
||||||
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
|
ref: ${{ github.head_ref }}
|
||||||
|
submodules: true
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v2
|
||||||
|
with:
|
||||||
|
version: 8
|
||||||
|
run_install: false
|
||||||
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
|
uses: actions/setup-node@v4.0.0
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
cache: 'pnpm'
|
||||||
|
- run: corepack enable
|
||||||
|
- run: pnpm i --frozen-lockfile
|
||||||
|
- name: Check pnpm-lock.yaml
|
||||||
|
run: git diff --exit-code pnpm-lock.yaml
|
||||||
|
- name: Copy Configure
|
||||||
|
run: cp .config/example.yml .config/default.yml
|
||||||
|
- name: Build
|
||||||
|
run: pnpm build
|
||||||
|
- name : Migrate
|
||||||
|
run: pnpm migrate
|
||||||
|
- name: Launch misskey
|
||||||
|
run: |
|
||||||
|
screen -S misskey -dm pnpm run dev
|
||||||
|
sleep 30s
|
||||||
|
- name: Wait for Misskey to be ready
|
||||||
|
run: |
|
||||||
|
MAX_RETRIES=12
|
||||||
|
RETRY_DELAY=5
|
||||||
|
count=0
|
||||||
|
until $(curl --output /dev/null --silent --head --fail http://localhost:3000) || [[ $count -eq $MAX_RETRIES ]]; do
|
||||||
|
printf '.'
|
||||||
|
sleep $RETRY_DELAY
|
||||||
|
count=$((count + 1))
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ $count -eq $MAX_RETRIES ]]; then
|
||||||
|
echo "Failed to connect to Misskey after $MAX_RETRIES attempts."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
- id: fetch
|
||||||
|
name: Get api.json from Misskey
|
||||||
|
run: |
|
||||||
|
RESULT=$(curl --retry 5 --retry-delay 5 --retry-max-time 60 http://localhost:3000/api.json)
|
||||||
|
echo $RESULT > api-head.json
|
||||||
|
- name: Upload Artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: api-artifact
|
||||||
|
path: api-head.json
|
||||||
|
- name: Kill Misskey Job
|
||||||
|
run: screen -S misskey -X quit
|
||||||
|
|
||||||
save-pr-number:
|
save-pr-number:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
2
.github/workflows/test-backend.yml
vendored
2
.github/workflows/test-backend.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [20.10.0]
|
node-version: [20.5.1]
|
||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
|
4
.github/workflows/test-frontend.yml
vendored
4
.github/workflows/test-frontend.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [20.10.0]
|
node-version: [20.5.1]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.1
|
- uses: actions/checkout@v4.1.1
|
||||||
@@ -51,7 +51,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [20.10.0]
|
node-version: [20.5.1]
|
||||||
browser: [chrome]
|
browser: [chrome]
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
2
.github/workflows/test-misskey-js.yml
vendored
2
.github/workflows/test-misskey-js.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [20.10.0]
|
node-version: [20.5.1]
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
2
.github/workflows/test-production.yml
vendored
2
.github/workflows/test-production.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [20.10.0]
|
node-version: [20.5.1]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.1
|
- uses: actions/checkout@v4.1.1
|
||||||
|
@@ -1 +1 @@
|
|||||||
20.10.0
|
20.5.1
|
||||||
|
32
CHANGELOG.md
32
CHANGELOG.md
@@ -5,48 +5,19 @@
|
|||||||
-
|
-
|
||||||
|
|
||||||
### Client
|
### Client
|
||||||
- Fix: ページ一覧ページの表示がモバイル環境において崩れているのを修正
|
-
|
||||||
|
|
||||||
### Server
|
### Server
|
||||||
-
|
-
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
## 2023.x.x (unreleased)
|
|
||||||
|
|
||||||
### General
|
|
||||||
- Feat: メールアドレスの認証にverifymail.ioを使えるように (cherry-pick from https://github.com/TeamNijimiss/misskey/commit/971ba07a44550f68d2ba31c62066db2d43a0caed)
|
|
||||||
- Feat: モデレーターがユーザーのアイコンもしくはバナー画像を未設定状態にできる機能を追加 (cherry-pick from https://github.com/TeamNijimiss/misskey/commit/e0eb5a752f6e5616d6312bb7c9790302f9dbff83)
|
|
||||||
- Feat: TL上からノートが見えなくなるワードミュートであるハードミュートを追加
|
|
||||||
- Fix: MFM `$[unixtime ]` に不正な値を入力した際に発生する各種エラーを修正
|
|
||||||
|
|
||||||
### Client
|
|
||||||
- Enhance: 絵文字のオートコンプリート機能強化 #12364
|
|
||||||
- Enhance: ユーザーのRawデータを表示するページが復活
|
|
||||||
- Enhance: リアクション選択時に音を鳴らせるように
|
|
||||||
- Enhance: サウンドにドライブのファイルを使用できるように
|
|
||||||
- fix: 「設定のバックアップ」で一部の項目がバックアップに含まれていなかった問題を修正
|
|
||||||
- Fix: ウィジェットのジョブキューにて音声の発音方法変更に追従できていなかったのを修正 #12367
|
|
||||||
- Fix: コードエディタが正しく表示されない問題を修正
|
|
||||||
- Fix: プロフィールの「ファイル」にセンシティブな画像がある際のデザインを修正
|
|
||||||
- Fix: 一度に大量の通知が入った際に通知音が音割れする問題を修正
|
|
||||||
|
|
||||||
### Server
|
|
||||||
- Enhance: MFM `$[ruby ]` が他ソフトウェアと連合されるように
|
|
||||||
- Fix: 時間経過により無効化されたアンテナを再有効化したとき、サーバ再起動までその状況が反映されないのを修正 #12303
|
|
||||||
- Fix: ロールタイムラインが保存されない問題を修正
|
|
||||||
- Fix: api.jsonの生成ロジックを改善 #12402
|
|
||||||
- Fix: 招待コードが使い回せる問題を修正
|
|
||||||
- Fix: 特定の条件下でチャンネルやユーザーのノート一覧に最新のノートが表示されなくなる問題を修正
|
|
||||||
- Fix: 何もノートしていないユーザーのフィードにアクセスするとエラーになる問題を修正
|
|
||||||
|
|
||||||
## 2023.11.1
|
## 2023.11.1
|
||||||
|
|
||||||
### General
|
### General
|
||||||
- Feat: 管理者がコントロールパネルからメールアドレスの照会を行えるようになりました
|
- Feat: 管理者がコントロールパネルからメールアドレスの照会を行えるようになりました
|
||||||
- Enhance: ローカリゼーションの更新
|
- Enhance: ローカリゼーションの更新
|
||||||
- Enhance: 依存関係の更新
|
- Enhance: 依存関係の更新
|
||||||
- Enhance: json-schema(OpenAPIの戻り値として使用されるスキーマ定義)を出来る限り最新化 #12311
|
|
||||||
|
|
||||||
### Client
|
### Client
|
||||||
- Enhance: MFMでルビを振れるように
|
- Enhance: MFMでルビを振れるように
|
||||||
@@ -55,7 +26,6 @@
|
|||||||
- 例: `$[unixtime 1701356400]`
|
- 例: `$[unixtime 1701356400]`
|
||||||
- Enhance: プラグインでエラーが発生した場合のハンドリングを強化
|
- Enhance: プラグインでエラーが発生した場合のハンドリングを強化
|
||||||
- Enhance: 細かなUIのブラッシュアップ
|
- Enhance: 細かなUIのブラッシュアップ
|
||||||
- Enhance: サウンド設定に「サウンドを出力しない」と「Misskeyがアクティブな時のみサウンドを出力する」を追加
|
|
||||||
- Fix: 効果音が再生されるとデバイスで再生している動画や音声が停止する問題を修正 #12339
|
- Fix: 効果音が再生されるとデバイスで再生している動画や音声が停止する問題を修正 #12339
|
||||||
- Fix: デッキに表示されたチャンネルの表示先チャンネルを切り替えた際、即座に反映されない問題を修正 #12236
|
- Fix: デッキに表示されたチャンネルの表示先チャンネルを切り替えた際、即座に反映されない問題を修正 #12236
|
||||||
- Fix: プラグインでノートの表示を書き換えられない問題を修正
|
- Fix: プラグインでノートの表示を書き換えられない問題を修正
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
# syntax = docker/dockerfile:1.4
|
# syntax = docker/dockerfile:1.4
|
||||||
|
|
||||||
ARG NODE_VERSION=20.10.0-bullseye
|
ARG NODE_VERSION=20.5.1-bullseye
|
||||||
|
|
||||||
# build assets & compile TypeScript
|
# build assets & compile TypeScript
|
||||||
|
|
||||||
|
@@ -564,10 +564,6 @@ output: "Output"
|
|||||||
script: "Script"
|
script: "Script"
|
||||||
disablePagesScript: "Disable AiScript on Pages"
|
disablePagesScript: "Disable AiScript on Pages"
|
||||||
updateRemoteUser: "Update remote user information"
|
updateRemoteUser: "Update remote user information"
|
||||||
unsetUserAvatar: "Delete user icon"
|
|
||||||
unsetUserAvatarConfirm: "Are you sure that you want to delete this user's icon?"
|
|
||||||
unsetUserBanner: "Delete user banner"
|
|
||||||
unsetUserBannerConfirm: "Are you sure that you want to delete this user's banner?"
|
|
||||||
deleteAllFiles: "Delete all files"
|
deleteAllFiles: "Delete all files"
|
||||||
deleteAllFilesConfirm: "Are you sure that you want to delete all files?"
|
deleteAllFilesConfirm: "Are you sure that you want to delete all files?"
|
||||||
removeAllFollowing: "Unfollow all followed users"
|
removeAllFollowing: "Unfollow all followed users"
|
||||||
|
21
locales/index.d.ts
vendored
21
locales/index.d.ts
vendored
@@ -547,8 +547,6 @@ export interface Locale {
|
|||||||
"popout": string;
|
"popout": string;
|
||||||
"volume": string;
|
"volume": string;
|
||||||
"masterVolume": string;
|
"masterVolume": string;
|
||||||
"notUseSound": string;
|
|
||||||
"useSoundOnlyWhenActive": string;
|
|
||||||
"details": string;
|
"details": string;
|
||||||
"chooseEmoji": string;
|
"chooseEmoji": string;
|
||||||
"unableToProcess": string;
|
"unableToProcess": string;
|
||||||
@@ -569,10 +567,6 @@ export interface Locale {
|
|||||||
"script": string;
|
"script": string;
|
||||||
"disablePagesScript": string;
|
"disablePagesScript": string;
|
||||||
"updateRemoteUser": string;
|
"updateRemoteUser": string;
|
||||||
"unsetUserAvatar": string;
|
|
||||||
"unsetUserAvatarConfirm": string;
|
|
||||||
"unsetUserBanner": string;
|
|
||||||
"unsetUserBannerConfirm": string;
|
|
||||||
"deleteAllFiles": string;
|
"deleteAllFiles": string;
|
||||||
"deleteAllFilesConfirm": string;
|
"deleteAllFilesConfirm": string;
|
||||||
"removeAllFollowing": string;
|
"removeAllFollowing": string;
|
||||||
@@ -644,7 +638,6 @@ export interface Locale {
|
|||||||
"smtpSecureInfo": string;
|
"smtpSecureInfo": string;
|
||||||
"testEmail": string;
|
"testEmail": string;
|
||||||
"wordMute": string;
|
"wordMute": string;
|
||||||
"hardWordMute": string;
|
|
||||||
"regexpError": string;
|
"regexpError": string;
|
||||||
"regexpErrorDescription": string;
|
"regexpErrorDescription": string;
|
||||||
"instanceMute": string;
|
"instanceMute": string;
|
||||||
@@ -1042,7 +1035,6 @@ export interface Locale {
|
|||||||
"enableChartsForFederatedInstances": string;
|
"enableChartsForFederatedInstances": string;
|
||||||
"showClipButtonInNoteFooter": string;
|
"showClipButtonInNoteFooter": string;
|
||||||
"reactionsDisplaySize": string;
|
"reactionsDisplaySize": string;
|
||||||
"limitWidthOfReaction": string;
|
|
||||||
"noteIdOrUrl": string;
|
"noteIdOrUrl": string;
|
||||||
"video": string;
|
"video": string;
|
||||||
"videos": string;
|
"videos": string;
|
||||||
@@ -1645,9 +1637,7 @@ export interface Locale {
|
|||||||
"assignTarget": string;
|
"assignTarget": string;
|
||||||
"descriptionOfAssignTarget": string;
|
"descriptionOfAssignTarget": string;
|
||||||
"manual": string;
|
"manual": string;
|
||||||
"manualRoles": string;
|
|
||||||
"conditional": string;
|
"conditional": string;
|
||||||
"conditionalRoles": string;
|
|
||||||
"condition": string;
|
"condition": string;
|
||||||
"isConditionalRole": string;
|
"isConditionalRole": string;
|
||||||
"isPublic": string;
|
"isPublic": string;
|
||||||
@@ -1945,15 +1935,6 @@ export interface Locale {
|
|||||||
"notification": string;
|
"notification": string;
|
||||||
"antenna": string;
|
"antenna": string;
|
||||||
"channel": string;
|
"channel": string;
|
||||||
"reaction": string;
|
|
||||||
};
|
|
||||||
"_soundSettings": {
|
|
||||||
"driveFile": string;
|
|
||||||
"driveFileWarn": string;
|
|
||||||
"driveFileTypeWarn": string;
|
|
||||||
"driveFileTypeWarnDescription": string;
|
|
||||||
"driveFileDurationWarn": string;
|
|
||||||
"driveFileDurationWarnDescription": string;
|
|
||||||
};
|
};
|
||||||
"_ago": {
|
"_ago": {
|
||||||
"future": string;
|
"future": string;
|
||||||
@@ -2432,8 +2413,6 @@ export interface Locale {
|
|||||||
"createAvatarDecoration": string;
|
"createAvatarDecoration": string;
|
||||||
"updateAvatarDecoration": string;
|
"updateAvatarDecoration": string;
|
||||||
"deleteAvatarDecoration": string;
|
"deleteAvatarDecoration": string;
|
||||||
"unsetUserAvatar": string;
|
|
||||||
"unsetUserBanner": string;
|
|
||||||
};
|
};
|
||||||
"_fileViewer": {
|
"_fileViewer": {
|
||||||
"title": string;
|
"title": string;
|
||||||
|
@@ -544,8 +544,6 @@ showInPage: "ページで表示"
|
|||||||
popout: "ポップアウト"
|
popout: "ポップアウト"
|
||||||
volume: "音量"
|
volume: "音量"
|
||||||
masterVolume: "マスター音量"
|
masterVolume: "マスター音量"
|
||||||
notUseSound: "サウンドを出力しない"
|
|
||||||
useSoundOnlyWhenActive: "Misskeyがアクティブな時のみサウンドを出力する"
|
|
||||||
details: "詳細"
|
details: "詳細"
|
||||||
chooseEmoji: "絵文字を選択"
|
chooseEmoji: "絵文字を選択"
|
||||||
unableToProcess: "操作を完了できません"
|
unableToProcess: "操作を完了できません"
|
||||||
@@ -566,10 +564,6 @@ output: "出力"
|
|||||||
script: "スクリプト"
|
script: "スクリプト"
|
||||||
disablePagesScript: "Pagesのスクリプトを無効にする"
|
disablePagesScript: "Pagesのスクリプトを無効にする"
|
||||||
updateRemoteUser: "リモートユーザー情報の更新"
|
updateRemoteUser: "リモートユーザー情報の更新"
|
||||||
unsetUserAvatar: "アイコンを解除"
|
|
||||||
unsetUserAvatarConfirm: "アイコンを解除しますか?"
|
|
||||||
unsetUserBanner: "バナーを解除"
|
|
||||||
unsetUserBannerConfirm: "バナーを解除しますか?"
|
|
||||||
deleteAllFiles: "すべてのファイルを削除"
|
deleteAllFiles: "すべてのファイルを削除"
|
||||||
deleteAllFilesConfirm: "すべてのファイルを削除しますか?"
|
deleteAllFilesConfirm: "すべてのファイルを削除しますか?"
|
||||||
removeAllFollowing: "フォローを全解除"
|
removeAllFollowing: "フォローを全解除"
|
||||||
@@ -641,7 +635,6 @@ smtpSecure: "SMTP 接続に暗黙的なSSL/TLSを使用する"
|
|||||||
smtpSecureInfo: "STARTTLS使用時はオフにします。"
|
smtpSecureInfo: "STARTTLS使用時はオフにします。"
|
||||||
testEmail: "配信テスト"
|
testEmail: "配信テスト"
|
||||||
wordMute: "ワードミュート"
|
wordMute: "ワードミュート"
|
||||||
hardWordMute: "ハードワードミュート"
|
|
||||||
regexpError: "正規表現エラー"
|
regexpError: "正規表現エラー"
|
||||||
regexpErrorDescription: "{tab}ワードミュートの{line}行目の正規表現にエラーが発生しました:"
|
regexpErrorDescription: "{tab}ワードミュートの{line}行目の正規表現にエラーが発生しました:"
|
||||||
instanceMute: "サーバーミュート"
|
instanceMute: "サーバーミュート"
|
||||||
@@ -1039,7 +1032,6 @@ enableChartsForRemoteUser: "リモートユーザーのチャートを生成"
|
|||||||
enableChartsForFederatedInstances: "リモートサーバーのチャートを生成"
|
enableChartsForFederatedInstances: "リモートサーバーのチャートを生成"
|
||||||
showClipButtonInNoteFooter: "ノートのアクションにクリップを追加"
|
showClipButtonInNoteFooter: "ノートのアクションにクリップを追加"
|
||||||
reactionsDisplaySize: "リアクションの表示サイズ"
|
reactionsDisplaySize: "リアクションの表示サイズ"
|
||||||
limitWidthOfReaction: "リアクションの最大横幅を制限し、縮小して表示する"
|
|
||||||
noteIdOrUrl: "ノートIDまたはURL"
|
noteIdOrUrl: "ノートIDまたはURL"
|
||||||
video: "動画"
|
video: "動画"
|
||||||
videos: "動画"
|
videos: "動画"
|
||||||
@@ -1555,9 +1547,7 @@ _role:
|
|||||||
assignTarget: "アサイン"
|
assignTarget: "アサイン"
|
||||||
descriptionOfAssignTarget: "<b>マニュアル</b>は誰がこのロールに含まれるかを手動で管理します。\n<b>コンディショナル</b>は条件を設定し、それに合致するユーザーが自動で含まれるようになります。"
|
descriptionOfAssignTarget: "<b>マニュアル</b>は誰がこのロールに含まれるかを手動で管理します。\n<b>コンディショナル</b>は条件を設定し、それに合致するユーザーが自動で含まれるようになります。"
|
||||||
manual: "マニュアル"
|
manual: "マニュアル"
|
||||||
manualRoles: "マニュアルロール"
|
|
||||||
conditional: "コンディショナル"
|
conditional: "コンディショナル"
|
||||||
conditionalRoles: "コンディショナルロール"
|
|
||||||
condition: "条件"
|
condition: "条件"
|
||||||
isConditionalRole: "これはコンディショナルロールです。"
|
isConditionalRole: "これはコンディショナルロールです。"
|
||||||
isPublic: "公開ロール"
|
isPublic: "公開ロール"
|
||||||
@@ -1850,15 +1840,6 @@ _sfx:
|
|||||||
notification: "通知"
|
notification: "通知"
|
||||||
antenna: "アンテナ受信"
|
antenna: "アンテナ受信"
|
||||||
channel: "チャンネル通知"
|
channel: "チャンネル通知"
|
||||||
reaction: "リアクション選択時"
|
|
||||||
|
|
||||||
_soundSettings:
|
|
||||||
driveFile: "ドライブの音声を使用"
|
|
||||||
driveFileWarn: "ドライブのファイルを選択してください"
|
|
||||||
driveFileTypeWarn: "このファイルは対応していません"
|
|
||||||
driveFileTypeWarnDescription: "音声ファイルを選択してください"
|
|
||||||
driveFileDurationWarn: "音声が長すぎます"
|
|
||||||
driveFileDurationWarnDescription: "長い音声を使用するとMisskeyの使用に支障をきたす可能性があります。それでも続行しますか?"
|
|
||||||
|
|
||||||
_ago:
|
_ago:
|
||||||
future: "未来"
|
future: "未来"
|
||||||
@@ -1870,7 +1851,7 @@ _ago:
|
|||||||
weeksAgo: "{n}週間前"
|
weeksAgo: "{n}週間前"
|
||||||
monthsAgo: "{n}ヶ月前"
|
monthsAgo: "{n}ヶ月前"
|
||||||
yearsAgo: "{n}年前"
|
yearsAgo: "{n}年前"
|
||||||
invalid: "日時の解析に失敗"
|
invalid: "ありません"
|
||||||
|
|
||||||
_timeIn:
|
_timeIn:
|
||||||
seconds: "{n}秒後"
|
seconds: "{n}秒後"
|
||||||
@@ -2333,8 +2314,6 @@ _moderationLogTypes:
|
|||||||
createAvatarDecoration: "アイコンデコレーションを作成"
|
createAvatarDecoration: "アイコンデコレーションを作成"
|
||||||
updateAvatarDecoration: "アイコンデコレーションを更新"
|
updateAvatarDecoration: "アイコンデコレーションを更新"
|
||||||
deleteAvatarDecoration: "アイコンデコレーションを削除"
|
deleteAvatarDecoration: "アイコンデコレーションを削除"
|
||||||
unsetUserAvatar: "ユーザーのアイコンを解除"
|
|
||||||
unsetUserBanner: "ユーザーのバナーを解除"
|
|
||||||
|
|
||||||
_fileViewer:
|
_fileViewer:
|
||||||
title: "ファイルの詳細"
|
title: "ファイルの詳細"
|
||||||
|
12
package.json
12
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "misskey",
|
"name": "misskey",
|
||||||
"version": "2023.12.0-beta.1",
|
"version": "2023.11.1",
|
||||||
"codename": "nasubi",
|
"codename": "nasubi",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -49,14 +49,14 @@
|
|||||||
"js-yaml": "4.1.0",
|
"js-yaml": "4.1.0",
|
||||||
"postcss": "8.4.31",
|
"postcss": "8.4.31",
|
||||||
"terser": "5.24.0",
|
"terser": "5.24.0",
|
||||||
"typescript": "5.3.2"
|
"typescript": "5.2.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "6.12.0",
|
"@typescript-eslint/eslint-plugin": "6.11.0",
|
||||||
"@typescript-eslint/parser": "6.12.0",
|
"@typescript-eslint/parser": "6.11.0",
|
||||||
"cross-env": "7.0.3",
|
"cross-env": "7.0.3",
|
||||||
"cypress": "13.6.0",
|
"cypress": "13.5.1",
|
||||||
"eslint": "8.54.0",
|
"eslint": "8.53.0",
|
||||||
"start-server-and-test": "2.0.3"
|
"start-server-and-test": "2.0.3"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
|
@@ -1,8 +0,0 @@
|
|||||||
import { loadConfig } from './built/config.js'
|
|
||||||
import { genOpenapiSpec } from './built/server/api/openapi/gen-spec.js'
|
|
||||||
import { writeFileSync } from "node:fs";
|
|
||||||
|
|
||||||
const config = loadConfig();
|
|
||||||
const spec = genOpenapiSpec(config);
|
|
||||||
|
|
||||||
writeFileSync('./built/api.json', JSON.stringify(spec), 'utf-8');
|
|
@@ -1,18 +0,0 @@
|
|||||||
/*
|
|
||||||
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
*/
|
|
||||||
|
|
||||||
export class SupportVerifyMailApi1700303245007 {
|
|
||||||
name = 'SupportVerifyMailApi1700303245007'
|
|
||||||
|
|
||||||
async up(queryRunner) {
|
|
||||||
await queryRunner.query(`ALTER TABLE "meta" ADD "verifymailAuthKey" character varying(1024)`);
|
|
||||||
await queryRunner.query(`ALTER TABLE "meta" ADD "enableVerifymailApi" boolean NOT NULL DEFAULT false`);
|
|
||||||
}
|
|
||||||
|
|
||||||
async down(queryRunner) {
|
|
||||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableVerifymailApi"`);
|
|
||||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "verifymailAuthKey"`);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,11 +0,0 @@
|
|||||||
export class HardMute1700383825690 {
|
|
||||||
name = 'HardMute1700383825690'
|
|
||||||
|
|
||||||
async up(queryRunner) {
|
|
||||||
await queryRunner.query(`ALTER TABLE "user_profile" ADD "hardMutedWords" jsonb NOT NULL DEFAULT '[]'`);
|
|
||||||
}
|
|
||||||
|
|
||||||
async down(queryRunner) {
|
|
||||||
await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "hardMutedWords"`);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -7,8 +7,8 @@
|
|||||||
"node": ">=18.16.0"
|
"node": ">=18.16.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node ./built/boot/entry.js",
|
"start": "node ./built/index.js",
|
||||||
"start:test": "NODE_ENV=test node ./built/boot/entry.js",
|
"start:test": "NODE_ENV=test node ./built/index.js",
|
||||||
"migrate": "pnpm typeorm migration:run -d ormconfig.js",
|
"migrate": "pnpm typeorm migration:run -d ormconfig.js",
|
||||||
"revert": "pnpm typeorm migration:revert -d ormconfig.js",
|
"revert": "pnpm typeorm migration:revert -d ormconfig.js",
|
||||||
"check:connect": "node ./check_connect.js",
|
"check:connect": "node ./check_connect.js",
|
||||||
@@ -23,8 +23,7 @@
|
|||||||
"jest-and-coverage": "cross-env NODE_ENV=test node --experimental-vm-modules --experimental-import-meta-resolve node_modules/jest/bin/jest.js --coverage --forceExit",
|
"jest-and-coverage": "cross-env NODE_ENV=test node --experimental-vm-modules --experimental-import-meta-resolve node_modules/jest/bin/jest.js --coverage --forceExit",
|
||||||
"jest-clear": "cross-env NODE_ENV=test node --experimental-vm-modules --experimental-import-meta-resolve node_modules/jest/bin/jest.js --clearCache",
|
"jest-clear": "cross-env NODE_ENV=test node --experimental-vm-modules --experimental-import-meta-resolve node_modules/jest/bin/jest.js --clearCache",
|
||||||
"test": "pnpm jest",
|
"test": "pnpm jest",
|
||||||
"test-and-coverage": "pnpm jest-and-coverage",
|
"test-and-coverage": "pnpm jest-and-coverage"
|
||||||
"generate-api-json": "node ./generate_api_json.js"
|
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@swc/core-android-arm64": "1.3.11",
|
"@swc/core-android-arm64": "1.3.11",
|
||||||
@@ -60,9 +59,9 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-s3": "3.412.0",
|
"@aws-sdk/client-s3": "3.412.0",
|
||||||
"@aws-sdk/lib-storage": "3.412.0",
|
"@aws-sdk/lib-storage": "3.412.0",
|
||||||
"@bull-board/api": "5.9.2",
|
"@bull-board/api": "5.9.1",
|
||||||
"@bull-board/fastify": "5.9.2",
|
"@bull-board/fastify": "5.9.1",
|
||||||
"@bull-board/ui": "5.9.2",
|
"@bull-board/ui": "5.9.1",
|
||||||
"@discordapp/twemoji": "14.1.2",
|
"@discordapp/twemoji": "14.1.2",
|
||||||
"@fastify/accepts": "4.2.0",
|
"@fastify/accepts": "4.2.0",
|
||||||
"@fastify/cookie": "9.2.0",
|
"@fastify/cookie": "9.2.0",
|
||||||
@@ -72,15 +71,15 @@
|
|||||||
"@fastify/multipart": "8.0.0",
|
"@fastify/multipart": "8.0.0",
|
||||||
"@fastify/static": "6.12.0",
|
"@fastify/static": "6.12.0",
|
||||||
"@fastify/view": "8.2.0",
|
"@fastify/view": "8.2.0",
|
||||||
"@nestjs/common": "10.2.10",
|
"@nestjs/common": "10.2.8",
|
||||||
"@nestjs/core": "10.2.10",
|
"@nestjs/core": "10.2.8",
|
||||||
"@nestjs/testing": "10.2.10",
|
"@nestjs/testing": "10.2.8",
|
||||||
"@peertube/http-signature": "1.7.0",
|
"@peertube/http-signature": "1.7.0",
|
||||||
"@simplewebauthn/server": "8.3.5",
|
"@simplewebauthn/server": "8.3.5",
|
||||||
"@sinonjs/fake-timers": "11.2.2",
|
"@sinonjs/fake-timers": "11.2.2",
|
||||||
"@smithy/node-http-handler": "2.1.10",
|
"@smithy/node-http-handler": "2.1.5",
|
||||||
"@swc/cli": "0.1.63",
|
"@swc/cli": "0.1.63",
|
||||||
"@swc/core": "1.3.99",
|
"@swc/core": "1.3.96",
|
||||||
"accepts": "1.3.8",
|
"accepts": "1.3.8",
|
||||||
"ajv": "8.12.0",
|
"ajv": "8.12.0",
|
||||||
"archiver": "6.0.1",
|
"archiver": "6.0.1",
|
||||||
@@ -88,7 +87,7 @@
|
|||||||
"bcryptjs": "2.4.3",
|
"bcryptjs": "2.4.3",
|
||||||
"blurhash": "2.0.5",
|
"blurhash": "2.0.5",
|
||||||
"body-parser": "1.20.2",
|
"body-parser": "1.20.2",
|
||||||
"bullmq": "4.14.2",
|
"bullmq": "4.13.3",
|
||||||
"cacheable-lookup": "7.0.0",
|
"cacheable-lookup": "7.0.0",
|
||||||
"cbor": "9.0.1",
|
"cbor": "9.0.1",
|
||||||
"chalk": "5.3.0",
|
"chalk": "5.3.0",
|
||||||
@@ -114,11 +113,11 @@
|
|||||||
"ipaddr.js": "2.1.0",
|
"ipaddr.js": "2.1.0",
|
||||||
"is-svg": "5.0.0",
|
"is-svg": "5.0.0",
|
||||||
"js-yaml": "4.1.0",
|
"js-yaml": "4.1.0",
|
||||||
"jsdom": "23.0.0",
|
"jsdom": "22.1.0",
|
||||||
"json5": "2.2.3",
|
"json5": "2.2.3",
|
||||||
"jsonld": "8.3.1",
|
"jsonld": "8.3.1",
|
||||||
"jsrsasign": "10.9.0",
|
"jsrsasign": "10.8.6",
|
||||||
"meilisearch": "0.36.0",
|
"meilisearch": "0.35.0",
|
||||||
"mfm-js": "0.23.3",
|
"mfm-js": "0.23.3",
|
||||||
"microformats-parser": "1.5.2",
|
"microformats-parser": "1.5.2",
|
||||||
"mime-types": "2.1.35",
|
"mime-types": "2.1.35",
|
||||||
@@ -145,7 +144,7 @@
|
|||||||
"qrcode": "1.5.3",
|
"qrcode": "1.5.3",
|
||||||
"random-seed": "0.3.0",
|
"random-seed": "0.3.0",
|
||||||
"ratelimiter": "3.4.1",
|
"ratelimiter": "3.4.1",
|
||||||
"re2": "1.20.9",
|
"re2": "1.20.8",
|
||||||
"redis-lock": "0.1.4",
|
"redis-lock": "0.1.4",
|
||||||
"reflect-metadata": "0.1.13",
|
"reflect-metadata": "0.1.13",
|
||||||
"rename": "1.0.4",
|
"rename": "1.0.4",
|
||||||
@@ -159,14 +158,14 @@
|
|||||||
"strict-event-emitter-types": "2.0.0",
|
"strict-event-emitter-types": "2.0.0",
|
||||||
"stringz": "2.1.0",
|
"stringz": "2.1.0",
|
||||||
"summaly": "github:misskey-dev/summaly",
|
"summaly": "github:misskey-dev/summaly",
|
||||||
"systeminformation": "5.21.18",
|
"systeminformation": "5.21.17",
|
||||||
"tinycolor2": "1.6.0",
|
"tinycolor2": "1.6.0",
|
||||||
"tmp": "0.2.1",
|
"tmp": "0.2.1",
|
||||||
"tsc-alias": "1.8.8",
|
"tsc-alias": "1.8.8",
|
||||||
"tsconfig-paths": "4.2.0",
|
"tsconfig-paths": "4.2.0",
|
||||||
"twemoji-parser": "14.0.0",
|
"twemoji-parser": "14.0.0",
|
||||||
"typeorm": "0.3.17",
|
"typeorm": "0.3.17",
|
||||||
"typescript": "5.3.2",
|
"typescript": "5.2.2",
|
||||||
"ulid": "2.3.0",
|
"ulid": "2.3.0",
|
||||||
"vary": "1.1.2",
|
"vary": "1.1.2",
|
||||||
"web-push": "3.6.6",
|
"web-push": "3.6.6",
|
||||||
@@ -178,7 +177,7 @@
|
|||||||
"@simplewebauthn/typescript-types": "8.3.4",
|
"@simplewebauthn/typescript-types": "8.3.4",
|
||||||
"@swc/jest": "0.2.29",
|
"@swc/jest": "0.2.29",
|
||||||
"@types/accepts": "1.3.7",
|
"@types/accepts": "1.3.7",
|
||||||
"@types/archiver": "6.0.2",
|
"@types/archiver": "6.0.1",
|
||||||
"@types/bcryptjs": "2.4.6",
|
"@types/bcryptjs": "2.4.6",
|
||||||
"@types/body-parser": "1.19.5",
|
"@types/body-parser": "1.19.5",
|
||||||
"@types/cbor": "6.0.0",
|
"@types/cbor": "6.0.0",
|
||||||
@@ -186,28 +185,28 @@
|
|||||||
"@types/content-disposition": "0.5.8",
|
"@types/content-disposition": "0.5.8",
|
||||||
"@types/fluent-ffmpeg": "2.1.24",
|
"@types/fluent-ffmpeg": "2.1.24",
|
||||||
"@types/http-link-header": "1.0.5",
|
"@types/http-link-header": "1.0.5",
|
||||||
"@types/jest": "29.5.10",
|
"@types/jest": "29.5.8",
|
||||||
"@types/js-yaml": "4.0.9",
|
"@types/js-yaml": "4.0.9",
|
||||||
"@types/jsdom": "21.1.6",
|
"@types/jsdom": "21.1.5",
|
||||||
"@types/jsonld": "1.5.13",
|
"@types/jsonld": "1.5.12",
|
||||||
"@types/jsrsasign": "10.5.12",
|
"@types/jsrsasign": "10.5.12",
|
||||||
"@types/mime-types": "2.1.4",
|
"@types/mime-types": "2.1.4",
|
||||||
"@types/ms": "0.7.34",
|
"@types/ms": "0.7.34",
|
||||||
"@types/node": "20.10.0",
|
"@types/node": "20.9.1",
|
||||||
"@types/node-fetch": "3.0.3",
|
"@types/node-fetch": "3.0.3",
|
||||||
"@types/nodemailer": "6.4.14",
|
"@types/nodemailer": "6.4.14",
|
||||||
"@types/oauth": "0.9.4",
|
"@types/oauth": "0.9.4",
|
||||||
"@types/oauth2orize": "1.11.3",
|
"@types/oauth2orize": "1.11.3",
|
||||||
"@types/oauth2orize-pkce": "0.1.2",
|
"@types/oauth2orize-pkce": "0.1.2",
|
||||||
"@types/pg": "8.10.9",
|
"@types/pg": "8.10.9",
|
||||||
"@types/pug": "2.0.10",
|
"@types/pug": "2.0.9",
|
||||||
"@types/punycode": "2.1.3",
|
"@types/punycode": "2.1.2",
|
||||||
"@types/qrcode": "1.5.5",
|
"@types/qrcode": "1.5.5",
|
||||||
"@types/random-seed": "0.3.5",
|
"@types/random-seed": "0.3.5",
|
||||||
"@types/ratelimiter": "3.4.6",
|
"@types/ratelimiter": "3.4.6",
|
||||||
"@types/rename": "1.0.7",
|
"@types/rename": "1.0.7",
|
||||||
"@types/sanitize-html": "2.9.5",
|
"@types/sanitize-html": "2.9.4",
|
||||||
"@types/semver": "7.5.6",
|
"@types/semver": "7.5.5",
|
||||||
"@types/sharp": "0.32.0",
|
"@types/sharp": "0.32.0",
|
||||||
"@types/simple-oauth2": "5.0.7",
|
"@types/simple-oauth2": "5.0.7",
|
||||||
"@types/sinonjs__fake-timers": "8.1.5",
|
"@types/sinonjs__fake-timers": "8.1.5",
|
||||||
@@ -215,12 +214,12 @@
|
|||||||
"@types/tmp": "0.2.6",
|
"@types/tmp": "0.2.6",
|
||||||
"@types/vary": "1.1.3",
|
"@types/vary": "1.1.3",
|
||||||
"@types/web-push": "3.6.3",
|
"@types/web-push": "3.6.3",
|
||||||
"@types/ws": "8.5.10",
|
"@types/ws": "8.5.9",
|
||||||
"@typescript-eslint/eslint-plugin": "6.12.0",
|
"@typescript-eslint/eslint-plugin": "6.11.0",
|
||||||
"@typescript-eslint/parser": "6.12.0",
|
"@typescript-eslint/parser": "6.11.0",
|
||||||
"aws-sdk-client-mock": "3.0.0",
|
"aws-sdk-client-mock": "3.0.0",
|
||||||
"cross-env": "7.0.3",
|
"cross-env": "7.0.3",
|
||||||
"eslint": "8.54.0",
|
"eslint": "8.53.0",
|
||||||
"eslint-plugin-import": "2.29.0",
|
"eslint-plugin-import": "2.29.0",
|
||||||
"execa": "8.0.1",
|
"execa": "8.0.1",
|
||||||
"jest": "29.7.0",
|
"jest": "29.7.0",
|
||||||
|
@@ -16,7 +16,7 @@ import type { AntennasRepository, UserListMembershipsRepository } from '@/models
|
|||||||
import { UtilityService } from '@/core/UtilityService.js';
|
import { UtilityService } from '@/core/UtilityService.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
import type { GlobalEvents } from '@/core/GlobalEventService.js';
|
import type { GlobalEvents } from '@/core/GlobalEventService.js';
|
||||||
import { FanoutTimelineService } from '@/core/FanoutTimelineService.js';
|
import { FunoutTimelineService } from '@/core/FunoutTimelineService.js';
|
||||||
import type { OnApplicationShutdown } from '@nestjs/common';
|
import type { OnApplicationShutdown } from '@nestjs/common';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@@ -39,7 +39,7 @@ export class AntennaService implements OnApplicationShutdown {
|
|||||||
|
|
||||||
private utilityService: UtilityService,
|
private utilityService: UtilityService,
|
||||||
private globalEventService: GlobalEventService,
|
private globalEventService: GlobalEventService,
|
||||||
private fanoutTimelineService: FanoutTimelineService,
|
private funoutTimelineService: FunoutTimelineService,
|
||||||
) {
|
) {
|
||||||
this.antennasFetched = false;
|
this.antennasFetched = false;
|
||||||
this.antennas = [];
|
this.antennas = [];
|
||||||
@@ -60,21 +60,11 @@ export class AntennaService implements OnApplicationShutdown {
|
|||||||
lastUsedAt: new Date(body.lastUsedAt),
|
lastUsedAt: new Date(body.lastUsedAt),
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'antennaUpdated': {
|
case 'antennaUpdated':
|
||||||
const idx = this.antennas.findIndex(a => a.id === body.id);
|
this.antennas[this.antennas.findIndex(a => a.id === body.id)] = {
|
||||||
if (idx >= 0) {
|
...body,
|
||||||
this.antennas[idx] = {
|
lastUsedAt: new Date(body.lastUsedAt),
|
||||||
...body,
|
};
|
||||||
lastUsedAt: new Date(body.lastUsedAt),
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
// サーバ起動時にactiveじゃなかった場合、リストに持っていないので追加する必要あり
|
|
||||||
this.antennas.push({
|
|
||||||
...body,
|
|
||||||
lastUsedAt: new Date(body.lastUsedAt),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'antennaDeleted':
|
case 'antennaDeleted':
|
||||||
this.antennas = this.antennas.filter(a => a.id !== body.id);
|
this.antennas = this.antennas.filter(a => a.id !== body.id);
|
||||||
@@ -94,7 +84,7 @@ export class AntennaService implements OnApplicationShutdown {
|
|||||||
const redisPipeline = this.redisForTimelines.pipeline();
|
const redisPipeline = this.redisForTimelines.pipeline();
|
||||||
|
|
||||||
for (const antenna of matchedAntennas) {
|
for (const antenna of matchedAntennas) {
|
||||||
this.fanoutTimelineService.push(`antennaTimeline:${antenna.id}`, note.id, 200, redisPipeline);
|
this.funoutTimelineService.push(`antennaTimeline:${antenna.id}`, note.id, 200, redisPipeline);
|
||||||
this.globalEventService.publishAntennaStream(antenna.id, 'note', note);
|
this.globalEventService.publishAntennaStream(antenna.id, 'note', note);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -62,7 +62,7 @@ import { FileInfoService } from './FileInfoService.js';
|
|||||||
import { SearchService } from './SearchService.js';
|
import { SearchService } from './SearchService.js';
|
||||||
import { ClipService } from './ClipService.js';
|
import { ClipService } from './ClipService.js';
|
||||||
import { FeaturedService } from './FeaturedService.js';
|
import { FeaturedService } from './FeaturedService.js';
|
||||||
import { FanoutTimelineService } from './FanoutTimelineService.js';
|
import { FunoutTimelineService } from './FunoutTimelineService.js';
|
||||||
import { ChannelFollowingService } from './ChannelFollowingService.js';
|
import { ChannelFollowingService } from './ChannelFollowingService.js';
|
||||||
import { RegistryApiService } from './RegistryApiService.js';
|
import { RegistryApiService } from './RegistryApiService.js';
|
||||||
import { ChartLoggerService } from './chart/ChartLoggerService.js';
|
import { ChartLoggerService } from './chart/ChartLoggerService.js';
|
||||||
@@ -194,7 +194,7 @@ const $FileInfoService: Provider = { provide: 'FileInfoService', useExisting: Fi
|
|||||||
const $SearchService: Provider = { provide: 'SearchService', useExisting: SearchService };
|
const $SearchService: Provider = { provide: 'SearchService', useExisting: SearchService };
|
||||||
const $ClipService: Provider = { provide: 'ClipService', useExisting: ClipService };
|
const $ClipService: Provider = { provide: 'ClipService', useExisting: ClipService };
|
||||||
const $FeaturedService: Provider = { provide: 'FeaturedService', useExisting: FeaturedService };
|
const $FeaturedService: Provider = { provide: 'FeaturedService', useExisting: FeaturedService };
|
||||||
const $FanoutTimelineService: Provider = { provide: 'FanoutTimelineService', useExisting: FanoutTimelineService };
|
const $FunoutTimelineService: Provider = { provide: 'FunoutTimelineService', useExisting: FunoutTimelineService };
|
||||||
const $ChannelFollowingService: Provider = { provide: 'ChannelFollowingService', useExisting: ChannelFollowingService };
|
const $ChannelFollowingService: Provider = { provide: 'ChannelFollowingService', useExisting: ChannelFollowingService };
|
||||||
const $RegistryApiService: Provider = { provide: 'RegistryApiService', useExisting: RegistryApiService };
|
const $RegistryApiService: Provider = { provide: 'RegistryApiService', useExisting: RegistryApiService };
|
||||||
|
|
||||||
@@ -330,7 +330,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
|
|||||||
SearchService,
|
SearchService,
|
||||||
ClipService,
|
ClipService,
|
||||||
FeaturedService,
|
FeaturedService,
|
||||||
FanoutTimelineService,
|
FunoutTimelineService,
|
||||||
ChannelFollowingService,
|
ChannelFollowingService,
|
||||||
RegistryApiService,
|
RegistryApiService,
|
||||||
ChartLoggerService,
|
ChartLoggerService,
|
||||||
@@ -459,7 +459,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
|
|||||||
$SearchService,
|
$SearchService,
|
||||||
$ClipService,
|
$ClipService,
|
||||||
$FeaturedService,
|
$FeaturedService,
|
||||||
$FanoutTimelineService,
|
$FunoutTimelineService,
|
||||||
$ChannelFollowingService,
|
$ChannelFollowingService,
|
||||||
$RegistryApiService,
|
$RegistryApiService,
|
||||||
$ChartLoggerService,
|
$ChartLoggerService,
|
||||||
@@ -589,7 +589,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
|
|||||||
SearchService,
|
SearchService,
|
||||||
ClipService,
|
ClipService,
|
||||||
FeaturedService,
|
FeaturedService,
|
||||||
FanoutTimelineService,
|
FunoutTimelineService,
|
||||||
ChannelFollowingService,
|
ChannelFollowingService,
|
||||||
RegistryApiService,
|
RegistryApiService,
|
||||||
FederationChart,
|
FederationChart,
|
||||||
@@ -717,7 +717,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
|
|||||||
$SearchService,
|
$SearchService,
|
||||||
$ClipService,
|
$ClipService,
|
||||||
$FeaturedService,
|
$FeaturedService,
|
||||||
$FanoutTimelineService,
|
$FunoutTimelineService,
|
||||||
$ChannelFollowingService,
|
$ChannelFollowingService,
|
||||||
$RegistryApiService,
|
$RegistryApiService,
|
||||||
$FederationChart,
|
$FederationChart,
|
||||||
|
@@ -3,11 +3,9 @@
|
|||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { URLSearchParams } from 'node:url';
|
|
||||||
import * as nodemailer from 'nodemailer';
|
import * as nodemailer from 'nodemailer';
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { validate as validateEmail } from 'deep-email-validator';
|
import { validate as validateEmail } from 'deep-email-validator';
|
||||||
import { SubOutputFormat } from 'deep-email-validator/dist/output/output.js';
|
|
||||||
import { MetaService } from '@/core/MetaService.js';
|
import { MetaService } from '@/core/MetaService.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import type { Config } from '@/config.js';
|
import type { Config } from '@/config.js';
|
||||||
@@ -15,7 +13,6 @@ import type Logger from '@/logger.js';
|
|||||||
import type { UserProfilesRepository } from '@/models/_.js';
|
import type { UserProfilesRepository } from '@/models/_.js';
|
||||||
import { LoggerService } from '@/core/LoggerService.js';
|
import { LoggerService } from '@/core/LoggerService.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
import { HttpRequestService } from '@/core/HttpRequestService.js';
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class EmailService {
|
export class EmailService {
|
||||||
@@ -30,7 +27,6 @@ export class EmailService {
|
|||||||
|
|
||||||
private metaService: MetaService,
|
private metaService: MetaService,
|
||||||
private loggerService: LoggerService,
|
private loggerService: LoggerService,
|
||||||
private httpRequestService: HttpRequestService,
|
|
||||||
) {
|
) {
|
||||||
this.logger = this.loggerService.getLogger('email');
|
this.logger = this.loggerService.getLogger('email');
|
||||||
}
|
}
|
||||||
@@ -164,25 +160,14 @@ export class EmailService {
|
|||||||
email: emailAddress,
|
email: emailAddress,
|
||||||
});
|
});
|
||||||
|
|
||||||
const verifymailApi = meta.enableVerifymailApi && meta.verifymailAuthKey != null;
|
const validated = meta.enableActiveEmailValidation ? await validateEmail({
|
||||||
let validated;
|
email: emailAddress,
|
||||||
|
validateRegex: true,
|
||||||
if (meta.enableActiveEmailValidation && meta.verifymailAuthKey) {
|
validateMx: true,
|
||||||
if (verifymailApi) {
|
validateTypo: false, // TLDを見ているみたいだけどclubとか弾かれるので
|
||||||
validated = await this.verifyMail(emailAddress, meta.verifymailAuthKey);
|
validateDisposable: true, // 捨てアドかどうかチェック
|
||||||
} else {
|
validateSMTP: false, // 日本だと25ポートが殆どのプロバイダーで塞がれていてタイムアウトになるので
|
||||||
validated = meta.enableActiveEmailValidation ? await validateEmail({
|
}) : { valid: true, reason: null };
|
||||||
email: emailAddress,
|
|
||||||
validateRegex: true,
|
|
||||||
validateMx: true,
|
|
||||||
validateTypo: false, // TLDを見ているみたいだけどclubとか弾かれるので
|
|
||||||
validateDisposable: true, // 捨てアドかどうかチェック
|
|
||||||
validateSMTP: false, // 日本だと25ポートが殆どのプロバイダーで塞がれていてタイムアウトになるので
|
|
||||||
}) : { valid: true, reason: null };
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
validated = { valid: true, reason: null };
|
|
||||||
}
|
|
||||||
|
|
||||||
const available = exist === 0 && validated.valid;
|
const available = exist === 0 && validated.valid;
|
||||||
|
|
||||||
@@ -197,65 +182,4 @@ export class EmailService {
|
|||||||
null,
|
null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private async verifyMail(emailAddress: string, verifymailAuthKey: string): Promise<{
|
|
||||||
valid: boolean;
|
|
||||||
reason: 'used' | 'format' | 'disposable' | 'mx' | 'smtp' | null;
|
|
||||||
}> {
|
|
||||||
const endpoint = 'https://verifymail.io/api/' + emailAddress + '?key=' + verifymailAuthKey;
|
|
||||||
const res = await this.httpRequestService.send(endpoint, {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
|
||||||
Accept: 'application/json, */*',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const json = (await res.json()) as {
|
|
||||||
block: boolean;
|
|
||||||
catch_all: boolean;
|
|
||||||
deliverable_email: boolean;
|
|
||||||
disposable: boolean;
|
|
||||||
domain: string;
|
|
||||||
email_address: string;
|
|
||||||
email_provider: string;
|
|
||||||
mx: boolean;
|
|
||||||
mx_fallback: boolean;
|
|
||||||
mx_host: string[];
|
|
||||||
mx_ip: string[];
|
|
||||||
mx_priority: { [key: string]: number };
|
|
||||||
privacy: boolean;
|
|
||||||
related_domains: string[];
|
|
||||||
};
|
|
||||||
|
|
||||||
if (json.email_address === undefined) {
|
|
||||||
return {
|
|
||||||
valid: false,
|
|
||||||
reason: 'format',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if (json.deliverable_email !== undefined && !json.deliverable_email) {
|
|
||||||
return {
|
|
||||||
valid: false,
|
|
||||||
reason: 'smtp',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if (json.disposable) {
|
|
||||||
return {
|
|
||||||
valid: false,
|
|
||||||
reason: 'disposable',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if (json.mx !== undefined && !json.mx) {
|
|
||||||
return {
|
|
||||||
valid: false,
|
|
||||||
reason: 'mx',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
valid: true,
|
|
||||||
reason: null,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -5,12 +5,11 @@
|
|||||||
|
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import * as Redis from 'ioredis';
|
import * as Redis from 'ioredis';
|
||||||
import type { MiGalleryPost, MiNote, MiUser } from '@/models/_.js';
|
import type { MiNote, MiUser } from '@/models/_.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
|
|
||||||
const GLOBAL_NOTES_RANKING_WINDOW = 1000 * 60 * 60 * 24 * 3; // 3日ごと
|
const GLOBAL_NOTES_RANKING_WINDOW = 1000 * 60 * 60 * 24 * 3; // 3日ごと
|
||||||
export const GALLERY_POSTS_RANKING_WINDOW = 1000 * 60 * 60 * 24 * 3; // 3日ごと
|
|
||||||
const PER_USER_NOTES_RANKING_WINDOW = 1000 * 60 * 60 * 24 * 7; // 1週間ごと
|
const PER_USER_NOTES_RANKING_WINDOW = 1000 * 60 * 60 * 24 * 7; // 1週間ごと
|
||||||
const HASHTAG_RANKING_WINDOW = 1000 * 60 * 60; // 1時間ごと
|
const HASHTAG_RANKING_WINDOW = 1000 * 60 * 60; // 1時間ごと
|
||||||
|
|
||||||
@@ -80,11 +79,6 @@ export class FeaturedService {
|
|||||||
return this.updateRankingOf('featuredGlobalNotesRanking', GLOBAL_NOTES_RANKING_WINDOW, noteId, score);
|
return this.updateRankingOf('featuredGlobalNotesRanking', GLOBAL_NOTES_RANKING_WINDOW, noteId, score);
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
|
||||||
public updateGalleryPostsRanking(galleryPostId: MiGalleryPost['id'], score = 1): Promise<void> {
|
|
||||||
return this.updateRankingOf('featuredGalleryPostsRanking', GALLERY_POSTS_RANKING_WINDOW, galleryPostId, score);
|
|
||||||
}
|
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public updateInChannelNotesRanking(channelId: MiNote['channelId'], noteId: MiNote['id'], score = 1): Promise<void> {
|
public updateInChannelNotesRanking(channelId: MiNote['channelId'], noteId: MiNote['id'], score = 1): Promise<void> {
|
||||||
return this.updateRankingOf(`featuredInChannelNotesRanking:${channelId}`, GLOBAL_NOTES_RANKING_WINDOW, noteId, score);
|
return this.updateRankingOf(`featuredInChannelNotesRanking:${channelId}`, GLOBAL_NOTES_RANKING_WINDOW, noteId, score);
|
||||||
@@ -105,11 +99,6 @@ export class FeaturedService {
|
|||||||
return this.getRankingOf('featuredGlobalNotesRanking', GLOBAL_NOTES_RANKING_WINDOW, threshold);
|
return this.getRankingOf('featuredGlobalNotesRanking', GLOBAL_NOTES_RANKING_WINDOW, threshold);
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
|
||||||
public getGalleryPostsRanking(threshold: number): Promise<MiGalleryPost['id'][]> {
|
|
||||||
return this.getRankingOf('featuredGalleryPostsRanking', GALLERY_POSTS_RANKING_WINDOW, threshold);
|
|
||||||
}
|
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public getInChannelNotesRanking(channelId: MiNote['channelId'], threshold: number): Promise<MiNote['id'][]> {
|
public getInChannelNotesRanking(channelId: MiNote['channelId'], threshold: number): Promise<MiNote['id'][]> {
|
||||||
return this.getRankingOf(`featuredInChannelNotesRanking:${channelId}`, GLOBAL_NOTES_RANKING_WINDOW, threshold);
|
return this.getRankingOf(`featuredInChannelNotesRanking:${channelId}`, GLOBAL_NOTES_RANKING_WINDOW, threshold);
|
||||||
|
@@ -10,7 +10,7 @@ import { bindThis } from '@/decorators.js';
|
|||||||
import { IdService } from '@/core/IdService.js';
|
import { IdService } from '@/core/IdService.js';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class FanoutTimelineService {
|
export class FunoutTimelineService {
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(DI.redisForTimelines)
|
@Inject(DI.redisForTimelines)
|
||||||
private redisForTimelines: Redis.Redis,
|
private redisForTimelines: Redis.Redis,
|
@@ -250,12 +250,6 @@ export class MfmService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function fnDefault(node: mfm.MfmFn) {
|
|
||||||
const el = doc.createElement('i');
|
|
||||||
appendChildren(node.children, el);
|
|
||||||
return el;
|
|
||||||
}
|
|
||||||
|
|
||||||
const handlers: { [K in mfm.MfmNode['type']]: (node: mfm.NodeType<K>) => any } = {
|
const handlers: { [K in mfm.MfmNode['type']]: (node: mfm.NodeType<K>) => any } = {
|
||||||
bold: (node) => {
|
bold: (node) => {
|
||||||
const el = doc.createElement('b');
|
const el = doc.createElement('b');
|
||||||
@@ -282,68 +276,17 @@ export class MfmService {
|
|||||||
},
|
},
|
||||||
|
|
||||||
fn: (node) => {
|
fn: (node) => {
|
||||||
switch (node.props.name) {
|
if (node.props.name === 'unixtime') {
|
||||||
case 'unixtime': {
|
const text = node.children[0]!.type === 'text' ? node.children[0].props.text : '';
|
||||||
const text = node.children[0].type === 'text' ? node.children[0].props.text : '';
|
const date = new Date(parseInt(text, 10) * 1000);
|
||||||
try {
|
const el = doc.createElement('time');
|
||||||
const date = new Date(parseInt(text, 10) * 1000);
|
el.setAttribute('datetime', date.toISOString());
|
||||||
const el = doc.createElement('time');
|
el.textContent = date.toISOString();
|
||||||
el.setAttribute('datetime', date.toISOString());
|
return el;
|
||||||
el.textContent = date.toISOString();
|
} else {
|
||||||
return el;
|
const el = doc.createElement('i');
|
||||||
} catch (err) {
|
appendChildren(node.children, el);
|
||||||
return fnDefault(node);
|
return el;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
case 'ruby': {
|
|
||||||
if (node.children.length === 1) {
|
|
||||||
const child = node.children[0];
|
|
||||||
const text = child.type === 'text' ? child.props.text : '';
|
|
||||||
const rubyEl = doc.createElement('ruby');
|
|
||||||
const rtEl = doc.createElement('rt');
|
|
||||||
|
|
||||||
// ruby未対応のHTMLサニタイザーを通したときにルビが「劉備(りゅうび)」となるようにする
|
|
||||||
const rpStartEl = doc.createElement('rp');
|
|
||||||
rpStartEl.appendChild(doc.createTextNode('('));
|
|
||||||
const rpEndEl = doc.createElement('rp');
|
|
||||||
rpEndEl.appendChild(doc.createTextNode(')'));
|
|
||||||
|
|
||||||
rubyEl.appendChild(doc.createTextNode(text.split(' ')[0]));
|
|
||||||
rtEl.appendChild(doc.createTextNode(text.split(' ')[1]));
|
|
||||||
rubyEl.appendChild(rpStartEl);
|
|
||||||
rubyEl.appendChild(rtEl);
|
|
||||||
rubyEl.appendChild(rpEndEl);
|
|
||||||
return rubyEl;
|
|
||||||
} else {
|
|
||||||
const rt = node.children.at(-1);
|
|
||||||
|
|
||||||
if (!rt) {
|
|
||||||
return fnDefault(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
const text = rt.type === 'text' ? rt.props.text : '';
|
|
||||||
const rubyEl = doc.createElement('ruby');
|
|
||||||
const rtEl = doc.createElement('rt');
|
|
||||||
|
|
||||||
// ruby未対応のHTMLサニタイザーを通したときにルビが「劉備(りゅうび)」となるようにする
|
|
||||||
const rpStartEl = doc.createElement('rp');
|
|
||||||
rpStartEl.appendChild(doc.createTextNode('('));
|
|
||||||
const rpEndEl = doc.createElement('rp');
|
|
||||||
rpEndEl.appendChild(doc.createTextNode(')'));
|
|
||||||
|
|
||||||
appendChildren(node.children.slice(0, node.children.length - 1), rubyEl);
|
|
||||||
rtEl.appendChild(doc.createTextNode(text.trim()));
|
|
||||||
rubyEl.appendChild(rpStartEl);
|
|
||||||
rubyEl.appendChild(rtEl);
|
|
||||||
rubyEl.appendChild(rpEndEl);
|
|
||||||
return rubyEl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
default: {
|
|
||||||
return fnDefault(node);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@@ -54,7 +54,7 @@ import { RoleService } from '@/core/RoleService.js';
|
|||||||
import { MetaService } from '@/core/MetaService.js';
|
import { MetaService } from '@/core/MetaService.js';
|
||||||
import { SearchService } from '@/core/SearchService.js';
|
import { SearchService } from '@/core/SearchService.js';
|
||||||
import { FeaturedService } from '@/core/FeaturedService.js';
|
import { FeaturedService } from '@/core/FeaturedService.js';
|
||||||
import { FanoutTimelineService } from '@/core/FanoutTimelineService.js';
|
import { FunoutTimelineService } from '@/core/FunoutTimelineService.js';
|
||||||
import { UtilityService } from '@/core/UtilityService.js';
|
import { UtilityService } from '@/core/UtilityService.js';
|
||||||
import { UserBlockingService } from '@/core/UserBlockingService.js';
|
import { UserBlockingService } from '@/core/UserBlockingService.js';
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||||||
private idService: IdService,
|
private idService: IdService,
|
||||||
private globalEventService: GlobalEventService,
|
private globalEventService: GlobalEventService,
|
||||||
private queueService: QueueService,
|
private queueService: QueueService,
|
||||||
private fanoutTimelineService: FanoutTimelineService,
|
private funoutTimelineService: FunoutTimelineService,
|
||||||
private noteReadService: NoteReadService,
|
private noteReadService: NoteReadService,
|
||||||
private notificationService: NotificationService,
|
private notificationService: NotificationService,
|
||||||
private relayService: RelayService,
|
private relayService: RelayService,
|
||||||
@@ -843,9 +843,9 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||||||
const r = this.redisForTimelines.pipeline();
|
const r = this.redisForTimelines.pipeline();
|
||||||
|
|
||||||
if (note.channelId) {
|
if (note.channelId) {
|
||||||
this.fanoutTimelineService.push(`channelTimeline:${note.channelId}`, note.id, this.config.perChannelMaxNoteCacheCount, r);
|
this.funoutTimelineService.push(`channelTimeline:${note.channelId}`, note.id, this.config.perChannelMaxNoteCacheCount, r);
|
||||||
|
|
||||||
this.fanoutTimelineService.push(`userTimelineWithChannel:${user.id}`, note.id, note.userHost == null ? meta.perLocalUserUserTimelineCacheMax : meta.perRemoteUserUserTimelineCacheMax, r);
|
this.funoutTimelineService.push(`userTimelineWithChannel:${user.id}`, note.id, note.userHost == null ? meta.perLocalUserUserTimelineCacheMax : meta.perRemoteUserUserTimelineCacheMax, r);
|
||||||
|
|
||||||
const channelFollowings = await this.channelFollowingsRepository.find({
|
const channelFollowings = await this.channelFollowingsRepository.find({
|
||||||
where: {
|
where: {
|
||||||
@@ -855,9 +855,9 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||||||
});
|
});
|
||||||
|
|
||||||
for (const channelFollowing of channelFollowings) {
|
for (const channelFollowing of channelFollowings) {
|
||||||
this.fanoutTimelineService.push(`homeTimeline:${channelFollowing.followerId}`, note.id, meta.perUserHomeTimelineCacheMax, r);
|
this.funoutTimelineService.push(`homeTimeline:${channelFollowing.followerId}`, note.id, meta.perUserHomeTimelineCacheMax, r);
|
||||||
if (note.fileIds.length > 0) {
|
if (note.fileIds.length > 0) {
|
||||||
this.fanoutTimelineService.push(`homeTimelineWithFiles:${channelFollowing.followerId}`, note.id, meta.perUserHomeTimelineCacheMax / 2, r);
|
this.funoutTimelineService.push(`homeTimelineWithFiles:${channelFollowing.followerId}`, note.id, meta.perUserHomeTimelineCacheMax / 2, r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -895,9 +895,9 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||||||
if (!following.withReplies) continue;
|
if (!following.withReplies) continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fanoutTimelineService.push(`homeTimeline:${following.followerId}`, note.id, meta.perUserHomeTimelineCacheMax, r);
|
this.funoutTimelineService.push(`homeTimeline:${following.followerId}`, note.id, meta.perUserHomeTimelineCacheMax, r);
|
||||||
if (note.fileIds.length > 0) {
|
if (note.fileIds.length > 0) {
|
||||||
this.fanoutTimelineService.push(`homeTimelineWithFiles:${following.followerId}`, note.id, meta.perUserHomeTimelineCacheMax / 2, r);
|
this.funoutTimelineService.push(`homeTimelineWithFiles:${following.followerId}`, note.id, meta.perUserHomeTimelineCacheMax / 2, r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -913,36 +913,36 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||||||
if (!userListMembership.withReplies) continue;
|
if (!userListMembership.withReplies) continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fanoutTimelineService.push(`userListTimeline:${userListMembership.userListId}`, note.id, meta.perUserListTimelineCacheMax, r);
|
this.funoutTimelineService.push(`userListTimeline:${userListMembership.userListId}`, note.id, meta.perUserListTimelineCacheMax, r);
|
||||||
if (note.fileIds.length > 0) {
|
if (note.fileIds.length > 0) {
|
||||||
this.fanoutTimelineService.push(`userListTimelineWithFiles:${userListMembership.userListId}`, note.id, meta.perUserListTimelineCacheMax / 2, r);
|
this.funoutTimelineService.push(`userListTimelineWithFiles:${userListMembership.userListId}`, note.id, meta.perUserListTimelineCacheMax / 2, r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (note.visibility !== 'specified' || !note.visibleUserIds.some(v => v === user.id)) { // 自分自身のHTL
|
if (note.visibility !== 'specified' || !note.visibleUserIds.some(v => v === user.id)) { // 自分自身のHTL
|
||||||
this.fanoutTimelineService.push(`homeTimeline:${user.id}`, note.id, meta.perUserHomeTimelineCacheMax, r);
|
this.funoutTimelineService.push(`homeTimeline:${user.id}`, note.id, meta.perUserHomeTimelineCacheMax, r);
|
||||||
if (note.fileIds.length > 0) {
|
if (note.fileIds.length > 0) {
|
||||||
this.fanoutTimelineService.push(`homeTimelineWithFiles:${user.id}`, note.id, meta.perUserHomeTimelineCacheMax / 2, r);
|
this.funoutTimelineService.push(`homeTimelineWithFiles:${user.id}`, note.id, meta.perUserHomeTimelineCacheMax / 2, r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 自分自身以外への返信
|
// 自分自身以外への返信
|
||||||
if (note.replyId && note.replyUserId !== note.userId) {
|
if (note.replyId && note.replyUserId !== note.userId) {
|
||||||
this.fanoutTimelineService.push(`userTimelineWithReplies:${user.id}`, note.id, note.userHost == null ? meta.perLocalUserUserTimelineCacheMax : meta.perRemoteUserUserTimelineCacheMax, r);
|
this.funoutTimelineService.push(`userTimelineWithReplies:${user.id}`, note.id, note.userHost == null ? meta.perLocalUserUserTimelineCacheMax : meta.perRemoteUserUserTimelineCacheMax, r);
|
||||||
|
|
||||||
if (note.visibility === 'public' && note.userHost == null) {
|
if (note.visibility === 'public' && note.userHost == null) {
|
||||||
this.fanoutTimelineService.push('localTimelineWithReplies', note.id, 300, r);
|
this.funoutTimelineService.push('localTimelineWithReplies', note.id, 300, r);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.fanoutTimelineService.push(`userTimeline:${user.id}`, note.id, note.userHost == null ? meta.perLocalUserUserTimelineCacheMax : meta.perRemoteUserUserTimelineCacheMax, r);
|
this.funoutTimelineService.push(`userTimeline:${user.id}`, note.id, note.userHost == null ? meta.perLocalUserUserTimelineCacheMax : meta.perRemoteUserUserTimelineCacheMax, r);
|
||||||
if (note.fileIds.length > 0) {
|
if (note.fileIds.length > 0) {
|
||||||
this.fanoutTimelineService.push(`userTimelineWithFiles:${user.id}`, note.id, note.userHost == null ? meta.perLocalUserUserTimelineCacheMax / 2 : meta.perRemoteUserUserTimelineCacheMax / 2, r);
|
this.funoutTimelineService.push(`userTimelineWithFiles:${user.id}`, note.id, note.userHost == null ? meta.perLocalUserUserTimelineCacheMax / 2 : meta.perRemoteUserUserTimelineCacheMax / 2, r);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (note.visibility === 'public' && note.userHost == null) {
|
if (note.visibility === 'public' && note.userHost == null) {
|
||||||
this.fanoutTimelineService.push('localTimeline', note.id, 1000, r);
|
this.funoutTimelineService.push('localTimeline', note.id, 1000, r);
|
||||||
if (note.fileIds.length > 0) {
|
if (note.fileIds.length > 0) {
|
||||||
this.fanoutTimelineService.push('localTimelineWithFiles', note.id, 500, r);
|
this.funoutTimelineService.push('localTimelineWithFiles', note.id, 500, r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -20,7 +20,7 @@ import { IdService } from '@/core/IdService.js';
|
|||||||
import { GlobalEventService } from '@/core/GlobalEventService.js';
|
import { GlobalEventService } from '@/core/GlobalEventService.js';
|
||||||
import { ModerationLogService } from '@/core/ModerationLogService.js';
|
import { ModerationLogService } from '@/core/ModerationLogService.js';
|
||||||
import type { Packed } from '@/misc/json-schema.js';
|
import type { Packed } from '@/misc/json-schema.js';
|
||||||
import { FanoutTimelineService } from '@/core/FanoutTimelineService.js';
|
import { FunoutTimelineService } from '@/core/FunoutTimelineService.js';
|
||||||
import type { OnApplicationShutdown } from '@nestjs/common';
|
import type { OnApplicationShutdown } from '@nestjs/common';
|
||||||
|
|
||||||
export type RolePolicies = {
|
export type RolePolicies = {
|
||||||
@@ -87,9 +87,6 @@ export class RoleService implements OnApplicationShutdown {
|
|||||||
@Inject(DI.redis)
|
@Inject(DI.redis)
|
||||||
private redisClient: Redis.Redis,
|
private redisClient: Redis.Redis,
|
||||||
|
|
||||||
@Inject(DI.redisForTimelines)
|
|
||||||
private redisForTimelines: Redis.Redis,
|
|
||||||
|
|
||||||
@Inject(DI.redisForSub)
|
@Inject(DI.redisForSub)
|
||||||
private redisForSub: Redis.Redis,
|
private redisForSub: Redis.Redis,
|
||||||
|
|
||||||
@@ -108,7 +105,7 @@ export class RoleService implements OnApplicationShutdown {
|
|||||||
private globalEventService: GlobalEventService,
|
private globalEventService: GlobalEventService,
|
||||||
private idService: IdService,
|
private idService: IdService,
|
||||||
private moderationLogService: ModerationLogService,
|
private moderationLogService: ModerationLogService,
|
||||||
private fanoutTimelineService: FanoutTimelineService,
|
private funoutTimelineService: FunoutTimelineService,
|
||||||
) {
|
) {
|
||||||
//this.onMessage = this.onMessage.bind(this);
|
//this.onMessage = this.onMessage.bind(this);
|
||||||
|
|
||||||
@@ -479,10 +476,10 @@ export class RoleService implements OnApplicationShutdown {
|
|||||||
public async addNoteToRoleTimeline(note: Packed<'Note'>): Promise<void> {
|
public async addNoteToRoleTimeline(note: Packed<'Note'>): Promise<void> {
|
||||||
const roles = await this.getUserRoles(note.userId);
|
const roles = await this.getUserRoles(note.userId);
|
||||||
|
|
||||||
const redisPipeline = this.redisForTimelines.pipeline();
|
const redisPipeline = this.redisClient.pipeline();
|
||||||
|
|
||||||
for (const role of roles) {
|
for (const role of roles) {
|
||||||
this.fanoutTimelineService.push(`roleTimeline:${role.id}`, note.id, 1000, redisPipeline);
|
this.funoutTimelineService.push(`roleTimeline:${role.id}`, note.id, 1000, redisPipeline);
|
||||||
this.globalEventService.publishRoleTimelineStream(role.id, 'note', note);
|
this.globalEventService.publishRoleTimelineStream(role.id, 'note', note);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ import { CacheService } from '@/core/CacheService.js';
|
|||||||
import type { Config } from '@/config.js';
|
import type { Config } from '@/config.js';
|
||||||
import { AccountMoveService } from '@/core/AccountMoveService.js';
|
import { AccountMoveService } from '@/core/AccountMoveService.js';
|
||||||
import { UtilityService } from '@/core/UtilityService.js';
|
import { UtilityService } from '@/core/UtilityService.js';
|
||||||
import { FanoutTimelineService } from '@/core/FanoutTimelineService.js';
|
import { FunoutTimelineService } from '@/core/FunoutTimelineService.js';
|
||||||
import Logger from '../logger.js';
|
import Logger from '../logger.js';
|
||||||
|
|
||||||
const logger = new Logger('following/create');
|
const logger = new Logger('following/create');
|
||||||
@@ -84,7 +84,7 @@ export class UserFollowingService implements OnModuleInit {
|
|||||||
private webhookService: WebhookService,
|
private webhookService: WebhookService,
|
||||||
private apRendererService: ApRendererService,
|
private apRendererService: ApRendererService,
|
||||||
private accountMoveService: AccountMoveService,
|
private accountMoveService: AccountMoveService,
|
||||||
private fanoutTimelineService: FanoutTimelineService,
|
private funoutTimelineService: FunoutTimelineService,
|
||||||
private perUserFollowingChart: PerUserFollowingChart,
|
private perUserFollowingChart: PerUserFollowingChart,
|
||||||
private instanceChart: InstanceChart,
|
private instanceChart: InstanceChart,
|
||||||
) {
|
) {
|
||||||
@@ -305,7 +305,7 @@ export class UserFollowingService implements OnModuleInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.fanoutTimelineService.purge(`homeTimeline:${follower.id}`);
|
this.funoutTimelineService.purge(`homeTimeline:${follower.id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Publish followed event
|
// Publish followed event
|
||||||
@@ -374,7 +374,7 @@ export class UserFollowingService implements OnModuleInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.fanoutTimelineService.purge(`homeTimeline:${follower.id}`);
|
this.funoutTimelineService.purge(`homeTimeline:${follower.id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.userEntityService.isLocalUser(follower) && this.userEntityService.isRemoteUser(followee)) {
|
if (this.userEntityService.isLocalUser(follower) && this.userEntityService.isRemoteUser(followee)) {
|
||||||
|
@@ -198,14 +198,12 @@ export class NotificationEntityService implements OnModuleInit {
|
|||||||
});
|
});
|
||||||
} else if (notification.type === 'renote:grouped') {
|
} else if (notification.type === 'renote:grouped') {
|
||||||
const users = await Promise.all(notification.userIds.map(userId => {
|
const users = await Promise.all(notification.userIds.map(userId => {
|
||||||
const packedUser = hint?.packedUsers != null ? hint.packedUsers.get(userId) : null;
|
const user = hint?.packedUsers != null
|
||||||
if (packedUser) {
|
? hint.packedUsers.get(userId)
|
||||||
return packedUser;
|
: this.userEntityService.pack(userId!, { id: meId }, {
|
||||||
}
|
detail: false,
|
||||||
|
});
|
||||||
return this.userEntityService.pack(userId, { id: meId }, {
|
return user;
|
||||||
detail: false,
|
|
||||||
});
|
|
||||||
}));
|
}));
|
||||||
return await awaitAll({
|
return await awaitAll({
|
||||||
id: notification.id,
|
id: notification.id,
|
||||||
|
@@ -473,7 +473,6 @@ export class UserEntityService implements OnModuleInit {
|
|||||||
hasPendingReceivedFollowRequest: this.getHasPendingReceivedFollowRequest(user.id),
|
hasPendingReceivedFollowRequest: this.getHasPendingReceivedFollowRequest(user.id),
|
||||||
unreadNotificationsCount: notificationsInfo?.unreadCount,
|
unreadNotificationsCount: notificationsInfo?.unreadCount,
|
||||||
mutedWords: profile!.mutedWords,
|
mutedWords: profile!.mutedWords,
|
||||||
hardMutedWords: profile!.hardMutedWords,
|
|
||||||
mutedInstances: profile!.mutedInstances,
|
mutedInstances: profile!.mutedInstances,
|
||||||
mutingNotificationTypes: [], // 後方互換性のため
|
mutingNotificationTypes: [], // 後方互換性のため
|
||||||
notificationRecieveConfig: profile!.notificationRecieveConfig,
|
notificationRecieveConfig: profile!.notificationRecieveConfig,
|
||||||
|
@@ -446,17 +446,6 @@ export class MiMeta {
|
|||||||
})
|
})
|
||||||
public enableActiveEmailValidation: boolean;
|
public enableActiveEmailValidation: boolean;
|
||||||
|
|
||||||
@Column('boolean', {
|
|
||||||
default: false,
|
|
||||||
})
|
|
||||||
public enableVerifymailApi: boolean;
|
|
||||||
|
|
||||||
@Column('varchar', {
|
|
||||||
length: 1024,
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
public verifymailAuthKey: string | null;
|
|
||||||
|
|
||||||
@Column('boolean', {
|
@Column('boolean', {
|
||||||
default: true,
|
default: true,
|
||||||
})
|
})
|
||||||
|
@@ -215,12 +215,7 @@ export class MiUserProfile {
|
|||||||
@Column('jsonb', {
|
@Column('jsonb', {
|
||||||
default: [],
|
default: [],
|
||||||
})
|
})
|
||||||
public mutedWords: (string[] | string)[];
|
public mutedWords: string[][];
|
||||||
|
|
||||||
@Column('jsonb', {
|
|
||||||
default: [],
|
|
||||||
})
|
|
||||||
public hardMutedWords: (string[] | string)[];
|
|
||||||
|
|
||||||
@Column('jsonb', {
|
@Column('jsonb', {
|
||||||
default: [],
|
default: [],
|
||||||
|
@@ -42,18 +42,14 @@ export const packedAnnouncementSchema = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
needConfirmationToRead: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
silence: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
forYou: {
|
forYou: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
|
needConfirmationToRead: {
|
||||||
|
type: 'boolean',
|
||||||
|
optional: false, nullable: false,
|
||||||
|
},
|
||||||
isRead: {
|
isRead: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
optional: true, nullable: false,
|
optional: true, nullable: false,
|
||||||
|
@@ -19,7 +19,7 @@ export const packedChannelSchema = {
|
|||||||
},
|
},
|
||||||
lastNotedAt: {
|
lastNotedAt: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
nullable: true, optional: false,
|
optional: false, nullable: true,
|
||||||
format: 'date-time',
|
format: 'date-time',
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
@@ -27,19 +27,39 @@ export const packedChannelSchema = {
|
|||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
type: 'string',
|
|
||||||
optional: false, nullable: true,
|
|
||||||
},
|
|
||||||
userId: {
|
|
||||||
type: 'string',
|
type: 'string',
|
||||||
nullable: true, optional: false,
|
nullable: true, optional: false,
|
||||||
format: 'id',
|
|
||||||
},
|
},
|
||||||
bannerUrl: {
|
bannerUrl: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
format: 'url',
|
format: 'url',
|
||||||
nullable: true, optional: false,
|
nullable: true, optional: false,
|
||||||
},
|
},
|
||||||
|
isArchived: {
|
||||||
|
type: 'boolean',
|
||||||
|
optional: false, nullable: false,
|
||||||
|
},
|
||||||
|
notesCount: {
|
||||||
|
type: 'number',
|
||||||
|
nullable: false, optional: false,
|
||||||
|
},
|
||||||
|
usersCount: {
|
||||||
|
type: 'number',
|
||||||
|
nullable: false, optional: false,
|
||||||
|
},
|
||||||
|
isFollowing: {
|
||||||
|
type: 'boolean',
|
||||||
|
optional: true, nullable: false,
|
||||||
|
},
|
||||||
|
isFavorited: {
|
||||||
|
type: 'boolean',
|
||||||
|
optional: true, nullable: false,
|
||||||
|
},
|
||||||
|
userId: {
|
||||||
|
type: 'string',
|
||||||
|
nullable: true, optional: false,
|
||||||
|
format: 'id',
|
||||||
|
},
|
||||||
pinnedNoteIds: {
|
pinnedNoteIds: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
nullable: false, optional: false,
|
nullable: false, optional: false,
|
||||||
@@ -52,18 +72,6 @@ export const packedChannelSchema = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
isArchived: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
usersCount: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
notesCount: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
isSensitive: {
|
isSensitive: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
@@ -72,22 +80,5 @@ export const packedChannelSchema = {
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
isFollowing: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: true, nullable: false,
|
|
||||||
},
|
|
||||||
isFavorited: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: true, nullable: false,
|
|
||||||
},
|
|
||||||
pinnedNotes: {
|
|
||||||
type: 'array',
|
|
||||||
optional: true, nullable: false,
|
|
||||||
items: {
|
|
||||||
type: 'object',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
ref: 'Note',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
@@ -44,13 +44,13 @@ export const packedClipSchema = {
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
favoritedCount: {
|
|
||||||
type: 'number',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
isFavorited: {
|
isFavorited: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
optional: true, nullable: false,
|
optional: true, nullable: false,
|
||||||
},
|
},
|
||||||
|
favoritedCount: {
|
||||||
|
type: 'number',
|
||||||
|
optional: false, nullable: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
@@ -74,7 +74,7 @@ export const packedDriveFileSchema = {
|
|||||||
},
|
},
|
||||||
url: {
|
url: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: true,
|
||||||
format: 'url',
|
format: 'url',
|
||||||
},
|
},
|
||||||
thumbnailUrl: {
|
thumbnailUrl: {
|
||||||
|
@@ -21,12 +21,6 @@ export const packedDriveFolderSchema = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
parentId: {
|
|
||||||
type: 'string',
|
|
||||||
optional: false, nullable: true,
|
|
||||||
format: 'id',
|
|
||||||
example: 'xxxxxxxxxx',
|
|
||||||
},
|
|
||||||
foldersCount: {
|
foldersCount: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
optional: true, nullable: false,
|
optional: true, nullable: false,
|
||||||
@@ -35,6 +29,12 @@ export const packedDriveFolderSchema = {
|
|||||||
type: 'number',
|
type: 'number',
|
||||||
optional: true, nullable: false,
|
optional: true, nullable: false,
|
||||||
},
|
},
|
||||||
|
parentId: {
|
||||||
|
type: 'string',
|
||||||
|
optional: false, nullable: true,
|
||||||
|
format: 'id',
|
||||||
|
example: 'xxxxxxxxxx',
|
||||||
|
},
|
||||||
parent: {
|
parent: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
optional: true, nullable: true,
|
optional: true, nullable: true,
|
||||||
|
@@ -79,10 +79,6 @@ export const packedFederationInstanceSchema = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: true,
|
optional: false, nullable: true,
|
||||||
},
|
},
|
||||||
isSilenced: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
iconUrl: {
|
iconUrl: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: true,
|
optional: false, nullable: true,
|
||||||
@@ -97,6 +93,11 @@ export const packedFederationInstanceSchema = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: true,
|
optional: false, nullable: true,
|
||||||
},
|
},
|
||||||
|
isSilenced: {
|
||||||
|
type: "boolean",
|
||||||
|
optional: false,
|
||||||
|
nullable: false,
|
||||||
|
},
|
||||||
infoUpdatedAt: {
|
infoUpdatedAt: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: true,
|
optional: false, nullable: true,
|
||||||
|
@@ -22,16 +22,6 @@ export const packedFlashSchema = {
|
|||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
format: 'date-time',
|
format: 'date-time',
|
||||||
},
|
},
|
||||||
userId: {
|
|
||||||
type: 'string',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
format: 'id',
|
|
||||||
},
|
|
||||||
user: {
|
|
||||||
type: 'object',
|
|
||||||
ref: 'UserLite',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
title: {
|
title: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
@@ -44,6 +34,16 @@ export const packedFlashSchema = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
|
userId: {
|
||||||
|
type: 'string',
|
||||||
|
optional: false, nullable: false,
|
||||||
|
format: 'id',
|
||||||
|
},
|
||||||
|
user: {
|
||||||
|
type: 'object',
|
||||||
|
ref: 'UserLite',
|
||||||
|
optional: false, nullable: false,
|
||||||
|
},
|
||||||
likedCount: {
|
likedCount: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
optional: false, nullable: true,
|
optional: false, nullable: true,
|
||||||
|
@@ -22,16 +22,16 @@ export const packedFollowingSchema = {
|
|||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
format: 'id',
|
format: 'id',
|
||||||
},
|
},
|
||||||
followerId: {
|
|
||||||
type: 'string',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
format: 'id',
|
|
||||||
},
|
|
||||||
followee: {
|
followee: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
optional: true, nullable: false,
|
optional: true, nullable: false,
|
||||||
ref: 'UserDetailed',
|
ref: 'UserDetailed',
|
||||||
},
|
},
|
||||||
|
followerId: {
|
||||||
|
type: 'string',
|
||||||
|
optional: false, nullable: false,
|
||||||
|
format: 'id',
|
||||||
|
},
|
||||||
follower: {
|
follower: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
optional: true, nullable: false,
|
optional: true, nullable: false,
|
||||||
|
@@ -22,6 +22,14 @@ export const packedGalleryPostSchema = {
|
|||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
format: 'date-time',
|
format: 'date-time',
|
||||||
},
|
},
|
||||||
|
title: {
|
||||||
|
type: 'string',
|
||||||
|
optional: false, nullable: false,
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
type: 'string',
|
||||||
|
optional: false, nullable: true,
|
||||||
|
},
|
||||||
userId: {
|
userId: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
@@ -32,14 +40,6 @@ export const packedGalleryPostSchema = {
|
|||||||
ref: 'UserLite',
|
ref: 'UserLite',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
title: {
|
|
||||||
type: 'string',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
description: {
|
|
||||||
type: 'string',
|
|
||||||
optional: false, nullable: true,
|
|
||||||
},
|
|
||||||
fileIds: {
|
fileIds: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
optional: true, nullable: false,
|
optional: true, nullable: false,
|
||||||
@@ -70,13 +70,5 @@ export const packedGalleryPostSchema = {
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
likedCount: {
|
|
||||||
type: 'number',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
isLiked: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: true, nullable: false,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
@@ -127,26 +127,22 @@ export const packedNoteSchema = {
|
|||||||
channel: {
|
channel: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
optional: true, nullable: true,
|
optional: true, nullable: true,
|
||||||
properties: {
|
items: {
|
||||||
id: {
|
type: 'object',
|
||||||
type: 'string',
|
optional: false, nullable: false,
|
||||||
optional: false, nullable: false,
|
properties: {
|
||||||
},
|
id: {
|
||||||
name: {
|
type: 'string',
|
||||||
type: 'string',
|
optional: false, nullable: false,
|
||||||
optional: false, nullable: false,
|
},
|
||||||
},
|
name: {
|
||||||
color: {
|
type: 'string',
|
||||||
type: 'string',
|
optional: false, nullable: true,
|
||||||
optional: false, nullable: false,
|
},
|
||||||
},
|
isSensitive: {
|
||||||
isSensitive: {
|
type: 'boolean',
|
||||||
type: 'boolean',
|
optional: true, nullable: false,
|
||||||
optional: false, nullable: false,
|
},
|
||||||
},
|
|
||||||
allowRenoteToExternal: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@@ -42,9 +42,13 @@ export const packedNotificationSchema = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
optional: true, nullable: true,
|
optional: true, nullable: true,
|
||||||
},
|
},
|
||||||
achievement: {
|
choice: {
|
||||||
type: 'string',
|
type: 'number',
|
||||||
optional: true, nullable: false,
|
optional: true, nullable: true,
|
||||||
|
},
|
||||||
|
invitation: {
|
||||||
|
type: 'object',
|
||||||
|
optional: true, nullable: true,
|
||||||
},
|
},
|
||||||
body: {
|
body: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
@@ -77,14 +81,14 @@ export const packedNotificationSchema = {
|
|||||||
required: ['user', 'reaction'],
|
required: ['user', 'reaction'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
users: {
|
},
|
||||||
type: 'array',
|
users: {
|
||||||
optional: true, nullable: true,
|
type: 'array',
|
||||||
items: {
|
optional: true, nullable: true,
|
||||||
type: 'object',
|
items: {
|
||||||
ref: 'UserLite',
|
type: 'object',
|
||||||
optional: false, nullable: false,
|
ref: 'UserLite',
|
||||||
},
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
@@ -22,32 +22,6 @@ export const packedPageSchema = {
|
|||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
format: 'date-time',
|
format: 'date-time',
|
||||||
},
|
},
|
||||||
userId: {
|
|
||||||
type: 'string',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
format: 'id',
|
|
||||||
},
|
|
||||||
user: {
|
|
||||||
type: 'object',
|
|
||||||
ref: 'UserLite',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
content: {
|
|
||||||
type: 'array',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
items: {
|
|
||||||
type: 'object',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
variables: {
|
|
||||||
type: 'array',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
items: {
|
|
||||||
type: 'object',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
title: {
|
title: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
@@ -60,47 +34,23 @@ export const packedPageSchema = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: true,
|
optional: false, nullable: true,
|
||||||
},
|
},
|
||||||
hideTitleWhenPinned: {
|
content: {
|
||||||
type: 'boolean',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
alignCenter: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
font: {
|
|
||||||
type: 'string',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
script: {
|
|
||||||
type: 'string',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
eyeCatchingImageId: {
|
|
||||||
type: 'string',
|
|
||||||
optional: false, nullable: true,
|
|
||||||
},
|
|
||||||
eyeCatchingImage: {
|
|
||||||
type: 'object',
|
|
||||||
optional: false, nullable: true,
|
|
||||||
ref: 'DriveFile',
|
|
||||||
},
|
|
||||||
attachedFiles: {
|
|
||||||
type: 'array',
|
type: 'array',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
items: {
|
|
||||||
type: 'object',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
ref: 'DriveFile',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
likedCount: {
|
variables: {
|
||||||
type: 'number',
|
type: 'array',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
isLiked: {
|
userId: {
|
||||||
type: 'boolean',
|
type: 'string',
|
||||||
optional: true, nullable: false,
|
optional: false, nullable: false,
|
||||||
|
format: 'id',
|
||||||
|
},
|
||||||
|
user: {
|
||||||
|
type: 'object',
|
||||||
|
ref: 'UserLite',
|
||||||
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
@@ -49,6 +49,11 @@ export const packedUserLiteSchema = {
|
|||||||
nullable: false, optional: false,
|
nullable: false, optional: false,
|
||||||
format: 'id',
|
format: 'id',
|
||||||
},
|
},
|
||||||
|
url: {
|
||||||
|
type: 'string',
|
||||||
|
format: 'url',
|
||||||
|
nullable: false, optional: false,
|
||||||
|
},
|
||||||
angle: {
|
angle: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
nullable: false, optional: true,
|
nullable: false, optional: true,
|
||||||
@@ -57,14 +62,19 @@ export const packedUserLiteSchema = {
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: true,
|
nullable: false, optional: true,
|
||||||
},
|
},
|
||||||
url: {
|
|
||||||
type: 'string',
|
|
||||||
format: 'url',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
isAdmin: {
|
||||||
|
type: 'boolean',
|
||||||
|
nullable: false, optional: true,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
isModerator: {
|
||||||
|
type: 'boolean',
|
||||||
|
nullable: false, optional: true,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
isBot: {
|
isBot: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: true,
|
nullable: false, optional: true,
|
||||||
@@ -73,67 +83,12 @@ export const packedUserLiteSchema = {
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: true,
|
nullable: false, optional: true,
|
||||||
},
|
},
|
||||||
instance: {
|
|
||||||
type: 'object',
|
|
||||||
nullable: false, optional: true,
|
|
||||||
properties: {
|
|
||||||
name: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: true, optional: false,
|
|
||||||
},
|
|
||||||
softwareName: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: true, optional: false,
|
|
||||||
},
|
|
||||||
softwareVersion: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: true, optional: false,
|
|
||||||
},
|
|
||||||
iconUrl: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: true, optional: false,
|
|
||||||
},
|
|
||||||
faviconUrl: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: true, optional: false,
|
|
||||||
},
|
|
||||||
themeColor: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: true, optional: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
emojis: {
|
|
||||||
type: 'object',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
onlineStatus: {
|
onlineStatus: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
nullable: false, optional: false,
|
format: 'url',
|
||||||
|
nullable: true, optional: false,
|
||||||
enum: ['unknown', 'online', 'active', 'offline'],
|
enum: ['unknown', 'online', 'active', 'offline'],
|
||||||
},
|
},
|
||||||
badgeRoles: {
|
|
||||||
type: 'array',
|
|
||||||
nullable: false, optional: true,
|
|
||||||
items: {
|
|
||||||
type: 'object',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
properties: {
|
|
||||||
name: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
iconUrl: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: true, optional: false,
|
|
||||||
},
|
|
||||||
displayOrder: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
@@ -150,18 +105,21 @@ export const packedUserDetailedNotMeOnlySchema = {
|
|||||||
format: 'uri',
|
format: 'uri',
|
||||||
nullable: true, optional: false,
|
nullable: true, optional: false,
|
||||||
},
|
},
|
||||||
movedTo: {
|
movedToUri: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
format: 'uri',
|
format: 'uri',
|
||||||
nullable: true, optional: false,
|
nullable: true,
|
||||||
|
optional: false,
|
||||||
},
|
},
|
||||||
alsoKnownAs: {
|
alsoKnownAs: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
nullable: true, optional: false,
|
nullable: true,
|
||||||
|
optional: false,
|
||||||
items: {
|
items: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
format: 'id',
|
format: 'id',
|
||||||
nullable: false, optional: false,
|
nullable: false,
|
||||||
|
optional: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
createdAt: {
|
createdAt: {
|
||||||
@@ -291,11 +249,6 @@ export const packedUserDetailedNotMeOnlySchema = {
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: false,
|
nullable: false, optional: false,
|
||||||
},
|
},
|
||||||
ffVisibility: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
enum: ['public', 'followers', 'private'],
|
|
||||||
},
|
|
||||||
twoFactorEnabled: {
|
twoFactorEnabled: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: false,
|
nullable: false, optional: false,
|
||||||
@@ -311,57 +264,6 @@ export const packedUserDetailedNotMeOnlySchema = {
|
|||||||
nullable: false, optional: false,
|
nullable: false, optional: false,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
roles: {
|
|
||||||
type: 'array',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
items: {
|
|
||||||
type: 'object',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
properties: {
|
|
||||||
id: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
format: 'id',
|
|
||||||
},
|
|
||||||
name: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
color: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: true, optional: false,
|
|
||||||
},
|
|
||||||
iconUrl: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: true, optional: false,
|
|
||||||
},
|
|
||||||
description: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
isModerator: {
|
|
||||||
type: 'boolean',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
isAdministrator: {
|
|
||||||
type: 'boolean',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
displayOrder: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
memo: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: true, optional: false,
|
|
||||||
},
|
|
||||||
moderationNote: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: false, optional: true,
|
|
||||||
},
|
|
||||||
//#region relations
|
//#region relations
|
||||||
isFollowing: {
|
isFollowing: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
@@ -395,6 +297,10 @@ export const packedUserDetailedNotMeOnlySchema = {
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: true,
|
nullable: false, optional: true,
|
||||||
},
|
},
|
||||||
|
memo: {
|
||||||
|
type: 'string',
|
||||||
|
nullable: false, optional: true,
|
||||||
|
},
|
||||||
notify: {
|
notify: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
nullable: false, optional: true,
|
nullable: false, optional: true,
|
||||||
@@ -420,37 +326,29 @@ export const packedMeDetailedOnlySchema = {
|
|||||||
nullable: true, optional: false,
|
nullable: true, optional: false,
|
||||||
format: 'id',
|
format: 'id',
|
||||||
},
|
},
|
||||||
isModerator: {
|
|
||||||
type: 'boolean',
|
|
||||||
nullable: true, optional: false,
|
|
||||||
},
|
|
||||||
isAdmin: {
|
|
||||||
type: 'boolean',
|
|
||||||
nullable: true, optional: false,
|
|
||||||
},
|
|
||||||
injectFeaturedNote: {
|
injectFeaturedNote: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: false,
|
nullable: true, optional: false,
|
||||||
},
|
},
|
||||||
receiveAnnouncementEmail: {
|
receiveAnnouncementEmail: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: false,
|
nullable: true, optional: false,
|
||||||
},
|
},
|
||||||
alwaysMarkNsfw: {
|
alwaysMarkNsfw: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: false,
|
nullable: true, optional: false,
|
||||||
},
|
},
|
||||||
autoSensitive: {
|
autoSensitive: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: false,
|
nullable: true, optional: false,
|
||||||
},
|
},
|
||||||
carefulBot: {
|
carefulBot: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: false,
|
nullable: true, optional: false,
|
||||||
},
|
},
|
||||||
autoAcceptFollowed: {
|
autoAcceptFollowed: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: false,
|
nullable: true, optional: false,
|
||||||
},
|
},
|
||||||
noCrawle: {
|
noCrawle: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
@@ -489,23 +387,10 @@ export const packedMeDetailedOnlySchema = {
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: false,
|
nullable: false, optional: false,
|
||||||
},
|
},
|
||||||
unreadAnnouncements: {
|
|
||||||
type: 'array',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
items: {
|
|
||||||
type: 'object',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
ref: 'Announcement',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
hasUnreadAntenna: {
|
hasUnreadAntenna: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: false,
|
nullable: false, optional: false,
|
||||||
},
|
},
|
||||||
hasUnreadChannel: {
|
|
||||||
type: 'boolean',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
hasUnreadNotification: {
|
hasUnreadNotification: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: false,
|
nullable: false, optional: false,
|
||||||
@@ -530,18 +415,6 @@ export const packedMeDetailedOnlySchema = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
hardMutedWords: {
|
|
||||||
type: 'array',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
items: {
|
|
||||||
type: 'array',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
items: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mutedInstances: {
|
mutedInstances: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
nullable: true, optional: false,
|
nullable: true, optional: false,
|
||||||
@@ -556,132 +429,12 @@ export const packedMeDetailedOnlySchema = {
|
|||||||
},
|
},
|
||||||
emailNotificationTypes: {
|
emailNotificationTypes: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
nullable: false, optional: false,
|
nullable: true, optional: false,
|
||||||
items: {
|
items: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
nullable: false, optional: false,
|
nullable: false, optional: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
achievements: {
|
|
||||||
type: 'array',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
items: {
|
|
||||||
type: 'object',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
properties: {
|
|
||||||
name: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
unlockedAt: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
loggedInDays: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
policies: {
|
|
||||||
type: 'object',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
properties: {
|
|
||||||
gtlAvailable: {
|
|
||||||
type: 'boolean',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
ltlAvailable: {
|
|
||||||
type: 'boolean',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
canPublicNote: {
|
|
||||||
type: 'boolean',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
canInvite: {
|
|
||||||
type: 'boolean',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
inviteLimit: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
inviteLimitCycle: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
inviteExpirationTime: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
canManageCustomEmojis: {
|
|
||||||
type: 'boolean',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
canManageAvatarDecorations: {
|
|
||||||
type: 'boolean',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
canSearchNotes: {
|
|
||||||
type: 'boolean',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
canUseTranslator: {
|
|
||||||
type: 'boolean',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
canHideAds: {
|
|
||||||
type: 'boolean',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
driveCapacityMb: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
alwaysMarkNsfw: {
|
|
||||||
type: 'boolean',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
pinLimit: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
antennaLimit: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
wordMuteLimit: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
webhookLimit: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
clipLimit: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
noteEachClipsLimit: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
userListLimit: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
userEachUserListsLimit: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
rateLimitFactor: {
|
|
||||||
type: 'number',
|
|
||||||
nullable: false, optional: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
//#region secrets
|
//#region secrets
|
||||||
email: {
|
email: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
@@ -758,13 +511,5 @@ export const packedUserSchema = {
|
|||||||
type: 'object',
|
type: 'object',
|
||||||
ref: 'UserDetailed',
|
ref: 'UserDetailed',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
type: 'object',
|
|
||||||
ref: 'UserDetailedNotMe',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'object',
|
|
||||||
ref: 'MeDetailed',
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
} as const;
|
} as const;
|
||||||
|
@@ -24,8 +24,6 @@ import * as ep___admin_avatarDecorations_delete from './endpoints/admin/avatar-d
|
|||||||
import * as ep___admin_avatarDecorations_list from './endpoints/admin/avatar-decorations/list.js';
|
import * as ep___admin_avatarDecorations_list from './endpoints/admin/avatar-decorations/list.js';
|
||||||
import * as ep___admin_avatarDecorations_update from './endpoints/admin/avatar-decorations/update.js';
|
import * as ep___admin_avatarDecorations_update from './endpoints/admin/avatar-decorations/update.js';
|
||||||
import * as ep___admin_deleteAllFilesOfAUser from './endpoints/admin/delete-all-files-of-a-user.js';
|
import * as ep___admin_deleteAllFilesOfAUser from './endpoints/admin/delete-all-files-of-a-user.js';
|
||||||
import * as ep___admin_unsetUserAvatar from './endpoints/admin/unset-user-avatar.js';
|
|
||||||
import * as ep___admin_unsetUserBanner from './endpoints/admin/unset-user-banner.js';
|
|
||||||
import * as ep___admin_drive_cleanRemoteFiles from './endpoints/admin/drive/clean-remote-files.js';
|
import * as ep___admin_drive_cleanRemoteFiles from './endpoints/admin/drive/clean-remote-files.js';
|
||||||
import * as ep___admin_drive_cleanup from './endpoints/admin/drive/cleanup.js';
|
import * as ep___admin_drive_cleanup from './endpoints/admin/drive/cleanup.js';
|
||||||
import * as ep___admin_drive_files from './endpoints/admin/drive/files.js';
|
import * as ep___admin_drive_files from './endpoints/admin/drive/files.js';
|
||||||
@@ -385,8 +383,6 @@ const $admin_avatarDecorations_delete: Provider = { provide: 'ep:admin/avatar-de
|
|||||||
const $admin_avatarDecorations_list: Provider = { provide: 'ep:admin/avatar-decorations/list', useClass: ep___admin_avatarDecorations_list.default };
|
const $admin_avatarDecorations_list: Provider = { provide: 'ep:admin/avatar-decorations/list', useClass: ep___admin_avatarDecorations_list.default };
|
||||||
const $admin_avatarDecorations_update: Provider = { provide: 'ep:admin/avatar-decorations/update', useClass: ep___admin_avatarDecorations_update.default };
|
const $admin_avatarDecorations_update: Provider = { provide: 'ep:admin/avatar-decorations/update', useClass: ep___admin_avatarDecorations_update.default };
|
||||||
const $admin_deleteAllFilesOfAUser: Provider = { provide: 'ep:admin/delete-all-files-of-a-user', useClass: ep___admin_deleteAllFilesOfAUser.default };
|
const $admin_deleteAllFilesOfAUser: Provider = { provide: 'ep:admin/delete-all-files-of-a-user', useClass: ep___admin_deleteAllFilesOfAUser.default };
|
||||||
const $admin_unsetUserAvatar: Provider = { provide: 'ep:admin/unset-user-avatar', useClass: ep___admin_unsetUserAvatar.default };
|
|
||||||
const $admin_unsetUserBanner: Provider = { provide: 'ep:admin/unset-user-banner', useClass: ep___admin_unsetUserBanner.default };
|
|
||||||
const $admin_drive_cleanRemoteFiles: Provider = { provide: 'ep:admin/drive/clean-remote-files', useClass: ep___admin_drive_cleanRemoteFiles.default };
|
const $admin_drive_cleanRemoteFiles: Provider = { provide: 'ep:admin/drive/clean-remote-files', useClass: ep___admin_drive_cleanRemoteFiles.default };
|
||||||
const $admin_drive_cleanup: Provider = { provide: 'ep:admin/drive/cleanup', useClass: ep___admin_drive_cleanup.default };
|
const $admin_drive_cleanup: Provider = { provide: 'ep:admin/drive/cleanup', useClass: ep___admin_drive_cleanup.default };
|
||||||
const $admin_drive_files: Provider = { provide: 'ep:admin/drive/files', useClass: ep___admin_drive_files.default };
|
const $admin_drive_files: Provider = { provide: 'ep:admin/drive/files', useClass: ep___admin_drive_files.default };
|
||||||
@@ -750,8 +746,6 @@ const $retention: Provider = { provide: 'ep:retention', useClass: ep___retention
|
|||||||
$admin_avatarDecorations_list,
|
$admin_avatarDecorations_list,
|
||||||
$admin_avatarDecorations_update,
|
$admin_avatarDecorations_update,
|
||||||
$admin_deleteAllFilesOfAUser,
|
$admin_deleteAllFilesOfAUser,
|
||||||
$admin_unsetUserAvatar,
|
|
||||||
$admin_unsetUserBanner,
|
|
||||||
$admin_drive_cleanRemoteFiles,
|
$admin_drive_cleanRemoteFiles,
|
||||||
$admin_drive_cleanup,
|
$admin_drive_cleanup,
|
||||||
$admin_drive_files,
|
$admin_drive_files,
|
||||||
@@ -1109,8 +1103,6 @@ const $retention: Provider = { provide: 'ep:retention', useClass: ep___retention
|
|||||||
$admin_avatarDecorations_list,
|
$admin_avatarDecorations_list,
|
||||||
$admin_avatarDecorations_update,
|
$admin_avatarDecorations_update,
|
||||||
$admin_deleteAllFilesOfAUser,
|
$admin_deleteAllFilesOfAUser,
|
||||||
$admin_unsetUserAvatar,
|
|
||||||
$admin_unsetUserBanner,
|
|
||||||
$admin_drive_cleanRemoteFiles,
|
$admin_drive_cleanRemoteFiles,
|
||||||
$admin_drive_cleanup,
|
$admin_drive_cleanup,
|
||||||
$admin_drive_files,
|
$admin_drive_files,
|
||||||
|
@@ -126,7 +126,7 @@ export class SignupApiService {
|
|||||||
code: invitationCode,
|
code: invitationCode,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (ticket == null || ticket.usedById != null) {
|
if (ticket == null) {
|
||||||
reply.code(400);
|
reply.code(400);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -24,8 +24,6 @@ import * as ep___admin_avatarDecorations_delete from './endpoints/admin/avatar-d
|
|||||||
import * as ep___admin_avatarDecorations_list from './endpoints/admin/avatar-decorations/list.js';
|
import * as ep___admin_avatarDecorations_list from './endpoints/admin/avatar-decorations/list.js';
|
||||||
import * as ep___admin_avatarDecorations_update from './endpoints/admin/avatar-decorations/update.js';
|
import * as ep___admin_avatarDecorations_update from './endpoints/admin/avatar-decorations/update.js';
|
||||||
import * as ep___admin_deleteAllFilesOfAUser from './endpoints/admin/delete-all-files-of-a-user.js';
|
import * as ep___admin_deleteAllFilesOfAUser from './endpoints/admin/delete-all-files-of-a-user.js';
|
||||||
import * as ep___admin_unsetUserAvatar from './endpoints/admin/unset-user-avatar.js';
|
|
||||||
import * as ep___admin_unsetUserBanner from './endpoints/admin/unset-user-banner.js';
|
|
||||||
import * as ep___admin_drive_cleanRemoteFiles from './endpoints/admin/drive/clean-remote-files.js';
|
import * as ep___admin_drive_cleanRemoteFiles from './endpoints/admin/drive/clean-remote-files.js';
|
||||||
import * as ep___admin_drive_cleanup from './endpoints/admin/drive/cleanup.js';
|
import * as ep___admin_drive_cleanup from './endpoints/admin/drive/cleanup.js';
|
||||||
import * as ep___admin_drive_files from './endpoints/admin/drive/files.js';
|
import * as ep___admin_drive_files from './endpoints/admin/drive/files.js';
|
||||||
@@ -383,8 +381,6 @@ const eps = [
|
|||||||
['admin/avatar-decorations/list', ep___admin_avatarDecorations_list],
|
['admin/avatar-decorations/list', ep___admin_avatarDecorations_list],
|
||||||
['admin/avatar-decorations/update', ep___admin_avatarDecorations_update],
|
['admin/avatar-decorations/update', ep___admin_avatarDecorations_update],
|
||||||
['admin/delete-all-files-of-a-user', ep___admin_deleteAllFilesOfAUser],
|
['admin/delete-all-files-of-a-user', ep___admin_deleteAllFilesOfAUser],
|
||||||
['admin/unset-user-avatar', ep___admin_unsetUserAvatar],
|
|
||||||
['admin/unset-user-banner', ep___admin_unsetUserBanner],
|
|
||||||
['admin/drive/clean-remote-files', ep___admin_drive_cleanRemoteFiles],
|
['admin/drive/clean-remote-files', ep___admin_drive_cleanRemoteFiles],
|
||||||
['admin/drive/cleanup', ep___admin_drive_cleanup],
|
['admin/drive/cleanup', ep___admin_drive_cleanup],
|
||||||
['admin/drive/files', ep___admin_drive_files],
|
['admin/drive/files', ep___admin_drive_files],
|
||||||
|
@@ -22,7 +22,7 @@ export const paramDef = {
|
|||||||
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
|
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
|
||||||
sinceId: { type: 'string', format: 'misskey:id' },
|
sinceId: { type: 'string', format: 'misskey:id' },
|
||||||
untilId: { type: 'string', format: 'misskey:id' },
|
untilId: { type: 'string', format: 'misskey:id' },
|
||||||
publishing: { type: 'boolean', default: null, nullable: true },
|
publishing: { type: 'boolean', default: false },
|
||||||
},
|
},
|
||||||
required: [],
|
required: [],
|
||||||
} as const;
|
} as const;
|
||||||
@@ -37,10 +37,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const query = this.queryService.makePaginationQuery(this.adsRepository.createQueryBuilder('ad'), ps.sinceId, ps.untilId);
|
const query = this.queryService.makePaginationQuery(this.adsRepository.createQueryBuilder('ad'), ps.sinceId, ps.untilId);
|
||||||
if (ps.publishing === true) {
|
if (ps.publishing) {
|
||||||
query.andWhere('ad.expiresAt > :now', { now: new Date() }).andWhere('ad.startsAt <= :now', { now: new Date() });
|
query.andWhere('ad.expiresAt > :now', { now: new Date() }).andWhere('ad.startsAt <= :now', { now: new Date() });
|
||||||
} else if (ps.publishing === false) {
|
|
||||||
query.andWhere('ad.expiresAt <= :now', { now: new Date() }).orWhere('ad.startsAt > :now', { now: new Date() });
|
|
||||||
}
|
}
|
||||||
const ads = await query.limit(ps.limit).getMany();
|
const ads = await query.limit(ps.limit).getMany();
|
||||||
|
|
||||||
|
@@ -267,14 +267,6 @@ export const meta = {
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
enableVerifymailApi: {
|
|
||||||
type: 'boolean',
|
|
||||||
optional: false, nullable: false,
|
|
||||||
},
|
|
||||||
verifymailAuthKey: {
|
|
||||||
type: 'string',
|
|
||||||
optional: false, nullable: true,
|
|
||||||
},
|
|
||||||
enableChartsForRemoteUser: {
|
enableChartsForRemoteUser: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
@@ -429,8 +421,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
deeplIsPro: instance.deeplIsPro,
|
deeplIsPro: instance.deeplIsPro,
|
||||||
enableIpLogging: instance.enableIpLogging,
|
enableIpLogging: instance.enableIpLogging,
|
||||||
enableActiveEmailValidation: instance.enableActiveEmailValidation,
|
enableActiveEmailValidation: instance.enableActiveEmailValidation,
|
||||||
enableVerifymailApi: instance.enableVerifymailApi,
|
|
||||||
verifymailAuthKey: instance.verifymailAuthKey,
|
|
||||||
enableChartsForRemoteUser: instance.enableChartsForRemoteUser,
|
enableChartsForRemoteUser: instance.enableChartsForRemoteUser,
|
||||||
enableChartsForFederatedInstances: instance.enableChartsForFederatedInstances,
|
enableChartsForFederatedInstances: instance.enableChartsForFederatedInstances,
|
||||||
enableServerMachineStats: instance.enableServerMachineStats,
|
enableServerMachineStats: instance.enableServerMachineStats,
|
||||||
|
@@ -1,60 +0,0 @@
|
|||||||
/*
|
|
||||||
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
|
||||||
import type { UsersRepository } from '@/models/_.js';
|
|
||||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
|
||||||
import { DI } from '@/di-symbols.js';
|
|
||||||
import { ModerationLogService } from '@/core/ModerationLogService.js';
|
|
||||||
|
|
||||||
export const meta = {
|
|
||||||
tags: ['admin'],
|
|
||||||
|
|
||||||
requireCredential: true,
|
|
||||||
requireModerator: true,
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
export const paramDef = {
|
|
||||||
type: 'object',
|
|
||||||
properties: {
|
|
||||||
userId: { type: 'string', format: 'misskey:id' },
|
|
||||||
},
|
|
||||||
required: ['userId'],
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
// eslint-disable-next-line import/no-default-export
|
|
||||||
@Injectable()
|
|
||||||
export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|
||||||
constructor(
|
|
||||||
@Inject(DI.usersRepository)
|
|
||||||
private usersRepository: UsersRepository,
|
|
||||||
|
|
||||||
private moderationLogService: ModerationLogService,
|
|
||||||
) {
|
|
||||||
super(meta, paramDef, async (ps, me) => {
|
|
||||||
const user = await this.usersRepository.findOneBy({ id: ps.userId });
|
|
||||||
|
|
||||||
if (user == null) {
|
|
||||||
throw new Error('user not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (user.avatarId == null) return;
|
|
||||||
|
|
||||||
await this.usersRepository.update(user.id, {
|
|
||||||
avatar: null,
|
|
||||||
avatarId: null,
|
|
||||||
avatarUrl: null,
|
|
||||||
avatarBlurhash: null,
|
|
||||||
});
|
|
||||||
|
|
||||||
this.moderationLogService.log(me, 'unsetUserAvatar', {
|
|
||||||
userId: user.id,
|
|
||||||
userUsername: user.username,
|
|
||||||
userHost: user.host,
|
|
||||||
fileId: user.avatarId,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,60 +0,0 @@
|
|||||||
/*
|
|
||||||
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
|
||||||
import type { UsersRepository } from '@/models/_.js';
|
|
||||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
|
||||||
import { DI } from '@/di-symbols.js';
|
|
||||||
import { ModerationLogService } from '@/core/ModerationLogService.js';
|
|
||||||
|
|
||||||
export const meta = {
|
|
||||||
tags: ['admin'],
|
|
||||||
|
|
||||||
requireCredential: true,
|
|
||||||
requireModerator: true,
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
export const paramDef = {
|
|
||||||
type: 'object',
|
|
||||||
properties: {
|
|
||||||
userId: { type: 'string', format: 'misskey:id' },
|
|
||||||
},
|
|
||||||
required: ['userId'],
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
// eslint-disable-next-line import/no-default-export
|
|
||||||
@Injectable()
|
|
||||||
export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|
||||||
constructor(
|
|
||||||
@Inject(DI.usersRepository)
|
|
||||||
private usersRepository: UsersRepository,
|
|
||||||
|
|
||||||
private moderationLogService: ModerationLogService,
|
|
||||||
) {
|
|
||||||
super(meta, paramDef, async (ps, me) => {
|
|
||||||
const user = await this.usersRepository.findOneBy({ id: ps.userId });
|
|
||||||
|
|
||||||
if (user == null) {
|
|
||||||
throw new Error('user not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (user.bannerId == null) return;
|
|
||||||
|
|
||||||
await this.usersRepository.update(user.id, {
|
|
||||||
banner: null,
|
|
||||||
bannerId: null,
|
|
||||||
bannerUrl: null,
|
|
||||||
bannerBlurhash: null,
|
|
||||||
});
|
|
||||||
|
|
||||||
this.moderationLogService.log(me, 'unsetUserBanner', {
|
|
||||||
userId: user.id,
|
|
||||||
userUsername: user.username,
|
|
||||||
userHost: user.host,
|
|
||||||
fileId: user.bannerId,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@@ -113,8 +113,6 @@ export const paramDef = {
|
|||||||
objectStorageS3ForcePathStyle: { type: 'boolean' },
|
objectStorageS3ForcePathStyle: { type: 'boolean' },
|
||||||
enableIpLogging: { type: 'boolean' },
|
enableIpLogging: { type: 'boolean' },
|
||||||
enableActiveEmailValidation: { type: 'boolean' },
|
enableActiveEmailValidation: { type: 'boolean' },
|
||||||
enableVerifymailApi: { type: 'boolean' },
|
|
||||||
verifymailAuthKey: { type: 'string', nullable: true },
|
|
||||||
enableChartsForRemoteUser: { type: 'boolean' },
|
enableChartsForRemoteUser: { type: 'boolean' },
|
||||||
enableChartsForFederatedInstances: { type: 'boolean' },
|
enableChartsForFederatedInstances: { type: 'boolean' },
|
||||||
enableServerMachineStats: { type: 'boolean' },
|
enableServerMachineStats: { type: 'boolean' },
|
||||||
@@ -456,18 +454,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
set.enableActiveEmailValidation = ps.enableActiveEmailValidation;
|
set.enableActiveEmailValidation = ps.enableActiveEmailValidation;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ps.enableVerifymailApi !== undefined) {
|
|
||||||
set.enableVerifymailApi = ps.enableVerifymailApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.verifymailAuthKey !== undefined) {
|
|
||||||
if (ps.verifymailAuthKey === '') {
|
|
||||||
set.verifymailAuthKey = null;
|
|
||||||
} else {
|
|
||||||
set.verifymailAuthKey = ps.verifymailAuthKey;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.enableChartsForRemoteUser !== undefined) {
|
if (ps.enableChartsForRemoteUser !== undefined) {
|
||||||
set.enableChartsForRemoteUser = ps.enableChartsForRemoteUser;
|
set.enableChartsForRemoteUser = ps.enableChartsForRemoteUser;
|
||||||
}
|
}
|
||||||
|
@@ -12,8 +12,7 @@ import { NoteReadService } from '@/core/NoteReadService.js';
|
|||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
|
import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
|
||||||
import { IdService } from '@/core/IdService.js';
|
import { IdService } from '@/core/IdService.js';
|
||||||
import { FanoutTimelineService } from '@/core/FanoutTimelineService.js';
|
import { FunoutTimelineService } from '@/core/FunoutTimelineService.js';
|
||||||
import { GlobalEventService } from '@/core/GlobalEventService.js';
|
|
||||||
import { ApiError } from '../../error.js';
|
import { ApiError } from '../../error.js';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
@@ -71,8 +70,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
private noteEntityService: NoteEntityService,
|
private noteEntityService: NoteEntityService,
|
||||||
private queryService: QueryService,
|
private queryService: QueryService,
|
||||||
private noteReadService: NoteReadService,
|
private noteReadService: NoteReadService,
|
||||||
private fanoutTimelineService: FanoutTimelineService,
|
private funoutTimelineService: FunoutTimelineService,
|
||||||
private globalEventService: GlobalEventService,
|
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : null);
|
const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : null);
|
||||||
@@ -87,18 +85,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
throw new ApiError(meta.errors.noSuchAntenna);
|
throw new ApiError(meta.errors.noSuchAntenna);
|
||||||
}
|
}
|
||||||
|
|
||||||
// falseだった場合はアンテナの配信先が増えたことを通知したい
|
this.antennasRepository.update(antenna.id, {
|
||||||
const needPublishEvent = !antenna.isActive;
|
isActive: true,
|
||||||
|
lastUsedAt: new Date(),
|
||||||
|
});
|
||||||
|
|
||||||
antenna.isActive = true;
|
let noteIds = await this.funoutTimelineService.get(`antennaTimeline:${antenna.id}`, untilId, sinceId);
|
||||||
antenna.lastUsedAt = new Date();
|
|
||||||
this.antennasRepository.update(antenna.id, antenna);
|
|
||||||
|
|
||||||
if (needPublishEvent) {
|
|
||||||
this.globalEventService.publishInternalEvent('antennaUpdated', antenna);
|
|
||||||
}
|
|
||||||
|
|
||||||
let noteIds = await this.fanoutTimelineService.get(`antennaTimeline:${antenna.id}`, untilId, sinceId);
|
|
||||||
noteIds = noteIds.slice(0, ps.limit);
|
noteIds = noteIds.slice(0, ps.limit);
|
||||||
if (noteIds.length === 0) {
|
if (noteIds.length === 0) {
|
||||||
return [];
|
return [];
|
||||||
|
@@ -12,10 +12,9 @@ import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
|
|||||||
import ActiveUsersChart from '@/core/chart/charts/active-users.js';
|
import ActiveUsersChart from '@/core/chart/charts/active-users.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import { IdService } from '@/core/IdService.js';
|
import { IdService } from '@/core/IdService.js';
|
||||||
import { FanoutTimelineService } from '@/core/FanoutTimelineService.js';
|
import { FunoutTimelineService } from '@/core/FunoutTimelineService.js';
|
||||||
import { isUserRelated } from '@/misc/is-user-related.js';
|
import { isUserRelated } from '@/misc/is-user-related.js';
|
||||||
import { CacheService } from '@/core/CacheService.js';
|
import { CacheService } from '@/core/CacheService.js';
|
||||||
import { MetaService } from '@/core/MetaService.js';
|
|
||||||
import { ApiError } from '../../error.js';
|
import { ApiError } from '../../error.js';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
@@ -70,18 +69,15 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
private idService: IdService,
|
private idService: IdService,
|
||||||
private noteEntityService: NoteEntityService,
|
private noteEntityService: NoteEntityService,
|
||||||
private queryService: QueryService,
|
private queryService: QueryService,
|
||||||
private fanoutTimelineService: FanoutTimelineService,
|
private funoutTimelineService: FunoutTimelineService,
|
||||||
private cacheService: CacheService,
|
private cacheService: CacheService,
|
||||||
private activeUsersChart: ActiveUsersChart,
|
private activeUsersChart: ActiveUsersChart,
|
||||||
private metaService: MetaService,
|
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : null);
|
const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : null);
|
||||||
const sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.gen(ps.sinceDate!) : null);
|
const sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.gen(ps.sinceDate!) : null);
|
||||||
const isRangeSpecified = untilId != null && sinceId != null;
|
const isRangeSpecified = untilId != null && sinceId != null;
|
||||||
|
|
||||||
const serverSettings = await this.metaService.fetch();
|
|
||||||
|
|
||||||
const channel = await this.channelsRepository.findOneBy({
|
const channel = await this.channelsRepository.findOneBy({
|
||||||
id: ps.channelId,
|
id: ps.channelId,
|
||||||
});
|
});
|
||||||
@@ -92,14 +88,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
|
|
||||||
if (me) this.activeUsersChart.read(me);
|
if (me) this.activeUsersChart.read(me);
|
||||||
|
|
||||||
if (serverSettings.enableFanoutTimeline && (isRangeSpecified || sinceId == null)) {
|
if (isRangeSpecified || sinceId == null) {
|
||||||
const [
|
const [
|
||||||
userIdsWhoMeMuting,
|
userIdsWhoMeMuting,
|
||||||
] = me ? await Promise.all([
|
] = me ? await Promise.all([
|
||||||
this.cacheService.userMutingsCache.fetch(me.id),
|
this.cacheService.userMutingsCache.fetch(me.id),
|
||||||
]) : [new Set<string>()];
|
]) : [new Set<string>()];
|
||||||
|
|
||||||
let noteIds = await this.fanoutTimelineService.get(`channelTimeline:${channel.id}`, untilId, sinceId);
|
let noteIds = await this.funoutTimelineService.get(`channelTimeline:${channel.id}`, untilId, sinceId);
|
||||||
noteIds = noteIds.slice(0, ps.limit);
|
noteIds = noteIds.slice(0, ps.limit);
|
||||||
|
|
||||||
if (noteIds.length > 0) {
|
if (noteIds.length > 0) {
|
||||||
|
@@ -16,9 +16,12 @@ export const meta = {
|
|||||||
requireCredential: false,
|
requireCredential: false,
|
||||||
|
|
||||||
res: {
|
res: {
|
||||||
type: 'object',
|
oneOf: [{
|
||||||
optional: false, nullable: true,
|
type: 'object',
|
||||||
ref: 'FederationInstance',
|
ref: 'FederationInstance',
|
||||||
|
}, {
|
||||||
|
type: 'null',
|
||||||
|
}],
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
@@ -8,7 +8,6 @@ import { Endpoint } from '@/server/api/endpoint-base.js';
|
|||||||
import type { GalleryPostsRepository } from '@/models/_.js';
|
import type { GalleryPostsRepository } from '@/models/_.js';
|
||||||
import { GalleryPostEntityService } from '@/core/entities/GalleryPostEntityService.js';
|
import { GalleryPostEntityService } from '@/core/entities/GalleryPostEntityService.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import { FeaturedService } from '@/core/FeaturedService.js';
|
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
tags: ['gallery'],
|
tags: ['gallery'],
|
||||||
@@ -28,49 +27,25 @@ export const meta = {
|
|||||||
|
|
||||||
export const paramDef = {
|
export const paramDef = {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {},
|
||||||
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
|
|
||||||
untilId: { type: 'string', format: 'misskey:id' },
|
|
||||||
},
|
|
||||||
required: [],
|
required: [],
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-disable-line import/no-default-export
|
export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-disable-line import/no-default-export
|
||||||
private galleryPostsRankingCache: string[] = [];
|
|
||||||
private galleryPostsRankingCacheLastFetchedAt = 0;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(DI.galleryPostsRepository)
|
@Inject(DI.galleryPostsRepository)
|
||||||
private galleryPostsRepository: GalleryPostsRepository,
|
private galleryPostsRepository: GalleryPostsRepository,
|
||||||
|
|
||||||
private galleryPostEntityService: GalleryPostEntityService,
|
private galleryPostEntityService: GalleryPostEntityService,
|
||||||
private featuredService: FeaturedService,
|
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
let postIds: string[];
|
|
||||||
if (this.galleryPostsRankingCacheLastFetchedAt !== 0 && (Date.now() - this.galleryPostsRankingCacheLastFetchedAt < 1000 * 60 * 30)) {
|
|
||||||
postIds = this.galleryPostsRankingCache;
|
|
||||||
} else {
|
|
||||||
postIds = await this.featuredService.getGalleryPostsRanking(100);
|
|
||||||
this.galleryPostsRankingCache = postIds;
|
|
||||||
this.galleryPostsRankingCacheLastFetchedAt = Date.now();
|
|
||||||
}
|
|
||||||
|
|
||||||
postIds.sort((a, b) => a > b ? -1 : 1);
|
|
||||||
if (ps.untilId) {
|
|
||||||
postIds = postIds.filter(id => id < ps.untilId!);
|
|
||||||
}
|
|
||||||
postIds = postIds.slice(0, ps.limit);
|
|
||||||
|
|
||||||
if (postIds.length === 0) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
const query = this.galleryPostsRepository.createQueryBuilder('post')
|
const query = this.galleryPostsRepository.createQueryBuilder('post')
|
||||||
.where('post.id IN (:...postIds)', { postIds: postIds });
|
.andWhere('post.createdAt > :date', { date: new Date(Date.now() - (1000 * 60 * 60 * 24 * 3)) })
|
||||||
|
.andWhere('post.likedCount > 0')
|
||||||
|
.orderBy('post.likedCount', 'DESC');
|
||||||
|
|
||||||
const posts = await query.getMany();
|
const posts = await query.limit(10).getMany();
|
||||||
|
|
||||||
return await this.galleryPostEntityService.packMany(posts, me);
|
return await this.galleryPostEntityService.packMany(posts, me);
|
||||||
});
|
});
|
||||||
|
@@ -6,7 +6,6 @@
|
|||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||||
import type { GalleryLikesRepository, GalleryPostsRepository } from '@/models/_.js';
|
import type { GalleryLikesRepository, GalleryPostsRepository } from '@/models/_.js';
|
||||||
import { FeaturedService, GALLERY_POSTS_RANKING_WINDOW } from '@/core/FeaturedService.js';
|
|
||||||
import { IdService } from '@/core/IdService.js';
|
import { IdService } from '@/core/IdService.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import { ApiError } from '../../../error.js';
|
import { ApiError } from '../../../error.js';
|
||||||
@@ -58,7 +57,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
@Inject(DI.galleryLikesRepository)
|
@Inject(DI.galleryLikesRepository)
|
||||||
private galleryLikesRepository: GalleryLikesRepository,
|
private galleryLikesRepository: GalleryLikesRepository,
|
||||||
|
|
||||||
private featuredService: FeaturedService,
|
|
||||||
private idService: IdService,
|
private idService: IdService,
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
@@ -90,11 +88,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
userId: me.id,
|
userId: me.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
// ランキング更新
|
|
||||||
if (Date.now() - this.idService.parse(post.id).date.getTime() < GALLERY_POSTS_RANKING_WINDOW) {
|
|
||||||
await this.featuredService.updateGalleryPostsRanking(post.id, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.galleryPostsRepository.increment({ id: post.id }, 'likedCount', 1);
|
this.galleryPostsRepository.increment({ id: post.id }, 'likedCount', 1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -6,8 +6,6 @@
|
|||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||||
import type { GalleryPostsRepository, GalleryLikesRepository } from '@/models/_.js';
|
import type { GalleryPostsRepository, GalleryLikesRepository } from '@/models/_.js';
|
||||||
import { FeaturedService, GALLERY_POSTS_RANKING_WINDOW } from '@/core/FeaturedService.js';
|
|
||||||
import { IdService } from '@/core/IdService.js';
|
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import { ApiError } from '../../../error.js';
|
import { ApiError } from '../../../error.js';
|
||||||
|
|
||||||
@@ -51,9 +49,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
|
|
||||||
@Inject(DI.galleryLikesRepository)
|
@Inject(DI.galleryLikesRepository)
|
||||||
private galleryLikesRepository: GalleryLikesRepository,
|
private galleryLikesRepository: GalleryLikesRepository,
|
||||||
|
|
||||||
private featuredService: FeaturedService,
|
|
||||||
private idService: IdService,
|
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const post = await this.galleryPostsRepository.findOneBy({ id: ps.postId });
|
const post = await this.galleryPostsRepository.findOneBy({ id: ps.postId });
|
||||||
@@ -73,11 +68,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
// Delete like
|
// Delete like
|
||||||
await this.galleryLikesRepository.delete(exist.id);
|
await this.galleryLikesRepository.delete(exist.id);
|
||||||
|
|
||||||
// ランキング更新
|
|
||||||
if (Date.now() - this.idService.parse(post.id).date.getTime() < GALLERY_POSTS_RANKING_WINDOW) {
|
|
||||||
await this.featuredService.updateGalleryPostsRanking(post.id, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.galleryPostsRepository.decrement({ id: post.id }, 'likedCount', 1);
|
this.galleryPostsRepository.decrement({ id: post.id }, 'likedCount', 1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -123,11 +123,6 @@ export const meta = {
|
|||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
const muteWords = { type: 'array', items: { oneOf: [
|
|
||||||
{ type: 'array', items: { type: 'string' } },
|
|
||||||
{ type: 'string' }
|
|
||||||
] } } as const;
|
|
||||||
|
|
||||||
export const paramDef = {
|
export const paramDef = {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
@@ -176,8 +171,7 @@ export const paramDef = {
|
|||||||
autoSensitive: { type: 'boolean' },
|
autoSensitive: { type: 'boolean' },
|
||||||
ffVisibility: { type: 'string', enum: ['public', 'followers', 'private'] },
|
ffVisibility: { type: 'string', enum: ['public', 'followers', 'private'] },
|
||||||
pinnedPageId: { type: 'string', format: 'misskey:id', nullable: true },
|
pinnedPageId: { type: 'string', format: 'misskey:id', nullable: true },
|
||||||
mutedWords: muteWords,
|
mutedWords: { type: 'array' },
|
||||||
hardMutedWords: muteWords,
|
|
||||||
mutedInstances: { type: 'array', items: {
|
mutedInstances: { type: 'array', items: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
} },
|
} },
|
||||||
@@ -240,20 +234,16 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
if (ps.location !== undefined) profileUpdates.location = ps.location;
|
if (ps.location !== undefined) profileUpdates.location = ps.location;
|
||||||
if (ps.birthday !== undefined) profileUpdates.birthday = ps.birthday;
|
if (ps.birthday !== undefined) profileUpdates.birthday = ps.birthday;
|
||||||
if (ps.ffVisibility !== undefined) profileUpdates.ffVisibility = ps.ffVisibility;
|
if (ps.ffVisibility !== undefined) profileUpdates.ffVisibility = ps.ffVisibility;
|
||||||
|
if (ps.mutedWords !== undefined) {
|
||||||
function checkMuteWordCount(mutedWords: (string[] | string)[], limit: number) {
|
|
||||||
// TODO: ちゃんと数える
|
// TODO: ちゃんと数える
|
||||||
const length = JSON.stringify(mutedWords).length;
|
const length = JSON.stringify(ps.mutedWords).length;
|
||||||
if (length > limit) {
|
if (length > (await this.roleService.getUserPolicies(user.id)).wordMuteLimit) {
|
||||||
throw new ApiError(meta.errors.tooManyMutedWords);
|
throw new ApiError(meta.errors.tooManyMutedWords);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function validateMuteWordRegex(mutedWords: (string[] | string)[]) {
|
// validate regular expression syntax
|
||||||
for (const mutedWord of mutedWords) {
|
ps.mutedWords.filter(x => !Array.isArray(x)).forEach(x => {
|
||||||
if (typeof mutedWord !== "string") continue;
|
const regexp = x.match(/^\/(.+)\/(.*)$/);
|
||||||
|
|
||||||
const regexp = mutedWord.match(/^\/(.+)\/(.*)$/);
|
|
||||||
if (!regexp) throw new ApiError(meta.errors.invalidRegexp);
|
if (!regexp) throw new ApiError(meta.errors.invalidRegexp);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -261,21 +251,11 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new ApiError(meta.errors.invalidRegexp);
|
throw new ApiError(meta.errors.invalidRegexp);
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
|
||||||
|
|
||||||
if (ps.mutedWords !== undefined) {
|
|
||||||
checkMuteWordCount(ps.mutedWords, (await this.roleService.getUserPolicies(user.id)).wordMuteLimit);
|
|
||||||
validateMuteWordRegex(ps.mutedWords);
|
|
||||||
|
|
||||||
profileUpdates.mutedWords = ps.mutedWords;
|
profileUpdates.mutedWords = ps.mutedWords;
|
||||||
profileUpdates.enableWordMute = ps.mutedWords.length > 0;
|
profileUpdates.enableWordMute = ps.mutedWords.length > 0;
|
||||||
}
|
}
|
||||||
if (ps.hardMutedWords !== undefined) {
|
|
||||||
checkMuteWordCount(ps.hardMutedWords, (await this.roleService.getUserPolicies(user.id)).wordMuteLimit);
|
|
||||||
validateMuteWordRegex(ps.hardMutedWords);
|
|
||||||
profileUpdates.hardMutedWords = ps.hardMutedWords;
|
|
||||||
}
|
|
||||||
if (ps.mutedInstances !== undefined) profileUpdates.mutedInstances = ps.mutedInstances;
|
if (ps.mutedInstances !== undefined) profileUpdates.mutedInstances = ps.mutedInstances;
|
||||||
if (ps.notificationRecieveConfig !== undefined) profileUpdates.notificationRecieveConfig = ps.notificationRecieveConfig;
|
if (ps.notificationRecieveConfig !== undefined) profileUpdates.notificationRecieveConfig = ps.notificationRecieveConfig;
|
||||||
if (typeof ps.isLocked === 'boolean') updates.isLocked = ps.isLocked;
|
if (typeof ps.isLocked === 'boolean') updates.isLocked = ps.isLocked;
|
||||||
|
@@ -262,7 +262,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
if (renote.channelId && renote.channelId !== ps.channelId) {
|
if (renote.channelId && renote.channelId !== ps.channelId) {
|
||||||
// チャンネルのノートに対しリノート要求がきたとき、チャンネル外へのリノート可否をチェック
|
// チャンネルのノートに対しリノート要求がきたとき、チャンネル外へのリノート可否をチェック
|
||||||
// リノートのユースケースのうち、チャンネル内→チャンネル外は少数だと考えられるため、JOINはせず必要な時に都度取得する
|
// リノートのユースケースのうち、チャンネル内→チャンネル外は少数だと考えられるため、JOINはせず必要な時に都度取得する
|
||||||
const renoteChannel = await this.channelsRepository.findOneBy({ id: renote.channelId });
|
const renoteChannel = await this.channelsRepository.findOneById(renote.channelId);
|
||||||
if (renoteChannel == null) {
|
if (renoteChannel == null) {
|
||||||
// リノートしたいノートが書き込まれているチャンネルが無い
|
// リノートしたいノートが書き込まれているチャンネルが無い
|
||||||
throw new ApiError(meta.errors.noSuchChannel);
|
throw new ApiError(meta.errors.noSuchChannel);
|
||||||
|
@@ -64,16 +64,16 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (noteIds.length === 0) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
noteIds.sort((a, b) => a > b ? -1 : 1);
|
noteIds.sort((a, b) => a > b ? -1 : 1);
|
||||||
if (ps.untilId) {
|
if (ps.untilId) {
|
||||||
noteIds = noteIds.filter(id => id < ps.untilId!);
|
noteIds = noteIds.filter(id => id < ps.untilId!);
|
||||||
}
|
}
|
||||||
noteIds = noteIds.slice(0, ps.limit);
|
noteIds = noteIds.slice(0, ps.limit);
|
||||||
|
|
||||||
if (noteIds.length === 0) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
const query = this.notesRepository.createQueryBuilder('note')
|
const query = this.notesRepository.createQueryBuilder('note')
|
||||||
.where('note.id IN (:...noteIds)', { noteIds: noteIds })
|
.where('note.id IN (:...noteIds)', { noteIds: noteIds })
|
||||||
.innerJoinAndSelect('note.user', 'user')
|
.innerJoinAndSelect('note.user', 'user')
|
||||||
|
@@ -14,7 +14,7 @@ import { RoleService } from '@/core/RoleService.js';
|
|||||||
import { IdService } from '@/core/IdService.js';
|
import { IdService } from '@/core/IdService.js';
|
||||||
import { isUserRelated } from '@/misc/is-user-related.js';
|
import { isUserRelated } from '@/misc/is-user-related.js';
|
||||||
import { CacheService } from '@/core/CacheService.js';
|
import { CacheService } from '@/core/CacheService.js';
|
||||||
import { FanoutTimelineService } from '@/core/FanoutTimelineService.js';
|
import { FunoutTimelineService } from '@/core/FunoutTimelineService.js';
|
||||||
import { QueryService } from '@/core/QueryService.js';
|
import { QueryService } from '@/core/QueryService.js';
|
||||||
import { UserFollowingService } from '@/core/UserFollowingService.js';
|
import { UserFollowingService } from '@/core/UserFollowingService.js';
|
||||||
import { MetaService } from '@/core/MetaService.js';
|
import { MetaService } from '@/core/MetaService.js';
|
||||||
@@ -77,7 +77,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
private activeUsersChart: ActiveUsersChart,
|
private activeUsersChart: ActiveUsersChart,
|
||||||
private idService: IdService,
|
private idService: IdService,
|
||||||
private cacheService: CacheService,
|
private cacheService: CacheService,
|
||||||
private fanoutTimelineService: FanoutTimelineService,
|
private funoutTimelineService: FunoutTimelineService,
|
||||||
private queryService: QueryService,
|
private queryService: QueryService,
|
||||||
private userFollowingService: UserFollowingService,
|
private userFollowingService: UserFollowingService,
|
||||||
private metaService: MetaService,
|
private metaService: MetaService,
|
||||||
@@ -120,20 +120,20 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
let shouldFallbackToDb = false;
|
let shouldFallbackToDb = false;
|
||||||
|
|
||||||
if (ps.withFiles) {
|
if (ps.withFiles) {
|
||||||
const [htlNoteIds, ltlNoteIds] = await this.fanoutTimelineService.getMulti([
|
const [htlNoteIds, ltlNoteIds] = await this.funoutTimelineService.getMulti([
|
||||||
`homeTimelineWithFiles:${me.id}`,
|
`homeTimelineWithFiles:${me.id}`,
|
||||||
'localTimelineWithFiles',
|
'localTimelineWithFiles',
|
||||||
], untilId, sinceId);
|
], untilId, sinceId);
|
||||||
noteIds = Array.from(new Set([...htlNoteIds, ...ltlNoteIds]));
|
noteIds = Array.from(new Set([...htlNoteIds, ...ltlNoteIds]));
|
||||||
} else if (ps.withReplies) {
|
} else if (ps.withReplies) {
|
||||||
const [htlNoteIds, ltlNoteIds, ltlReplyNoteIds] = await this.fanoutTimelineService.getMulti([
|
const [htlNoteIds, ltlNoteIds, ltlReplyNoteIds] = await this.funoutTimelineService.getMulti([
|
||||||
`homeTimeline:${me.id}`,
|
`homeTimeline:${me.id}`,
|
||||||
'localTimeline',
|
'localTimeline',
|
||||||
'localTimelineWithReplies',
|
'localTimelineWithReplies',
|
||||||
], untilId, sinceId);
|
], untilId, sinceId);
|
||||||
noteIds = Array.from(new Set([...htlNoteIds, ...ltlNoteIds, ...ltlReplyNoteIds]));
|
noteIds = Array.from(new Set([...htlNoteIds, ...ltlNoteIds, ...ltlReplyNoteIds]));
|
||||||
} else {
|
} else {
|
||||||
const [htlNoteIds, ltlNoteIds] = await this.fanoutTimelineService.getMulti([
|
const [htlNoteIds, ltlNoteIds] = await this.funoutTimelineService.getMulti([
|
||||||
`homeTimeline:${me.id}`,
|
`homeTimeline:${me.id}`,
|
||||||
'localTimeline',
|
'localTimeline',
|
||||||
], untilId, sinceId);
|
], untilId, sinceId);
|
||||||
|
@@ -14,7 +14,7 @@ import { RoleService } from '@/core/RoleService.js';
|
|||||||
import { IdService } from '@/core/IdService.js';
|
import { IdService } from '@/core/IdService.js';
|
||||||
import { CacheService } from '@/core/CacheService.js';
|
import { CacheService } from '@/core/CacheService.js';
|
||||||
import { isUserRelated } from '@/misc/is-user-related.js';
|
import { isUserRelated } from '@/misc/is-user-related.js';
|
||||||
import { FanoutTimelineService } from '@/core/FanoutTimelineService.js';
|
import { FunoutTimelineService } from '@/core/FunoutTimelineService.js';
|
||||||
import { QueryService } from '@/core/QueryService.js';
|
import { QueryService } from '@/core/QueryService.js';
|
||||||
import { MetaService } from '@/core/MetaService.js';
|
import { MetaService } from '@/core/MetaService.js';
|
||||||
import { MiLocalUser } from '@/models/User.js';
|
import { MiLocalUser } from '@/models/User.js';
|
||||||
@@ -69,7 +69,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
private activeUsersChart: ActiveUsersChart,
|
private activeUsersChart: ActiveUsersChart,
|
||||||
private idService: IdService,
|
private idService: IdService,
|
||||||
private cacheService: CacheService,
|
private cacheService: CacheService,
|
||||||
private fanoutTimelineService: FanoutTimelineService,
|
private funoutTimelineService: FunoutTimelineService,
|
||||||
private queryService: QueryService,
|
private queryService: QueryService,
|
||||||
private metaService: MetaService,
|
private metaService: MetaService,
|
||||||
) {
|
) {
|
||||||
@@ -107,9 +107,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
let noteIds: string[];
|
let noteIds: string[];
|
||||||
|
|
||||||
if (ps.withFiles) {
|
if (ps.withFiles) {
|
||||||
noteIds = await this.fanoutTimelineService.get('localTimelineWithFiles', untilId, sinceId);
|
noteIds = await this.funoutTimelineService.get('localTimelineWithFiles', untilId, sinceId);
|
||||||
} else {
|
} else {
|
||||||
const [nonReplyNoteIds, replyNoteIds] = await this.fanoutTimelineService.getMulti([
|
const [nonReplyNoteIds, replyNoteIds] = await this.funoutTimelineService.getMulti([
|
||||||
'localTimeline',
|
'localTimeline',
|
||||||
'localTimelineWithReplies',
|
'localTimelineWithReplies',
|
||||||
], untilId, sinceId);
|
], untilId, sinceId);
|
||||||
|
@@ -14,7 +14,7 @@ import { DI } from '@/di-symbols.js';
|
|||||||
import { IdService } from '@/core/IdService.js';
|
import { IdService } from '@/core/IdService.js';
|
||||||
import { CacheService } from '@/core/CacheService.js';
|
import { CacheService } from '@/core/CacheService.js';
|
||||||
import { isUserRelated } from '@/misc/is-user-related.js';
|
import { isUserRelated } from '@/misc/is-user-related.js';
|
||||||
import { FanoutTimelineService } from '@/core/FanoutTimelineService.js';
|
import { FunoutTimelineService } from '@/core/FunoutTimelineService.js';
|
||||||
import { UserFollowingService } from '@/core/UserFollowingService.js';
|
import { UserFollowingService } from '@/core/UserFollowingService.js';
|
||||||
import { MiLocalUser } from '@/models/User.js';
|
import { MiLocalUser } from '@/models/User.js';
|
||||||
import { MetaService } from '@/core/MetaService.js';
|
import { MetaService } from '@/core/MetaService.js';
|
||||||
@@ -65,7 +65,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
private activeUsersChart: ActiveUsersChart,
|
private activeUsersChart: ActiveUsersChart,
|
||||||
private idService: IdService,
|
private idService: IdService,
|
||||||
private cacheService: CacheService,
|
private cacheService: CacheService,
|
||||||
private fanoutTimelineService: FanoutTimelineService,
|
private funoutTimelineService: FunoutTimelineService,
|
||||||
private userFollowingService: UserFollowingService,
|
private userFollowingService: UserFollowingService,
|
||||||
private queryService: QueryService,
|
private queryService: QueryService,
|
||||||
private metaService: MetaService,
|
private metaService: MetaService,
|
||||||
@@ -101,7 +101,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
this.cacheService.userBlockedCache.fetch(me.id),
|
this.cacheService.userBlockedCache.fetch(me.id),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
let noteIds = await this.fanoutTimelineService.get(ps.withFiles ? `homeTimelineWithFiles:${me.id}` : `homeTimeline:${me.id}`, untilId, sinceId);
|
let noteIds = await this.funoutTimelineService.get(ps.withFiles ? `homeTimelineWithFiles:${me.id}` : `homeTimeline:${me.id}`, untilId, sinceId);
|
||||||
noteIds = noteIds.slice(0, ps.limit);
|
noteIds = noteIds.slice(0, ps.limit);
|
||||||
|
|
||||||
let redisTimeline: MiNote[] = [];
|
let redisTimeline: MiNote[] = [];
|
||||||
|
@@ -13,7 +13,7 @@ import { DI } from '@/di-symbols.js';
|
|||||||
import { CacheService } from '@/core/CacheService.js';
|
import { CacheService } from '@/core/CacheService.js';
|
||||||
import { IdService } from '@/core/IdService.js';
|
import { IdService } from '@/core/IdService.js';
|
||||||
import { isUserRelated } from '@/misc/is-user-related.js';
|
import { isUserRelated } from '@/misc/is-user-related.js';
|
||||||
import { FanoutTimelineService } from '@/core/FanoutTimelineService.js';
|
import { FunoutTimelineService } from '@/core/FunoutTimelineService.js';
|
||||||
import { QueryService } from '@/core/QueryService.js';
|
import { QueryService } from '@/core/QueryService.js';
|
||||||
import { MiLocalUser } from '@/models/User.js';
|
import { MiLocalUser } from '@/models/User.js';
|
||||||
import { MetaService } from '@/core/MetaService.js';
|
import { MetaService } from '@/core/MetaService.js';
|
||||||
@@ -81,7 +81,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
private activeUsersChart: ActiveUsersChart,
|
private activeUsersChart: ActiveUsersChart,
|
||||||
private cacheService: CacheService,
|
private cacheService: CacheService,
|
||||||
private idService: IdService,
|
private idService: IdService,
|
||||||
private fanoutTimelineService: FanoutTimelineService,
|
private funoutTimelineService: FunoutTimelineService,
|
||||||
private queryService: QueryService,
|
private queryService: QueryService,
|
||||||
private metaService: MetaService,
|
private metaService: MetaService,
|
||||||
) {
|
) {
|
||||||
@@ -123,7 +123,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
this.cacheService.userBlockedCache.fetch(me.id),
|
this.cacheService.userBlockedCache.fetch(me.id),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
let noteIds = await this.fanoutTimelineService.get(ps.withFiles ? `userListTimelineWithFiles:${list.id}` : `userListTimeline:${list.id}`, untilId, sinceId);
|
let noteIds = await this.funoutTimelineService.get(ps.withFiles ? `userListTimelineWithFiles:${list.id}` : `userListTimeline:${list.id}`, untilId, sinceId);
|
||||||
noteIds = noteIds.slice(0, ps.limit);
|
noteIds = noteIds.slice(0, ps.limit);
|
||||||
|
|
||||||
let redisTimeline: MiNote[] = [];
|
let redisTimeline: MiNote[] = [];
|
||||||
|
@@ -11,7 +11,7 @@ import { QueryService } from '@/core/QueryService.js';
|
|||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
|
import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
|
||||||
import { IdService } from '@/core/IdService.js';
|
import { IdService } from '@/core/IdService.js';
|
||||||
import { FanoutTimelineService } from '@/core/FanoutTimelineService.js';
|
import { FunoutTimelineService } from '@/core/FunoutTimelineService.js';
|
||||||
import { ApiError } from '../../error.js';
|
import { ApiError } from '../../error.js';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
@@ -66,7 +66,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
private idService: IdService,
|
private idService: IdService,
|
||||||
private noteEntityService: NoteEntityService,
|
private noteEntityService: NoteEntityService,
|
||||||
private queryService: QueryService,
|
private queryService: QueryService,
|
||||||
private fanoutTimelineService: FanoutTimelineService,
|
private funoutTimelineService: FunoutTimelineService,
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : null);
|
const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : null);
|
||||||
@@ -84,7 +84,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
let noteIds = await this.fanoutTimelineService.get(`roleTimeline:${role.id}`, untilId, sinceId);
|
let noteIds = await this.funoutTimelineService.get(`roleTimeline:${role.id}`, untilId, sinceId);
|
||||||
noteIds = noteIds.slice(0, ps.limit);
|
noteIds = noteIds.slice(0, ps.limit);
|
||||||
|
|
||||||
if (noteIds.length === 0) {
|
if (noteIds.length === 0) {
|
||||||
|
@@ -14,8 +14,7 @@ import { CacheService } from '@/core/CacheService.js';
|
|||||||
import { IdService } from '@/core/IdService.js';
|
import { IdService } from '@/core/IdService.js';
|
||||||
import { isUserRelated } from '@/misc/is-user-related.js';
|
import { isUserRelated } from '@/misc/is-user-related.js';
|
||||||
import { QueryService } from '@/core/QueryService.js';
|
import { QueryService } from '@/core/QueryService.js';
|
||||||
import { FanoutTimelineService } from '@/core/FanoutTimelineService.js';
|
import { FunoutTimelineService } from '@/core/FunoutTimelineService.js';
|
||||||
import { MetaService } from '@/core/MetaService.js';
|
|
||||||
import { ApiError } from '../../error.js';
|
import { ApiError } from '../../error.js';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
@@ -71,8 +70,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
private queryService: QueryService,
|
private queryService: QueryService,
|
||||||
private cacheService: CacheService,
|
private cacheService: CacheService,
|
||||||
private idService: IdService,
|
private idService: IdService,
|
||||||
private fanoutTimelineService: FanoutTimelineService,
|
private funoutTimelineService: FunoutTimelineService,
|
||||||
private metaService: MetaService,
|
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : null);
|
const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : null);
|
||||||
@@ -80,9 +78,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
const isRangeSpecified = untilId != null && sinceId != null;
|
const isRangeSpecified = untilId != null && sinceId != null;
|
||||||
const isSelf = me && (me.id === ps.userId);
|
const isSelf = me && (me.id === ps.userId);
|
||||||
|
|
||||||
const serverSettings = await this.metaService.fetch();
|
if (isRangeSpecified || sinceId == null) {
|
||||||
|
|
||||||
if (serverSettings.enableFanoutTimeline && (isRangeSpecified || sinceId == null)) {
|
|
||||||
const [
|
const [
|
||||||
userIdsWhoMeMuting,
|
userIdsWhoMeMuting,
|
||||||
] = me ? await Promise.all([
|
] = me ? await Promise.all([
|
||||||
@@ -90,9 +86,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
]) : [new Set<string>()];
|
]) : [new Set<string>()];
|
||||||
|
|
||||||
const [noteIdsRes, repliesNoteIdsRes, channelNoteIdsRes] = await Promise.all([
|
const [noteIdsRes, repliesNoteIdsRes, channelNoteIdsRes] = await Promise.all([
|
||||||
this.fanoutTimelineService.get(ps.withFiles ? `userTimelineWithFiles:${ps.userId}` : `userTimeline:${ps.userId}`, untilId, sinceId),
|
this.funoutTimelineService.get(ps.withFiles ? `userTimelineWithFiles:${ps.userId}` : `userTimeline:${ps.userId}`, untilId, sinceId),
|
||||||
ps.withReplies ? this.fanoutTimelineService.get(`userTimelineWithReplies:${ps.userId}`, untilId, sinceId) : Promise.resolve([]),
|
ps.withReplies ? this.funoutTimelineService.get(`userTimelineWithReplies:${ps.userId}`, untilId, sinceId) : Promise.resolve([]),
|
||||||
ps.withChannelNotes ? this.fanoutTimelineService.get(`userTimelineWithChannel:${ps.userId}`, untilId, sinceId) : Promise.resolve([]),
|
ps.withChannelNotes ? this.funoutTimelineService.get(`userTimelineWithChannel:${ps.userId}`, untilId, sinceId) : Promise.resolve([]),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
let noteIds = Array.from(new Set([
|
let noteIds = Array.from(new Set([
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import type { Config } from '@/config.js';
|
import type { Config } from '@/config.js';
|
||||||
import endpoints, { IEndpoint } from '../endpoints.js';
|
import endpoints from '../endpoints.js';
|
||||||
import { errors as basicErrors } from './errors.js';
|
import { errors as basicErrors } from './errors.js';
|
||||||
import { schemas, convertSchemaToOpenApiSchema } from './schemas.js';
|
import { schemas, convertSchemaToOpenApiSchema } from './schemas.js';
|
||||||
|
|
||||||
@@ -33,17 +33,16 @@ export function genOpenapiSpec(config: Config) {
|
|||||||
schemas: schemas,
|
schemas: schemas,
|
||||||
|
|
||||||
securitySchemes: {
|
securitySchemes: {
|
||||||
bearerAuth: {
|
ApiKeyAuth: {
|
||||||
type: 'http',
|
type: 'apiKey',
|
||||||
scheme: 'bearer',
|
in: 'body',
|
||||||
|
name: 'i',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// 書き換えたりするのでディープコピーしておく。そのまま編集するとメモリ上の値が汚れて次回以降の出力に影響する
|
for (const endpoint of endpoints.filter(ep => !ep.meta.secure)) {
|
||||||
const copiedEndpoints = JSON.parse(JSON.stringify(endpoints)) as IEndpoint[];
|
|
||||||
for (const endpoint of copiedEndpoints.filter(ep => !ep.meta.secure)) {
|
|
||||||
const errors = {} as any;
|
const errors = {} as any;
|
||||||
|
|
||||||
if (endpoint.meta.errors) {
|
if (endpoint.meta.errors) {
|
||||||
@@ -80,13 +79,6 @@ export function genOpenapiSpec(config: Config) {
|
|||||||
schema.required = [...schema.required ?? [], 'file'];
|
schema.required = [...schema.required ?? [], 'file'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (schema.required && schema.required.length <= 0) {
|
|
||||||
// 空配列は許可されない
|
|
||||||
schema.required = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
const hasBody = (schema.type === 'object' && schema.properties && Object.keys(schema.properties).length >= 1);
|
|
||||||
|
|
||||||
const info = {
|
const info = {
|
||||||
operationId: endpoint.name,
|
operationId: endpoint.name,
|
||||||
summary: endpoint.name,
|
summary: endpoint.name,
|
||||||
@@ -100,19 +92,17 @@ export function genOpenapiSpec(config: Config) {
|
|||||||
} : {}),
|
} : {}),
|
||||||
...(endpoint.meta.requireCredential ? {
|
...(endpoint.meta.requireCredential ? {
|
||||||
security: [{
|
security: [{
|
||||||
bearerAuth: [],
|
ApiKeyAuth: [],
|
||||||
}],
|
}],
|
||||||
} : {}),
|
} : {}),
|
||||||
...(hasBody ? {
|
requestBody: {
|
||||||
requestBody: {
|
required: true,
|
||||||
required: true,
|
content: {
|
||||||
content: {
|
[requestType]: {
|
||||||
[requestType]: {
|
schema,
|
||||||
schema,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} : {}),
|
},
|
||||||
responses: {
|
responses: {
|
||||||
...(endpoint.meta.res ? {
|
...(endpoint.meta.res ? {
|
||||||
'200': {
|
'200': {
|
||||||
@@ -128,11 +118,6 @@ export function genOpenapiSpec(config: Config) {
|
|||||||
description: 'OK (without any results)',
|
description: 'OK (without any results)',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
...(endpoint.meta.res?.optional === true || endpoint.meta.res?.nullable === true ? {
|
|
||||||
'204': {
|
|
||||||
description: 'OK (without any results)',
|
|
||||||
},
|
|
||||||
} : {}),
|
|
||||||
'400': {
|
'400': {
|
||||||
description: 'Client error',
|
description: 'Client error',
|
||||||
content: {
|
content: {
|
||||||
@@ -205,7 +190,6 @@ export function genOpenapiSpec(config: Config) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
spec.paths['/' + endpoint.name] = {
|
spec.paths['/' + endpoint.name] = {
|
||||||
...(endpoint.meta.allowGet ? { get: info } : {}),
|
|
||||||
post: info,
|
post: info,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -7,16 +7,10 @@ import type { Schema } from '@/misc/json-schema.js';
|
|||||||
import { refs } from '@/misc/json-schema.js';
|
import { refs } from '@/misc/json-schema.js';
|
||||||
|
|
||||||
export function convertSchemaToOpenApiSchema(schema: Schema) {
|
export function convertSchemaToOpenApiSchema(schema: Schema) {
|
||||||
// optional, refはスキーマ定義に含まれないので分離しておく
|
const res: any = schema;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
const { optional, ref, ...res }: any = schema;
|
|
||||||
|
|
||||||
if (schema.type === 'object' && schema.properties) {
|
if (schema.type === 'object' && schema.properties) {
|
||||||
const required = Object.entries(schema.properties).filter(([k, v]) => !v.optional).map(([k]) => k);
|
res.required = Object.entries(schema.properties).filter(([k, v]) => !v.optional).map(([k]) => k);
|
||||||
if (required.length > 0) {
|
|
||||||
// 空配列は許可されない
|
|
||||||
res.required = required;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const k of Object.keys(schema.properties)) {
|
for (const k of Object.keys(schema.properties)) {
|
||||||
res.properties[k] = convertSchemaToOpenApiSchema(schema.properties[k]);
|
res.properties[k] = convertSchemaToOpenApiSchema(schema.properties[k]);
|
||||||
|
@@ -58,7 +58,7 @@ export class FeedService {
|
|||||||
const feed = new Feed({
|
const feed = new Feed({
|
||||||
id: author.link,
|
id: author.link,
|
||||||
title: `${author.name} (@${user.username}@${this.config.host})`,
|
title: `${author.name} (@${user.username}@${this.config.host})`,
|
||||||
updated: notes.length !== 0 ? this.idService.parse(notes[0].id).date : undefined,
|
updated: this.idService.parse(notes[0].id).date,
|
||||||
generator: 'Misskey',
|
generator: 'Misskey',
|
||||||
description: `${user.notesCount} Notes, ${profile.ffVisibility === 'public' ? user.followingCount : '?'} Following, ${profile.ffVisibility === 'public' ? user.followersCount : '?'} Followers${profile.description ? ` · ${profile.description}` : ''}`,
|
description: `${user.notesCount} Notes, ${profile.ffVisibility === 'public' ? user.followingCount : '?'} Following, ${profile.ffVisibility === 'public' ? user.followersCount : '?'} Followers${profile.description ? ` · ${profile.description}` : ''}`,
|
||||||
link: author.link,
|
link: author.link,
|
||||||
|
@@ -63,8 +63,6 @@ export const moderationLogTypes = [
|
|||||||
'createAvatarDecoration',
|
'createAvatarDecoration',
|
||||||
'updateAvatarDecoration',
|
'updateAvatarDecoration',
|
||||||
'deleteAvatarDecoration',
|
'deleteAvatarDecoration',
|
||||||
'unsetUserAvatar',
|
|
||||||
'unsetUserBanner',
|
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export type ModerationLogPayloads = {
|
export type ModerationLogPayloads = {
|
||||||
@@ -239,18 +237,6 @@ export type ModerationLogPayloads = {
|
|||||||
avatarDecorationId: string;
|
avatarDecorationId: string;
|
||||||
avatarDecoration: any;
|
avatarDecoration: any;
|
||||||
};
|
};
|
||||||
unsetUserAvatar: {
|
|
||||||
userId: string;
|
|
||||||
userUsername: string;
|
|
||||||
userHost: string | null;
|
|
||||||
fileId: string;
|
|
||||||
};
|
|
||||||
unsetUserBanner: {
|
|
||||||
userId: string;
|
|
||||||
userUsername: string;
|
|
||||||
userHost: string | null;
|
|
||||||
fileId: string;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Serialized<T> = {
|
export type Serialized<T> = {
|
||||||
|
@@ -93,7 +93,7 @@ describe('Webリソース', () => {
|
|||||||
});
|
});
|
||||||
aliceChannel = await channel(alice, {});
|
aliceChannel = await channel(alice, {});
|
||||||
|
|
||||||
bob = await signup({ username: 'bob' });
|
bob = await signup({ username: 'alice' });
|
||||||
}, 1000 * 60 * 2);
|
}, 1000 * 60 * 2);
|
||||||
|
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
@@ -152,11 +152,6 @@ describe('Webリソース', () => {
|
|||||||
type,
|
type,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
test('がGETできる。(ノートが存在しない場合でも。)', async () => await ok({
|
|
||||||
path: path(bob.username),
|
|
||||||
type,
|
|
||||||
}));
|
|
||||||
|
|
||||||
test('は存在しないユーザーはGETできない。', async () => await notOk({
|
test('は存在しないユーザーはGETできない。', async () => await notOk({
|
||||||
path: path('nonexisting'),
|
path: path('nonexisting'),
|
||||||
status: 404,
|
status: 404,
|
||||||
|
@@ -168,7 +168,6 @@ describe('ユーザー', () => {
|
|||||||
hasPendingReceivedFollowRequest: user.hasPendingReceivedFollowRequest,
|
hasPendingReceivedFollowRequest: user.hasPendingReceivedFollowRequest,
|
||||||
unreadAnnouncements: user.unreadAnnouncements,
|
unreadAnnouncements: user.unreadAnnouncements,
|
||||||
mutedWords: user.mutedWords,
|
mutedWords: user.mutedWords,
|
||||||
hardMutedWords: user.hardMutedWords,
|
|
||||||
mutedInstances: user.mutedInstances,
|
mutedInstances: user.mutedInstances,
|
||||||
mutingNotificationTypes: user.mutingNotificationTypes,
|
mutingNotificationTypes: user.mutingNotificationTypes,
|
||||||
notificationRecieveConfig: user.notificationRecieveConfig,
|
notificationRecieveConfig: user.notificationRecieveConfig,
|
||||||
|
Binary file not shown.
Binary file not shown.
@@ -9,7 +9,7 @@
|
|||||||
"build-storybook-pre": "(tsc -p .storybook || echo done.) && node .storybook/generate.js && node .storybook/preload-locale.js && node .storybook/preload-theme.js",
|
"build-storybook-pre": "(tsc -p .storybook || echo done.) && node .storybook/generate.js && node .storybook/preload-locale.js && node .storybook/preload-theme.js",
|
||||||
"build-storybook": "pnpm build-storybook-pre && storybook build",
|
"build-storybook": "pnpm build-storybook-pre && storybook build",
|
||||||
"chromatic": "chromatic",
|
"chromatic": "chromatic",
|
||||||
"test": "vitest --run --globals",
|
"test": "vitest --run",
|
||||||
"test-and-coverage": "vitest --run --coverage --globals",
|
"test-and-coverage": "vitest --run --coverage --globals",
|
||||||
"typecheck": "vue-tsc --noEmit",
|
"typecheck": "vue-tsc --noEmit",
|
||||||
"eslint": "eslint --quiet \"src/**/*.{ts,vue}\"",
|
"eslint": "eslint --quiet \"src/**/*.{ts,vue}\"",
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discordapp/twemoji": "14.1.2",
|
"@discordapp/twemoji": "14.1.2",
|
||||||
"@github/webauthn-json": "2.1.1",
|
"@github/webauthn-json": "2.1.1",
|
||||||
"@rollup/plugin-alias": "5.1.0",
|
"@rollup/plugin-alias": "5.0.1",
|
||||||
"@rollup/plugin-json": "6.0.1",
|
"@rollup/plugin-json": "6.0.1",
|
||||||
"@rollup/plugin-replace": "5.0.5",
|
"@rollup/plugin-replace": "5.0.5",
|
||||||
"@rollup/pluginutils": "5.0.5",
|
"@rollup/pluginutils": "5.0.5",
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
"@tabler/icons-webfont": "2.37.0",
|
"@tabler/icons-webfont": "2.37.0",
|
||||||
"@vitejs/plugin-vue": "4.5.0",
|
"@vitejs/plugin-vue": "4.5.0",
|
||||||
"@vue-macros/reactivity-transform": "0.4.0",
|
"@vue-macros/reactivity-transform": "0.4.0",
|
||||||
"@vue/compiler-sfc": "3.3.9",
|
"@vue/compiler-sfc": "3.3.8",
|
||||||
"astring": "1.8.6",
|
"astring": "1.8.6",
|
||||||
"autosize": "6.0.1",
|
"autosize": "6.0.1",
|
||||||
"aiscript-vscode": "github:aiscript-dev/aiscript-vscode#v0.0.6",
|
"aiscript-vscode": "github:aiscript-dev/aiscript-vscode#v0.0.6",
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
"chartjs-chart-matrix": "2.0.1",
|
"chartjs-chart-matrix": "2.0.1",
|
||||||
"chartjs-plugin-gradient": "0.6.1",
|
"chartjs-plugin-gradient": "0.6.1",
|
||||||
"chartjs-plugin-zoom": "2.0.1",
|
"chartjs-plugin-zoom": "2.0.1",
|
||||||
"chromatic": "9.1.0",
|
"chromatic": "9.0.0",
|
||||||
"compare-versions": "6.1.0",
|
"compare-versions": "6.1.0",
|
||||||
"cropperjs": "2.0.0-beta.4",
|
"cropperjs": "2.0.0-beta.4",
|
||||||
"date-fns": "2.30.0",
|
"date-fns": "2.30.0",
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
"photoswipe": "5.4.2",
|
"photoswipe": "5.4.2",
|
||||||
"punycode": "2.3.1",
|
"punycode": "2.3.1",
|
||||||
"querystring": "0.2.1",
|
"querystring": "0.2.1",
|
||||||
"rollup": "4.6.0",
|
"rollup": "4.4.1",
|
||||||
"sanitize-html": "2.11.0",
|
"sanitize-html": "2.11.0",
|
||||||
"shiki": "^0.14.5",
|
"shiki": "^0.14.5",
|
||||||
"sass": "1.69.5",
|
"sass": "1.69.5",
|
||||||
@@ -69,12 +69,12 @@
|
|||||||
"tsc-alias": "1.8.8",
|
"tsc-alias": "1.8.8",
|
||||||
"tsconfig-paths": "4.2.0",
|
"tsconfig-paths": "4.2.0",
|
||||||
"twemoji-parser": "14.0.0",
|
"twemoji-parser": "14.0.0",
|
||||||
"typescript": "5.3.2",
|
"typescript": "5.2.2",
|
||||||
"uuid": "9.0.1",
|
"uuid": "9.0.1",
|
||||||
"v-code-diff": "1.7.2",
|
"v-code-diff": "1.7.2",
|
||||||
"vanilla-tilt": "1.8.1",
|
"vanilla-tilt": "1.8.1",
|
||||||
"vite": "5.0.2",
|
"vite": "4.5.0",
|
||||||
"vue": "3.3.9",
|
"vue": "3.3.8",
|
||||||
"vuedraggable": "next"
|
"vuedraggable": "next"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -96,27 +96,27 @@
|
|||||||
"@storybook/types": "7.5.3",
|
"@storybook/types": "7.5.3",
|
||||||
"@storybook/vue3": "7.5.3",
|
"@storybook/vue3": "7.5.3",
|
||||||
"@storybook/vue3-vite": "7.5.3",
|
"@storybook/vue3-vite": "7.5.3",
|
||||||
"@testing-library/vue": "8.0.1",
|
"@testing-library/vue": "8.0.0",
|
||||||
"@types/escape-regexp": "0.0.3",
|
"@types/escape-regexp": "0.0.3",
|
||||||
"@types/estree": "1.0.5",
|
"@types/estree": "1.0.5",
|
||||||
"@types/matter-js": "0.19.5",
|
"@types/matter-js": "0.19.4",
|
||||||
"@types/micromatch": "4.0.6",
|
"@types/micromatch": "4.0.5",
|
||||||
"@types/node": "20.10.0",
|
"@types/node": "20.9.1",
|
||||||
"@types/punycode": "2.1.3",
|
"@types/punycode": "2.1.2",
|
||||||
"@types/sanitize-html": "2.9.5",
|
"@types/sanitize-html": "2.9.4",
|
||||||
"@types/throttle-debounce": "5.0.2",
|
"@types/throttle-debounce": "5.0.2",
|
||||||
"@types/tinycolor2": "1.4.6",
|
"@types/tinycolor2": "1.4.6",
|
||||||
"@types/uuid": "9.0.7",
|
"@types/uuid": "9.0.7",
|
||||||
"@types/websocket": "1.0.10",
|
"@types/websocket": "1.0.9",
|
||||||
"@types/ws": "8.5.10",
|
"@types/ws": "8.5.9",
|
||||||
"@typescript-eslint/eslint-plugin": "6.12.0",
|
"@typescript-eslint/eslint-plugin": "6.11.0",
|
||||||
"@typescript-eslint/parser": "6.12.0",
|
"@typescript-eslint/parser": "6.11.0",
|
||||||
"@vitest/coverage-v8": "0.34.6",
|
"@vitest/coverage-v8": "0.34.6",
|
||||||
"@vue/runtime-core": "3.3.9",
|
"@vue/runtime-core": "3.3.8",
|
||||||
"acorn": "8.11.2",
|
"acorn": "8.11.2",
|
||||||
"cross-env": "7.0.3",
|
"cross-env": "7.0.3",
|
||||||
"cypress": "13.6.0",
|
"cypress": "13.5.1",
|
||||||
"eslint": "8.54.0",
|
"eslint": "8.53.0",
|
||||||
"eslint-plugin-import": "2.29.0",
|
"eslint-plugin-import": "2.29.0",
|
||||||
"eslint-plugin-vue": "9.18.1",
|
"eslint-plugin-vue": "9.18.1",
|
||||||
"fast-glob": "3.3.2",
|
"fast-glob": "3.3.2",
|
||||||
|
@@ -204,16 +204,12 @@ export async function common(createVue: () => App<Element>) {
|
|||||||
|
|
||||||
if (defaultStore.state.keepScreenOn) {
|
if (defaultStore.state.keepScreenOn) {
|
||||||
if ('wakeLock' in navigator) {
|
if ('wakeLock' in navigator) {
|
||||||
navigator.wakeLock.request('screen')
|
navigator.wakeLock.request('screen');
|
||||||
.then(() => {
|
|
||||||
document.addEventListener('visibilitychange', async () => {
|
document.addEventListener('visibilitychange', async () => {
|
||||||
if (document.visibilityState === 'visible') {
|
if (document.visibilityState === 'visible') {
|
||||||
navigator.wakeLock.request('screen');
|
navigator.wakeLock.request('screen');
|
||||||
}
|
}
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
// If Permission fails on an AppleDevice such as Safari
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -23,7 +23,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
<Mfm :text="report.comment"/>
|
<Mfm :text="report.comment"/>
|
||||||
</div>
|
</div>
|
||||||
<hr/>
|
<hr/>
|
||||||
<div>{{ i18n.ts.reporter }}: <MkA :to="`/admin/user/${report.reporter.id}`" class="_link">@{{ report.reporter.username }}</MkA></div>
|
<div>{{ i18n.ts.reporter }}: <MkAcct :user="report.reporter"/></div>
|
||||||
<div v-if="report.assignee">
|
<div v-if="report.assignee">
|
||||||
{{ i18n.ts.moderator }}:
|
{{ i18n.ts.moderator }}:
|
||||||
<MkAcct :user="report.assignee"/>
|
<MkAcct :user="report.assignee"/>
|
||||||
|
@@ -242,7 +242,29 @@ function exec() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
emojis.value = emojiAutoComplete(props.q, emojiDb.value);
|
const matched: EmojiDef[] = [];
|
||||||
|
const max = 30;
|
||||||
|
|
||||||
|
emojiDb.value.some(x => {
|
||||||
|
if (x.name.startsWith(props.q ?? '') && !x.aliasOf && !matched.some(y => y.emoji === x.emoji)) matched.push(x);
|
||||||
|
return matched.length === max;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (matched.length < max) {
|
||||||
|
emojiDb.value.some(x => {
|
||||||
|
if (x.name.startsWith(props.q ?? '') && !matched.some(y => y.emoji === x.emoji)) matched.push(x);
|
||||||
|
return matched.length === max;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (matched.length < max) {
|
||||||
|
emojiDb.value.some(x => {
|
||||||
|
if (x.name.includes(props.q ?? '') && !matched.some(y => y.emoji === x.emoji)) matched.push(x);
|
||||||
|
return matched.length === max;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
emojis.value = matched;
|
||||||
} else if (props.type === 'mfmTag') {
|
} else if (props.type === 'mfmTag') {
|
||||||
if (!props.q || props.q === '') {
|
if (!props.q || props.q === '') {
|
||||||
mfmTags.value = MFM_TAGS;
|
mfmTags.value = MFM_TAGS;
|
||||||
@@ -253,78 +275,6 @@ function exec() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type EmojiScore = { emoji: EmojiDef, score: number };
|
|
||||||
|
|
||||||
function emojiAutoComplete(query: string | null, emojiDb: EmojiDef[], max = 30): EmojiDef[] {
|
|
||||||
if (!query) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
const matched = new Map<string, EmojiScore>();
|
|
||||||
|
|
||||||
// 前方一致(エイリアスなし)
|
|
||||||
emojiDb.some(x => {
|
|
||||||
if (x.name.startsWith(query) && !x.aliasOf) {
|
|
||||||
matched.set(x.name, { emoji: x, score: query.length + 1 });
|
|
||||||
}
|
|
||||||
return matched.size === max;
|
|
||||||
});
|
|
||||||
|
|
||||||
// 前方一致(エイリアス込み)
|
|
||||||
if (matched.size < max) {
|
|
||||||
emojiDb.some(x => {
|
|
||||||
if (x.name.startsWith(query) && !matched.has(x.aliasOf ?? x.name)) {
|
|
||||||
matched.set(x.aliasOf ?? x.name, { emoji: x, score: query.length });
|
|
||||||
}
|
|
||||||
return matched.size === max;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 部分一致(エイリアス込み)
|
|
||||||
if (matched.size < max) {
|
|
||||||
emojiDb.some(x => {
|
|
||||||
if (x.name.includes(query) && !matched.has(x.aliasOf ?? x.name)) {
|
|
||||||
matched.set(x.aliasOf ?? x.name, { emoji: x, score: query.length - 1 });
|
|
||||||
}
|
|
||||||
return matched.size === max;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 簡易あいまい検索(3文字以上)
|
|
||||||
if (matched.size < max && query.length > 3) {
|
|
||||||
const queryChars = [...query];
|
|
||||||
const hitEmojis = new Map<string, EmojiScore>();
|
|
||||||
|
|
||||||
for (const x of emojiDb) {
|
|
||||||
// 文字列の位置を進めながら、クエリの文字を順番に探す
|
|
||||||
|
|
||||||
let pos = 0;
|
|
||||||
let hit = 0;
|
|
||||||
for (const c of queryChars) {
|
|
||||||
pos = x.name.indexOf(c, pos);
|
|
||||||
if (pos <= -1) break;
|
|
||||||
hit++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 半分以上の文字が含まれていればヒットとする
|
|
||||||
if (hit > Math.ceil(queryChars.length / 2) && hit - 2 > (matched.get(x.aliasOf ?? x.name)?.score ?? 0)) {
|
|
||||||
hitEmojis.set(x.aliasOf ?? x.name, { emoji: x, score: hit - 2 });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ヒットしたものを全部追加すると雑多になるので、先頭の6件程度だけにしておく(6件=オートコンプリートのポップアップのサイズ分)
|
|
||||||
[...hitEmojis.values()]
|
|
||||||
.sort((x, y) => y.score - x.score)
|
|
||||||
.slice(0, 6)
|
|
||||||
.forEach(it => matched.set(it.emoji.name, it));
|
|
||||||
}
|
|
||||||
|
|
||||||
return [...matched.values()]
|
|
||||||
.sort((x, y) => y.score - x.score)
|
|
||||||
.slice(0, max)
|
|
||||||
.map(it => it.emoji);
|
|
||||||
}
|
|
||||||
|
|
||||||
function onMousedown(event: Event) {
|
function onMousedown(event: Event) {
|
||||||
if (!contains(rootEl.value, event.target) && (rootEl.value !== event.target)) props.close();
|
if (!contains(rootEl.value, event.target) && (rootEl.value !== event.target)) props.close();
|
||||||
}
|
}
|
||||||
|
@@ -139,10 +139,6 @@ watch(v, () => {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.textarea, .codeEditorHighlighter {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.textarea {
|
.textarea {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -158,8 +154,6 @@ watch(v, () => {
|
|||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
border: 0;
|
border: 0;
|
||||||
outline: 0;
|
outline: 0;
|
||||||
min-width: calc(100% - 24px);
|
|
||||||
height: calc(100% - 24px);
|
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
line-height: 1.5em;
|
line-height: 1.5em;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
|
@@ -37,7 +37,6 @@ import * as Misskey from 'misskey-js';
|
|||||||
import bytes from '@/filters/bytes.js';
|
import bytes from '@/filters/bytes.js';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import hasAudio from '@/scripts/media-has-audio.js';
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
video: Misskey.entities.DriveFile;
|
video: Misskey.entities.DriveFile;
|
||||||
@@ -50,12 +49,6 @@ const videoEl = shallowRef<HTMLVideoElement>();
|
|||||||
watch(videoEl, () => {
|
watch(videoEl, () => {
|
||||||
if (videoEl.value) {
|
if (videoEl.value) {
|
||||||
videoEl.value.volume = 0.3;
|
videoEl.value.volume = 0.3;
|
||||||
hasAudio(videoEl.value).then(had => {
|
|
||||||
if (!had) {
|
|
||||||
videoEl.value.loop = videoEl.value.muted = true;
|
|
||||||
videoEl.value.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
v-if="!hardMuted && !muted"
|
v-if="!muted"
|
||||||
v-show="!isDeleted"
|
v-show="!isDeleted"
|
||||||
ref="el"
|
ref="el"
|
||||||
v-hotkey="keymap"
|
v-hotkey="keymap"
|
||||||
@@ -133,7 +133,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="!hardMuted" :class="$style.muted" @click="muted = false">
|
<div v-else :class="$style.muted" @click="muted = false">
|
||||||
<I18n :src="i18n.ts.userSaysSomething" tag="small">
|
<I18n :src="i18n.ts.userSaysSomething" tag="small">
|
||||||
<template #name>
|
<template #name>
|
||||||
<MkA v-user-preview="appearNote.userId" :to="userPage(appearNote.user)">
|
<MkA v-user-preview="appearNote.userId" :to="userPage(appearNote.user)">
|
||||||
@@ -142,12 +142,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
</template>
|
</template>
|
||||||
</I18n>
|
</I18n>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
|
||||||
<!--
|
|
||||||
MkDateSeparatedList uses TransitionGroup which requires single element in the child elements
|
|
||||||
so MkNote create empty div instead of no elements
|
|
||||||
-->
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@@ -169,7 +163,6 @@ import { focusPrev, focusNext } from '@/scripts/focus.js';
|
|||||||
import { checkWordMute } from '@/scripts/check-word-mute.js';
|
import { checkWordMute } from '@/scripts/check-word-mute.js';
|
||||||
import { userPage } from '@/filters/user.js';
|
import { userPage } from '@/filters/user.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import * as sound from '@/scripts/sound.js';
|
|
||||||
import { defaultStore, noteViewInterruptors } from '@/store.js';
|
import { defaultStore, noteViewInterruptors } from '@/store.js';
|
||||||
import { reactionPicker } from '@/scripts/reaction-picker.js';
|
import { reactionPicker } from '@/scripts/reaction-picker.js';
|
||||||
import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm.js';
|
import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm.js';
|
||||||
@@ -190,7 +183,6 @@ const props = withDefaults(defineProps<{
|
|||||||
note: Misskey.entities.Note;
|
note: Misskey.entities.Note;
|
||||||
pinned?: boolean;
|
pinned?: boolean;
|
||||||
mock?: boolean;
|
mock?: boolean;
|
||||||
withHardMute?: boolean;
|
|
||||||
}>(), {
|
}>(), {
|
||||||
mock: false,
|
mock: false,
|
||||||
});
|
});
|
||||||
@@ -247,23 +239,13 @@ const urls = $computed(() => parsed ? extractUrlFromMfm(parsed) : null);
|
|||||||
const isLong = shouldCollapsed(appearNote, urls ?? []);
|
const isLong = shouldCollapsed(appearNote, urls ?? []);
|
||||||
const collapsed = ref(appearNote.cw == null && isLong);
|
const collapsed = ref(appearNote.cw == null && isLong);
|
||||||
const isDeleted = ref(false);
|
const isDeleted = ref(false);
|
||||||
const muted = ref(checkMute(appearNote, $i?.mutedWords));
|
const muted = ref($i ? checkWordMute(appearNote, $i, $i.mutedWords) : false);
|
||||||
const hardMuted = ref(props.withHardMute && checkMute(appearNote, $i?.hardMutedWords));
|
|
||||||
const translation = ref<any>(null);
|
const translation = ref<any>(null);
|
||||||
const translating = ref(false);
|
const translating = ref(false);
|
||||||
const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.user.instance);
|
const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.user.instance);
|
||||||
const canRenote = computed(() => ['public', 'home'].includes(appearNote.visibility) || (appearNote.visibility === 'followers' && appearNote.userId === $i.id));
|
const canRenote = computed(() => ['public', 'home'].includes(appearNote.visibility) || (appearNote.visibility === 'followers' && appearNote.userId === $i.id));
|
||||||
let renoteCollapsed = $ref(defaultStore.state.collapseRenotes && isRenote && (($i && ($i.id === note.userId || $i.id === appearNote.userId)) || (appearNote.myReaction != null)));
|
let renoteCollapsed = $ref(defaultStore.state.collapseRenotes && isRenote && (($i && ($i.id === note.userId || $i.id === appearNote.userId)) || (appearNote.myReaction != null)));
|
||||||
|
|
||||||
function checkMute(note: Misskey.entities.Note, mutedWords: Array<string | string[]> | undefined | null): boolean {
|
|
||||||
if (mutedWords == null) return false;
|
|
||||||
|
|
||||||
if (checkWordMute(note, $i, mutedWords)) return true;
|
|
||||||
if (note.reply && checkWordMute(note.reply, $i, mutedWords)) return true;
|
|
||||||
if (note.renote && checkWordMute(note.renote, $i, mutedWords)) return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const keymap = {
|
const keymap = {
|
||||||
'r': () => reply(true),
|
'r': () => reply(true),
|
||||||
'e|a|plus': () => react(true),
|
'e|a|plus': () => react(true),
|
||||||
@@ -343,8 +325,6 @@ function react(viaKeyboard = false): void {
|
|||||||
pleaseLogin();
|
pleaseLogin();
|
||||||
showMovedDialog();
|
showMovedDialog();
|
||||||
if (appearNote.reactionAcceptance === 'likeOnly') {
|
if (appearNote.reactionAcceptance === 'likeOnly') {
|
||||||
sound.play('reaction');
|
|
||||||
|
|
||||||
if (props.mock) {
|
if (props.mock) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -363,8 +343,6 @@ function react(viaKeyboard = false): void {
|
|||||||
} else {
|
} else {
|
||||||
blur();
|
blur();
|
||||||
reactionPicker.show(reactButton.value, reaction => {
|
reactionPicker.show(reactButton.value, reaction => {
|
||||||
sound.play('reaction');
|
|
||||||
|
|
||||||
if (props.mock) {
|
if (props.mock) {
|
||||||
emit('reaction', reaction);
|
emit('reaction', reaction);
|
||||||
return;
|
return;
|
||||||
|
@@ -210,7 +210,6 @@ import { checkWordMute } from '@/scripts/check-word-mute.js';
|
|||||||
import { userPage } from '@/filters/user.js';
|
import { userPage } from '@/filters/user.js';
|
||||||
import { notePage } from '@/filters/note.js';
|
import { notePage } from '@/filters/note.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import * as sound from '@/scripts/sound.js';
|
|
||||||
import { defaultStore, noteViewInterruptors } from '@/store.js';
|
import { defaultStore, noteViewInterruptors } from '@/store.js';
|
||||||
import { reactionPicker } from '@/scripts/reaction-picker.js';
|
import { reactionPicker } from '@/scripts/reaction-picker.js';
|
||||||
import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm.js';
|
import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm.js';
|
||||||
@@ -370,8 +369,6 @@ function react(viaKeyboard = false): void {
|
|||||||
pleaseLogin();
|
pleaseLogin();
|
||||||
showMovedDialog();
|
showMovedDialog();
|
||||||
if (appearNote.reactionAcceptance === 'likeOnly') {
|
if (appearNote.reactionAcceptance === 'likeOnly') {
|
||||||
sound.play('reaction');
|
|
||||||
|
|
||||||
os.api('notes/reactions/create', {
|
os.api('notes/reactions/create', {
|
||||||
noteId: appearNote.id,
|
noteId: appearNote.id,
|
||||||
reaction: '❤️',
|
reaction: '❤️',
|
||||||
@@ -386,8 +383,6 @@ function react(viaKeyboard = false): void {
|
|||||||
} else {
|
} else {
|
||||||
blur();
|
blur();
|
||||||
reactionPicker.show(reactButton.value, reaction => {
|
reactionPicker.show(reactButton.value, reaction => {
|
||||||
sound.play('reaction');
|
|
||||||
|
|
||||||
os.api('notes/reactions/create', {
|
os.api('notes/reactions/create', {
|
||||||
noteId: appearNote.id,
|
noteId: appearNote.id,
|
||||||
reaction: reaction,
|
reaction: reaction,
|
||||||
|
@@ -24,7 +24,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
:ad="true"
|
:ad="true"
|
||||||
:class="$style.notes"
|
:class="$style.notes"
|
||||||
>
|
>
|
||||||
<MkNote :key="note._featuredId_ || note._prId_ || note.id" :class="$style.note" :note="note" :withHardMute="true"/>
|
<MkNote :key="note._featuredId_ || note._prId_ || note.id" :class="$style.note" :note="note"/>
|
||||||
</MkDateSeparatedList>
|
</MkDateSeparatedList>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
|
|
||||||
<template #default="{ items: notifications }">
|
<template #default="{ items: notifications }">
|
||||||
<MkDateSeparatedList v-slot="{ item: notification }" :class="$style.list" :items="notifications" :noGap="true">
|
<MkDateSeparatedList v-slot="{ item: notification }" :class="$style.list" :items="notifications" :noGap="true">
|
||||||
<MkNote v-if="['reply', 'quote', 'mention'].includes(notification.type)" :key="notification.id" :note="notification.note" :withHardMute="true"/>
|
<MkNote v-if="['reply', 'quote', 'mention'].includes(notification.type)" :key="notification.id" :note="notification.note"/>
|
||||||
<XNotification v-else :key="notification.id" :notification="notification" :withTime="true" :full="true" class="_panel"/>
|
<XNotification v-else :key="notification.id" :notification="notification" :withTime="true" :full="true" class="_panel"/>
|
||||||
</MkDateSeparatedList>
|
</MkDateSeparatedList>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -114,6 +114,7 @@ const props = defineProps<{
|
|||||||
|
|
||||||
& + article {
|
& + article {
|
||||||
left: 0;
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +124,6 @@ const props = defineProps<{
|
|||||||
|
|
||||||
> .thumbnail {
|
> .thumbnail {
|
||||||
height: 80px;
|
height: 80px;
|
||||||
overflow: clip;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
> article {
|
> article {
|
||||||
|
@@ -11,7 +11,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
:class="[$style.root, { [$style.reacted]: note.myReaction == reaction, [$style.canToggle]: canToggle, [$style.small]: defaultStore.state.reactionsDisplaySize === 'small', [$style.large]: defaultStore.state.reactionsDisplaySize === 'large' }]"
|
:class="[$style.root, { [$style.reacted]: note.myReaction == reaction, [$style.canToggle]: canToggle, [$style.small]: defaultStore.state.reactionsDisplaySize === 'small', [$style.large]: defaultStore.state.reactionsDisplaySize === 'large' }]"
|
||||||
@click="toggleReaction()"
|
@click="toggleReaction()"
|
||||||
>
|
>
|
||||||
<MkReactionIcon :class="defaultStore.state.limitWidthOfReaction ? $style.limitWidth : ''" :reaction="reaction" :emojiUrl="note.reactionEmojis[reaction.substring(1, reaction.length - 1)]"/>
|
<MkReactionIcon :class="$style.icon" :reaction="reaction" :emojiUrl="note.reactionEmojis[reaction.substring(1, reaction.length - 1)]"/>
|
||||||
<span :class="$style.count">{{ count }}</span>
|
<span :class="$style.count">{{ count }}</span>
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
@@ -28,7 +28,6 @@ import MkReactionEffect from '@/components/MkReactionEffect.vue';
|
|||||||
import { claimAchievement } from '@/scripts/achievements.js';
|
import { claimAchievement } from '@/scripts/achievements.js';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import * as sound from '@/scripts/sound.js';
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
reaction: string;
|
reaction: string;
|
||||||
@@ -60,10 +59,6 @@ async function toggleReaction() {
|
|||||||
});
|
});
|
||||||
if (confirm.canceled) return;
|
if (confirm.canceled) return;
|
||||||
|
|
||||||
if (oldReaction !== props.reaction) {
|
|
||||||
sound.play('reaction');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mock) {
|
if (mock) {
|
||||||
emit('reactionToggled', props.reaction, (props.count - 1));
|
emit('reactionToggled', props.reaction, (props.count - 1));
|
||||||
return;
|
return;
|
||||||
@@ -80,8 +75,6 @@ async function toggleReaction() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
sound.play('reaction');
|
|
||||||
|
|
||||||
if (mock) {
|
if (mock) {
|
||||||
emit('reactionToggled', props.reaction, (props.count + 1));
|
emit('reactionToggled', props.reaction, (props.count + 1));
|
||||||
return;
|
return;
|
||||||
@@ -195,7 +188,7 @@ if (!mock) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.limitWidth {
|
.icon {
|
||||||
max-width: 150px;
|
max-width: 150px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,7 +31,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
<iframe
|
<iframe
|
||||||
ref="tweet"
|
ref="tweet"
|
||||||
allow="fullscreen;web-share"
|
allow="fullscreen;web-share"
|
||||||
sandbox="allow-popups allow-popups-to-escape-sandbox allow-scripts allow-same-origin"
|
sandbox="allow-popups allow-scripts allow-same-origin"
|
||||||
scrolling="no"
|
scrolling="no"
|
||||||
:style="{ position: 'relative', width: '100%', height: `${tweetHeight}px`, border: 0 }"
|
:style="{ position: 'relative', width: '100%', height: `${tweetHeight}px`, border: 0 }"
|
||||||
:src="`https://platform.twitter.com/embed/index.html?embedId=${embedId}&hideCard=false&hideThread=false&lang=en&theme=${defaultStore.state.darkMode ? 'dark' : 'light'}&id=${tweetId}`"
|
:src="`https://platform.twitter.com/embed/index.html?embedId=${embedId}&hideCard=false&hideThread=false&lang=en&theme=${defaultStore.state.darkMode ? 'dark' : 'light'}&id=${tweetId}`"
|
||||||
|
@@ -28,25 +28,12 @@ const props = withDefaults(defineProps<{
|
|||||||
mode: 'relative',
|
mode: 'relative',
|
||||||
});
|
});
|
||||||
|
|
||||||
function getDateSafe(n: Date | string | number) {
|
const _time = props.time == null ? NaN :
|
||||||
try {
|
typeof props.time === 'number' ? props.time :
|
||||||
if (n instanceof Date) {
|
(props.time instanceof Date ? props.time : new Date(props.time)).getTime();
|
||||||
return n;
|
|
||||||
}
|
|
||||||
return new Date(n);
|
|
||||||
} catch (err) {
|
|
||||||
return {
|
|
||||||
getTime: () => NaN,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// eslint-disable-next-line vue/no-setup-props-destructure
|
|
||||||
const _time = props.time == null ? NaN : getDateSafe(props.time).getTime();
|
|
||||||
const invalid = Number.isNaN(_time);
|
const invalid = Number.isNaN(_time);
|
||||||
const absolute = !invalid ? dateTimeFormat.format(_time) : i18n.ts._ago.invalid;
|
const absolute = !invalid ? dateTimeFormat.format(_time) : i18n.ts._ago.invalid;
|
||||||
|
|
||||||
// eslint-disable-next-line vue/no-setup-props-destructure
|
|
||||||
let now = $ref((props.origin ?? new Date()).getTime());
|
let now = $ref((props.origin ?? new Date()).getTime());
|
||||||
const ago = $computed(() => (now - _time) / 1000/*ms*/);
|
const ago = $computed(() => (now - _time) / 1000/*ms*/);
|
||||||
|
|
||||||
|
@@ -65,9 +65,9 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
<img src="https://avatars.githubusercontent.com/u/67428053?v=4" :class="$style.contributorAvatar">
|
<img src="https://avatars.githubusercontent.com/u/67428053?v=4" :class="$style.contributorAvatar">
|
||||||
<span :class="$style.contributorUsername">@kakkokari-gtyih</span>
|
<span :class="$style.contributorUsername">@kakkokari-gtyih</span>
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/tai-cha" target="_blank" :class="$style.contributor">
|
<a href="https://github.com/taichanNE30" target="_blank" :class="$style.contributor">
|
||||||
<img src="https://avatars.githubusercontent.com/u/40626578?v=4" :class="$style.contributorAvatar">
|
<img src="https://avatars.githubusercontent.com/u/40626578?v=4" :class="$style.contributorAvatar">
|
||||||
<span :class="$style.contributorUsername">@tai-cha</span>
|
<span :class="$style.contributorUsername">@taichanNE30</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
|
@@ -122,10 +122,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
</template>
|
</template>
|
||||||
</MkFolder>
|
</MkFolder>
|
||||||
|
|
||||||
<div>
|
|
||||||
<MkButton v-if="iAmModerator" inline danger style="margin-right: 8px;" @click="unsetUserAvatar"><i class="ti ti-user-circle"></i> {{ i18n.ts.unsetUserAvatar }}</MkButton>
|
|
||||||
<MkButton v-if="iAmModerator" inline danger @click="unsetUserBanner"><i class="ti ti-photo"></i> {{ i18n.ts.unsetUserBanner }}</MkButton>
|
|
||||||
</div>
|
|
||||||
<MkButton v-if="$i.isAdmin" inline danger @click="deleteAccount">{{ i18n.ts.deleteAccount }}</MkButton>
|
<MkButton v-if="$i.isAdmin" inline danger @click="deleteAccount">{{ i18n.ts.deleteAccount }}</MkButton>
|
||||||
</div>
|
</div>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
@@ -324,44 +320,6 @@ async function toggleSuspend(v) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function unsetUserAvatar() {
|
|
||||||
const confirm = await os.confirm({
|
|
||||||
type: 'warning',
|
|
||||||
text: i18n.ts.unsetUserAvatarConfirm,
|
|
||||||
});
|
|
||||||
if (confirm.canceled) return;
|
|
||||||
const process = async () => {
|
|
||||||
await os.api('admin/unset-user-avatar', { userId: user.id });
|
|
||||||
os.success();
|
|
||||||
};
|
|
||||||
await process().catch(err => {
|
|
||||||
os.alert({
|
|
||||||
type: 'error',
|
|
||||||
text: err.toString(),
|
|
||||||
});
|
|
||||||
});
|
|
||||||
refreshUser();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function unsetUserBanner() {
|
|
||||||
const confirm = await os.confirm({
|
|
||||||
type: 'warning',
|
|
||||||
text: i18n.ts.unsetUserBannerConfirm,
|
|
||||||
});
|
|
||||||
if (confirm.canceled) return;
|
|
||||||
const process = async () => {
|
|
||||||
await os.api('admin/unset-user-banner', { userId: user.id });
|
|
||||||
os.success();
|
|
||||||
};
|
|
||||||
await process().catch(err => {
|
|
||||||
os.alert({
|
|
||||||
type: 'error',
|
|
||||||
text: err.toString(),
|
|
||||||
});
|
|
||||||
});
|
|
||||||
refreshUser();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function deleteAllFiles() {
|
async function deleteAllFiles() {
|
||||||
const confirm = await os.confirm({
|
const confirm = await os.confirm({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
|
@@ -9,15 +9,12 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
<XHeader :actions="headerActions" :tabs="headerTabs"/>
|
<XHeader :actions="headerActions" :tabs="headerTabs"/>
|
||||||
</template>
|
</template>
|
||||||
<MkSpacer :contentMax="900">
|
<MkSpacer :contentMax="900">
|
||||||
<MkSelect v-model="filterType" :class="$style.input" @update:modelValue="filterItems">
|
<MkSwitch :modelValue="publishing" @update:modelValue="onChangePublishing">
|
||||||
<template #label>{{ i18n.ts.state }}</template>
|
{{ i18n.ts.publishing }}
|
||||||
<option value="all">{{ i18n.ts.all }}</option>
|
</MkSwitch>
|
||||||
<option value="publishing">{{ i18n.ts.publishing }}</option>
|
|
||||||
<option value="expired">{{ i18n.ts.expired }}</option>
|
|
||||||
</MkSelect>
|
|
||||||
<div>
|
<div>
|
||||||
<div v-for="ad in ads" class="_panel _gaps_m" :class="$style.ad">
|
<div v-for="ad in ads" class="_panel _gaps_m" :class="$style.ad">
|
||||||
<MkAd v-if="ad.url" :key="ad.id" :specify="ad"/>
|
<MkAd v-if="ad.url" :specify="ad"/>
|
||||||
<MkInput v-model="ad.url" type="url">
|
<MkInput v-model="ad.url" type="url">
|
||||||
<template #label>URL</template>
|
<template #label>URL</template>
|
||||||
</MkInput>
|
</MkInput>
|
||||||
@@ -85,14 +82,14 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import { } from 'vue';
|
||||||
import XHeader from './_header_.vue';
|
import XHeader from './_header_.vue';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import MkInput from '@/components/MkInput.vue';
|
import MkInput from '@/components/MkInput.vue';
|
||||||
import MkTextarea from '@/components/MkTextarea.vue';
|
import MkTextarea from '@/components/MkTextarea.vue';
|
||||||
import MkRadios from '@/components/MkRadios.vue';
|
import MkRadios from '@/components/MkRadios.vue';
|
||||||
import MkFolder from '@/components/MkFolder.vue';
|
import MkFolder from '@/components/MkFolder.vue';
|
||||||
import MkSelect from '@/components/MkSelect.vue';
|
import MkSwitch from '@/components/MkSwitch.vue';
|
||||||
import FormSplit from '@/components/form/split.vue';
|
import FormSplit from '@/components/form/split.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
@@ -104,34 +101,24 @@ let ads: any[] = $ref([]);
|
|||||||
const localTime = new Date();
|
const localTime = new Date();
|
||||||
const localTimeDiff = localTime.getTimezoneOffset() * 60 * 1000;
|
const localTimeDiff = localTime.getTimezoneOffset() * 60 * 1000;
|
||||||
const daysOfWeek: string[] = [i18n.ts._weekday.sunday, i18n.ts._weekday.monday, i18n.ts._weekday.tuesday, i18n.ts._weekday.wednesday, i18n.ts._weekday.thursday, i18n.ts._weekday.friday, i18n.ts._weekday.saturday];
|
const daysOfWeek: string[] = [i18n.ts._weekday.sunday, i18n.ts._weekday.monday, i18n.ts._weekday.tuesday, i18n.ts._weekday.wednesday, i18n.ts._weekday.thursday, i18n.ts._weekday.friday, i18n.ts._weekday.saturday];
|
||||||
const filterType = ref('all');
|
let publishing = false;
|
||||||
let publishing: boolean | null = null;
|
|
||||||
|
|
||||||
os.api('admin/ad/list', { publishing: publishing }).then(adsResponse => {
|
os.api('admin/ad/list', { publishing: publishing }).then(adsResponse => {
|
||||||
if (adsResponse != null) {
|
ads = adsResponse.map(r => {
|
||||||
ads = adsResponse.map(r => {
|
const exdate = new Date(r.expiresAt);
|
||||||
const exdate = new Date(r.expiresAt);
|
const stdate = new Date(r.startsAt);
|
||||||
const stdate = new Date(r.startsAt);
|
exdate.setMilliseconds(exdate.getMilliseconds() - localTimeDiff);
|
||||||
exdate.setMilliseconds(exdate.getMilliseconds() - localTimeDiff);
|
stdate.setMilliseconds(stdate.getMilliseconds() - localTimeDiff);
|
||||||
stdate.setMilliseconds(stdate.getMilliseconds() - localTimeDiff);
|
return {
|
||||||
return {
|
...r,
|
||||||
...r,
|
expiresAt: exdate.toISOString().slice(0, 16),
|
||||||
expiresAt: exdate.toISOString().slice(0, 16),
|
startsAt: stdate.toISOString().slice(0, 16),
|
||||||
startsAt: stdate.toISOString().slice(0, 16),
|
};
|
||||||
};
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const filterItems = (v) => {
|
const onChangePublishing = (v) => {
|
||||||
if (v === 'publishing') {
|
publishing = v;
|
||||||
publishing = true;
|
|
||||||
} else if (v === 'expired') {
|
|
||||||
publishing = false;
|
|
||||||
} else {
|
|
||||||
publishing = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
refresh();
|
refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -210,7 +197,6 @@ function save(ad) {
|
|||||||
|
|
||||||
function more() {
|
function more() {
|
||||||
os.api('admin/ad/list', { untilId: ads.reduce((acc, ad) => ad.id != null ? ad : acc).id, publishing: publishing }).then(adsResponse => {
|
os.api('admin/ad/list', { untilId: ads.reduce((acc, ad) => ad.id != null ? ad : acc).id, publishing: publishing }).then(adsResponse => {
|
||||||
if (adsResponse == null) return;
|
|
||||||
ads = ads.concat(adsResponse.map(r => {
|
ads = ads.concat(adsResponse.map(r => {
|
||||||
const exdate = new Date(r.expiresAt);
|
const exdate = new Date(r.expiresAt);
|
||||||
const stdate = new Date(r.startsAt);
|
const stdate = new Date(r.startsAt);
|
||||||
@@ -227,7 +213,6 @@ function more() {
|
|||||||
|
|
||||||
function refresh() {
|
function refresh() {
|
||||||
os.api('admin/ad/list', { publishing: publishing }).then(adsResponse => {
|
os.api('admin/ad/list', { publishing: publishing }).then(adsResponse => {
|
||||||
if (adsResponse == null) return;
|
|
||||||
ads = adsResponse.map(r => {
|
ads = adsResponse.map(r => {
|
||||||
const exdate = new Date(r.expiresAt);
|
const exdate = new Date(r.expiresAt);
|
||||||
const stdate = new Date(r.startsAt);
|
const stdate = new Date(r.startsAt);
|
||||||
@@ -267,7 +252,4 @@ definePageMetadata({
|
|||||||
margin-bottom: var(--margin);
|
margin-bottom: var(--margin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.input {
|
|
||||||
margin-bottom: 32px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@@ -38,7 +38,6 @@ import { } from 'vue';
|
|||||||
import XHeader from './_header_.vue';
|
import XHeader from './_header_.vue';
|
||||||
import MkInput from '@/components/MkInput.vue';
|
import MkInput from '@/components/MkInput.vue';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import MkSwitch from '@/components/MkSwitch.vue';
|
|
||||||
import FormSuspense from '@/components/form/suspense.vue';
|
import FormSuspense from '@/components/form/suspense.vue';
|
||||||
import FormSection from '@/components/form/section.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
@@ -198,13 +198,13 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
<MkButton primary rounded @click="create"><i class="ti ti-plus"></i> {{ i18n.ts._role.new }}</MkButton>
|
<MkButton primary rounded @click="create"><i class="ti ti-plus"></i> {{ i18n.ts._role.new }}</MkButton>
|
||||||
<div class="_gaps_s">
|
<div class="_gaps_s">
|
||||||
<MkFoldableSection>
|
<MkFoldableSection>
|
||||||
<template #header>{{ i18n.ts._role.manualRoles }}</template>
|
<template #header>Manual roles</template>
|
||||||
<div class="_gaps_s">
|
<div class="_gaps_s">
|
||||||
<MkRolePreview v-for="role in roles.filter(x => x.target === 'manual')" :key="role.id" :role="role" :forModeration="true"/>
|
<MkRolePreview v-for="role in roles.filter(x => x.target === 'manual')" :key="role.id" :role="role" :forModeration="true"/>
|
||||||
</div>
|
</div>
|
||||||
</MkFoldableSection>
|
</MkFoldableSection>
|
||||||
<MkFoldableSection>
|
<MkFoldableSection>
|
||||||
<template #header>{{ i18n.ts._role.conditionalRoles }}</template>
|
<template #header>Conditional roles</template>
|
||||||
<div class="_gaps_s">
|
<div class="_gaps_s">
|
||||||
<MkRolePreview v-for="role in roles.filter(x => x.target === 'conditional')" :key="role.id" :role="role" :forModeration="true"/>
|
<MkRolePreview v-for="role in roles.filter(x => x.target === 'conditional')" :key="role.id" :role="role" :forModeration="true"/>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -73,13 +73,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
<MkSwitch v-model="enableActiveEmailValidation" @update:modelValue="save">
|
<MkSwitch v-model="enableActiveEmailValidation" @update:modelValue="save">
|
||||||
<template #label>Enable</template>
|
<template #label>Enable</template>
|
||||||
</MkSwitch>
|
</MkSwitch>
|
||||||
<MkSwitch v-model="enableVerifymailApi" @update:modelValue="save">
|
|
||||||
<template #label>Use Verifymail API</template>
|
|
||||||
</MkSwitch>
|
|
||||||
<MkInput v-model="verifymailAuthKey" @update:modelValue="save">
|
|
||||||
<template #prefix><i class="ti ti-key"></i></template>
|
|
||||||
<template #label>Verifymail API Auth Key</template>
|
|
||||||
</MkInput>
|
|
||||||
</div>
|
</div>
|
||||||
</MkFolder>
|
</MkFolder>
|
||||||
|
|
||||||
@@ -139,8 +132,6 @@ let setSensitiveFlagAutomatically: boolean = $ref(false);
|
|||||||
let enableSensitiveMediaDetectionForVideos: boolean = $ref(false);
|
let enableSensitiveMediaDetectionForVideos: boolean = $ref(false);
|
||||||
let enableIpLogging: boolean = $ref(false);
|
let enableIpLogging: boolean = $ref(false);
|
||||||
let enableActiveEmailValidation: boolean = $ref(false);
|
let enableActiveEmailValidation: boolean = $ref(false);
|
||||||
let enableVerifymailApi: boolean = $ref(false);
|
|
||||||
let verifymailAuthKey: string | null = $ref(null);
|
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
const meta = await os.api('admin/meta');
|
const meta = await os.api('admin/meta');
|
||||||
@@ -159,8 +150,6 @@ async function init() {
|
|||||||
enableSensitiveMediaDetectionForVideos = meta.enableSensitiveMediaDetectionForVideos;
|
enableSensitiveMediaDetectionForVideos = meta.enableSensitiveMediaDetectionForVideos;
|
||||||
enableIpLogging = meta.enableIpLogging;
|
enableIpLogging = meta.enableIpLogging;
|
||||||
enableActiveEmailValidation = meta.enableActiveEmailValidation;
|
enableActiveEmailValidation = meta.enableActiveEmailValidation;
|
||||||
enableVerifymailApi = meta.enableVerifymailApi;
|
|
||||||
verifymailAuthKey = meta.verifymailAuthKey;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function save() {
|
function save() {
|
||||||
@@ -178,8 +167,6 @@ function save() {
|
|||||||
enableSensitiveMediaDetectionForVideos,
|
enableSensitiveMediaDetectionForVideos,
|
||||||
enableIpLogging,
|
enableIpLogging,
|
||||||
enableActiveEmailValidation,
|
enableActiveEmailValidation,
|
||||||
enableVerifymailApi,
|
|
||||||
verifymailAuthKey,
|
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
fetchInstance();
|
fetchInstance();
|
||||||
});
|
});
|
||||||
|
@@ -56,7 +56,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
<option value="medium">{{ i18n.ts.medium }}</option>
|
<option value="medium">{{ i18n.ts.medium }}</option>
|
||||||
<option value="large">{{ i18n.ts.large }}</option>
|
<option value="large">{{ i18n.ts.large }}</option>
|
||||||
</MkRadios>
|
</MkRadios>
|
||||||
<MkSwitch v-model="limitWidthOfReaction">{{ i18n.ts.limitWidthOfReaction }}</MkSwitch>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<MkSelect v-model="instanceTicker">
|
<MkSelect v-model="instanceTicker">
|
||||||
@@ -227,7 +226,6 @@ const serverDisconnectedBehavior = computed(defaultStore.makeGetterSetter('serve
|
|||||||
const showNoteActionsOnlyHover = computed(defaultStore.makeGetterSetter('showNoteActionsOnlyHover'));
|
const showNoteActionsOnlyHover = computed(defaultStore.makeGetterSetter('showNoteActionsOnlyHover'));
|
||||||
const showClipButtonInNoteFooter = computed(defaultStore.makeGetterSetter('showClipButtonInNoteFooter'));
|
const showClipButtonInNoteFooter = computed(defaultStore.makeGetterSetter('showClipButtonInNoteFooter'));
|
||||||
const reactionsDisplaySize = computed(defaultStore.makeGetterSetter('reactionsDisplaySize'));
|
const reactionsDisplaySize = computed(defaultStore.makeGetterSetter('reactionsDisplaySize'));
|
||||||
const limitWidthOfReaction = computed(defaultStore.makeGetterSetter('limitWidthOfReaction'));
|
|
||||||
const collapseRenotes = computed(defaultStore.makeGetterSetter('collapseRenotes'));
|
const collapseRenotes = computed(defaultStore.makeGetterSetter('collapseRenotes'));
|
||||||
const reduceAnimation = computed(defaultStore.makeGetterSetter('animation', v => !v, v => !v));
|
const reduceAnimation = computed(defaultStore.makeGetterSetter('animation', v => !v, v => !v));
|
||||||
const useBlurEffectForModal = computed(defaultStore.makeGetterSetter('useBlurEffectForModal'));
|
const useBlurEffectForModal = computed(defaultStore.makeGetterSetter('useBlurEffectForModal'));
|
||||||
@@ -292,7 +290,6 @@ watch([
|
|||||||
overridedDeviceKind,
|
overridedDeviceKind,
|
||||||
mediaListWithOneImageAppearance,
|
mediaListWithOneImageAppearance,
|
||||||
reactionsDisplaySize,
|
reactionsDisplaySize,
|
||||||
limitWidthOfReaction,
|
|
||||||
highlightSensitiveMedia,
|
highlightSensitiveMedia,
|
||||||
keepScreenOn,
|
keepScreenOn,
|
||||||
disableStreamingTimeline,
|
disableStreamingTimeline,
|
||||||
|
@@ -9,14 +9,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
<template #icon><i class="ti ti-message-off"></i></template>
|
<template #icon><i class="ti ti-message-off"></i></template>
|
||||||
<template #label>{{ i18n.ts.wordMute }}</template>
|
<template #label>{{ i18n.ts.wordMute }}</template>
|
||||||
|
|
||||||
<XWordMute :muted="$i!.mutedWords" @save="saveMutedWords"/>
|
<XWordMute/>
|
||||||
</MkFolder>
|
|
||||||
|
|
||||||
<MkFolder>
|
|
||||||
<template #icon><i class="ti ti-message-off"></i></template>
|
|
||||||
<template #label>{{ i18n.ts.hardWordMute }}</template>
|
|
||||||
|
|
||||||
<XWordMute :muted="$i!.hardMutedWords" @save="saveHardMutedWords"/>
|
|
||||||
</MkFolder>
|
</MkFolder>
|
||||||
|
|
||||||
<MkFolder>
|
<MkFolder>
|
||||||
@@ -136,7 +129,6 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
|
|||||||
import MkUserCardMini from '@/components/MkUserCardMini.vue';
|
import MkUserCardMini from '@/components/MkUserCardMini.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import { infoImageUrl } from '@/instance.js';
|
import { infoImageUrl } from '@/instance.js';
|
||||||
import { $i } from '@/account.js';
|
|
||||||
import MkFolder from '@/components/MkFolder.vue';
|
import MkFolder from '@/components/MkFolder.vue';
|
||||||
|
|
||||||
const renoteMutingPagination = {
|
const renoteMutingPagination = {
|
||||||
@@ -215,14 +207,6 @@ async function toggleBlockItem(item) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveMutedWords(mutedWords: (string | string[])[]) {
|
|
||||||
await os.api('i/update', { mutedWords });
|
|
||||||
}
|
|
||||||
|
|
||||||
async function saveHardMutedWords(hardMutedWords: (string | string[])[]) {
|
|
||||||
await os.api('i/update', { hardMutedWords });
|
|
||||||
}
|
|
||||||
|
|
||||||
const headerActions = $computed(() => []);
|
const headerActions = $computed(() => []);
|
||||||
|
|
||||||
const headerTabs = $computed(() => []);
|
const headerTabs = $computed(() => []);
|
||||||
|
@@ -18,17 +18,16 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import MkTextarea from '@/components/MkTextarea.vue';
|
import MkTextarea from '@/components/MkTextarea.vue';
|
||||||
|
import MkKeyValue from '@/components/MkKeyValue.vue';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
|
import MkInfo from '@/components/MkInfo.vue';
|
||||||
|
import MkTab from '@/components/MkTab.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import number from '@/filters/number.js';
|
||||||
|
import { defaultStore } from '@/store.js';
|
||||||
|
import { $i } from '@/account.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
const props = defineProps<{
|
|
||||||
muted: (string[] | string)[];
|
|
||||||
}>();
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
|
||||||
(ev: 'save', value: (string[] | string)[]): void;
|
|
||||||
}>();
|
|
||||||
|
|
||||||
const render = (mutedWords) => mutedWords.map(x => {
|
const render = (mutedWords) => mutedWords.map(x => {
|
||||||
if (Array.isArray(x)) {
|
if (Array.isArray(x)) {
|
||||||
@@ -38,7 +37,8 @@ const render = (mutedWords) => mutedWords.map(x => {
|
|||||||
}
|
}
|
||||||
}).join('\n');
|
}).join('\n');
|
||||||
|
|
||||||
const mutedWords = ref(render(props.muted));
|
const tab = ref('soft');
|
||||||
|
const mutedWords = ref(render($i!.mutedWords));
|
||||||
const changed = ref(false);
|
const changed = ref(false);
|
||||||
|
|
||||||
watch(mutedWords, () => {
|
watch(mutedWords, () => {
|
||||||
@@ -85,7 +85,9 @@ async function save() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
emit('save', parsed);
|
await os.api('i/update', {
|
||||||
|
mutedWords: parsed,
|
||||||
|
});
|
||||||
|
|
||||||
changed.value = false;
|
changed.value = false;
|
||||||
}
|
}
|
||||||
|
@@ -54,24 +54,22 @@ import { miLocalStorage } from '@/local-storage.js';
|
|||||||
const { t, ts } = i18n;
|
const { t, ts } = i18n;
|
||||||
|
|
||||||
const defaultStoreSaveKeys: (keyof typeof defaultStore['state'])[] = [
|
const defaultStoreSaveKeys: (keyof typeof defaultStore['state'])[] = [
|
||||||
'collapseRenotes',
|
|
||||||
'menu',
|
'menu',
|
||||||
'visibility',
|
'visibility',
|
||||||
'localOnly',
|
'localOnly',
|
||||||
'statusbars',
|
'statusbars',
|
||||||
'widgets',
|
'widgets',
|
||||||
'tl',
|
'tl',
|
||||||
'pinnedUserLists',
|
|
||||||
'overridedDeviceKind',
|
'overridedDeviceKind',
|
||||||
'serverDisconnectedBehavior',
|
'serverDisconnectedBehavior',
|
||||||
|
'collapseRenotes',
|
||||||
|
'showNoteActionsOnlyHover',
|
||||||
'nsfw',
|
'nsfw',
|
||||||
'highlightSensitiveMedia',
|
|
||||||
'animation',
|
'animation',
|
||||||
'animatedMfm',
|
'animatedMfm',
|
||||||
'advancedMfm',
|
'advancedMfm',
|
||||||
'loadRawImages',
|
'loadRawImages',
|
||||||
'imageNewTab',
|
'imageNewTab',
|
||||||
'enableDataSaverMode',
|
|
||||||
'disableShowingAnimatedImages',
|
'disableShowingAnimatedImages',
|
||||||
'emojiStyle',
|
'emojiStyle',
|
||||||
'disableDrawer',
|
'disableDrawer',
|
||||||
@@ -91,28 +89,9 @@ const defaultStoreSaveKeys: (keyof typeof defaultStore['state'])[] = [
|
|||||||
'menuDisplay',
|
'menuDisplay',
|
||||||
'reportError',
|
'reportError',
|
||||||
'squareAvatars',
|
'squareAvatars',
|
||||||
'showAvatarDecorations',
|
|
||||||
'numberOfPageCache',
|
'numberOfPageCache',
|
||||||
'showNoteActionsOnlyHover',
|
|
||||||
'showClipButtonInNoteFooter',
|
|
||||||
'reactionsDisplaySize',
|
|
||||||
'forceShowAds',
|
|
||||||
'aiChanMode',
|
'aiChanMode',
|
||||||
'devMode',
|
|
||||||
'mediaListWithOneImageAppearance',
|
'mediaListWithOneImageAppearance',
|
||||||
'notificationPosition',
|
|
||||||
'notificationStackAxis',
|
|
||||||
'enableCondensedLineForAcct',
|
|
||||||
'keepScreenOn',
|
|
||||||
'defaultWithReplies',
|
|
||||||
'disableStreamingTimeline',
|
|
||||||
'useGroupedNotifications',
|
|
||||||
'sound_masterVolume',
|
|
||||||
'sound_note',
|
|
||||||
'sound_noteMy',
|
|
||||||
'sound_notification',
|
|
||||||
'sound_antenna',
|
|
||||||
'sound_channel',
|
|
||||||
];
|
];
|
||||||
const coldDeviceStorageSaveKeys: (keyof typeof ColdDeviceStorage.default)[] = [
|
const coldDeviceStorageSaveKeys: (keyof typeof ColdDeviceStorage.default)[] = [
|
||||||
'lightTheme',
|
'lightTheme',
|
||||||
|
@@ -7,12 +7,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
<div class="_gaps_m">
|
<div class="_gaps_m">
|
||||||
<MkSelect v-model="type">
|
<MkSelect v-model="type">
|
||||||
<template #label>{{ i18n.ts.sound }}</template>
|
<template #label>{{ i18n.ts.sound }}</template>
|
||||||
<option v-for="x in soundsTypes" :key="x ?? 'null'" :value="x">{{ getSoundTypeName(x) }}</option>
|
<option v-for="x in soundsTypes" :key="x" :value="x">{{ x == null ? i18n.ts.none : x }}</option>
|
||||||
</MkSelect>
|
</MkSelect>
|
||||||
<div v-if="type === '_driveFile_'" :class="$style.fileSelectorRoot">
|
|
||||||
<MkButton :class="$style.fileSelectorButton" inline rounded primary @click="selectSound">{{ i18n.ts.selectFile }}</MkButton>
|
|
||||||
<div :class="['_nowrap', !fileUrl && $style.fileNotSelected]">{{ friendlyFileName }}</div>
|
|
||||||
</div>
|
|
||||||
<MkRange v-model="volume" :min="0" :max="1" :step="0.05" :textConverter="(v) => `${Math.floor(v * 100)}%`">
|
<MkRange v-model="volume" :min="0" :max="1" :step="0.05" :textConverter="(v) => `${Math.floor(v * 100)}%`">
|
||||||
<template #label>{{ i18n.ts.volume }}</template>
|
<template #label>{{ i18n.ts.volume }}</template>
|
||||||
</MkRange>
|
</MkRange>
|
||||||
@@ -25,149 +21,30 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, computed } from 'vue';
|
import { } from 'vue';
|
||||||
import type { SoundType } from '@/scripts/sound.js';
|
|
||||||
import MkSelect from '@/components/MkSelect.vue';
|
import MkSelect from '@/components/MkSelect.vue';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import MkRange from '@/components/MkRange.vue';
|
import MkRange from '@/components/MkRange.vue';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import * as os from '@/os.js';
|
import { playFile, soundsTypes } from '@/scripts/sound.js';
|
||||||
import { playFile, soundsTypes, getSoundDuration } from '@/scripts/sound.js';
|
|
||||||
import { selectFile } from '@/scripts/select-file.js';
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
type: SoundType;
|
type: string;
|
||||||
fileId?: string;
|
|
||||||
fileUrl?: string;
|
|
||||||
volume: number;
|
volume: number;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(ev: 'update', result: { type: SoundType; fileId?: string; fileUrl?: string; volume: number; }): void;
|
(ev: 'update', result: { type: string; volume: number; }): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const type = ref<SoundType>(props.type);
|
let type = $ref(props.type);
|
||||||
const fileId = ref(props.fileId);
|
let volume = $ref(props.volume);
|
||||||
const fileUrl = ref(props.fileUrl);
|
|
||||||
const fileName = ref<string>('');
|
|
||||||
const volume = ref(props.volume);
|
|
||||||
|
|
||||||
if (type.value === '_driveFile_' && fileId.value) {
|
|
||||||
const apiRes = await os.api('drive/files/show', {
|
|
||||||
fileId: fileId.value,
|
|
||||||
});
|
|
||||||
fileName.value = apiRes.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSoundTypeName(f: SoundType): string {
|
|
||||||
switch (f) {
|
|
||||||
case null:
|
|
||||||
return i18n.ts.none;
|
|
||||||
case '_driveFile_':
|
|
||||||
return i18n.ts._soundSettings.driveFile;
|
|
||||||
default:
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const friendlyFileName = computed<string>(() => {
|
|
||||||
if (fileName.value) {
|
|
||||||
return fileName.value;
|
|
||||||
}
|
|
||||||
if (fileUrl.value) {
|
|
||||||
return fileUrl.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return i18n.ts._soundSettings.driveFileWarn;
|
|
||||||
});
|
|
||||||
|
|
||||||
function selectSound(ev) {
|
|
||||||
selectFile(ev.currentTarget ?? ev.target, i18n.ts._soundSettings.driveFile).then(async (file) => {
|
|
||||||
if (!file.type.startsWith('audio')) {
|
|
||||||
os.alert({
|
|
||||||
type: 'warning',
|
|
||||||
title: i18n.ts._soundSettings.driveFileTypeWarn,
|
|
||||||
text: i18n.ts._soundSettings.driveFileTypeWarnDescription,
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const duration = await getSoundDuration(file.url);
|
|
||||||
if (duration >= 2000) {
|
|
||||||
const { canceled } = await os.confirm({
|
|
||||||
type: 'warning',
|
|
||||||
title: i18n.ts._soundSettings.driveFileDurationWarn,
|
|
||||||
text: i18n.ts._soundSettings.driveFileDurationWarnDescription,
|
|
||||||
okText: i18n.ts.continue,
|
|
||||||
cancelText: i18n.ts.cancel,
|
|
||||||
});
|
|
||||||
if (canceled) return;
|
|
||||||
}
|
|
||||||
|
|
||||||
fileUrl.value = file.url;
|
|
||||||
fileName.value = file.name;
|
|
||||||
fileId.value = file.id;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function listen() {
|
function listen() {
|
||||||
if (type.value === '_driveFile_' && (!fileUrl.value || !fileId.value)) {
|
playFile(type, volume);
|
||||||
os.alert({
|
|
||||||
type: 'warning',
|
|
||||||
text: i18n.ts._soundSettings.driveFileWarn,
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
playFile(type.value === '_driveFile_' ? {
|
|
||||||
type: '_driveFile_',
|
|
||||||
fileId: fileId.value as string,
|
|
||||||
fileUrl: fileUrl.value as string,
|
|
||||||
volume: volume.value,
|
|
||||||
} : {
|
|
||||||
type: type.value,
|
|
||||||
volume: volume.value,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function save() {
|
function save() {
|
||||||
if (type.value === '_driveFile_' && !fileUrl.value) {
|
emit('update', { type, volume });
|
||||||
os.alert({
|
|
||||||
type: 'warning',
|
|
||||||
text: i18n.ts._soundSettings.driveFileWarn,
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (type.value !== '_driveFile_') {
|
|
||||||
fileUrl.value = undefined;
|
|
||||||
fileName.value = '';
|
|
||||||
fileId.value = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
emit('update', {
|
|
||||||
type: type.value,
|
|
||||||
fileId: fileId.value,
|
|
||||||
fileUrl: fileUrl.value,
|
|
||||||
volume: volume.value,
|
|
||||||
});
|
|
||||||
|
|
||||||
os.success();
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style module>
|
|
||||||
.fileSelectorRoot {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fileSelectorButton {
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fileNotSelected {
|
|
||||||
font-weight: 700;
|
|
||||||
color: var(--infoWarnFg);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
@@ -5,12 +5,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="_gaps_m">
|
<div class="_gaps_m">
|
||||||
<MkSwitch v-model="notUseSound">
|
|
||||||
<template #label>{{ i18n.ts.notUseSound }}</template>
|
|
||||||
</MkSwitch>
|
|
||||||
<MkSwitch v-model="useSoundOnlyWhenActive">
|
|
||||||
<template #label>{{ i18n.ts.useSoundOnlyWhenActive }}</template>
|
|
||||||
</MkSwitch>
|
|
||||||
<MkRange v-model="masterVolume" :min="0" :max="1" :step="0.05" :textConverter="(v) => `${Math.floor(v * 100)}%`">
|
<MkRange v-model="masterVolume" :min="0" :max="1" :step="0.05" :textConverter="(v) => `${Math.floor(v * 100)}%`">
|
||||||
<template #label>{{ i18n.ts.masterVolume }}</template>
|
<template #label>{{ i18n.ts.masterVolume }}</template>
|
||||||
</MkRange>
|
</MkRange>
|
||||||
@@ -18,11 +12,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
<FormSection>
|
<FormSection>
|
||||||
<template #label>{{ i18n.ts.sounds }}</template>
|
<template #label>{{ i18n.ts.sounds }}</template>
|
||||||
<div class="_gaps_s">
|
<div class="_gaps_s">
|
||||||
<MkFolder v-for="type in operationTypes" :key="type">
|
<MkFolder v-for="type in soundsKeys" :key="type">
|
||||||
<template #label>{{ i18n.t('_sfx.' + type) }}</template>
|
<template #label>{{ i18n.t('_sfx.' + type) }}</template>
|
||||||
<template #suffix>{{ getSoundTypeName(sounds[type].type) }}</template>
|
<template #suffix>{{ sounds[type].type ?? i18n.ts.none }}</template>
|
||||||
|
|
||||||
<XSound :type="sounds[type].type" :volume="sounds[type].volume" :fileId="sounds[type].fileId" :fileUrl="sounds[type].fileUrl" @update="(res) => updated(type, res)"/>
|
<XSound :type="sounds[type].type" :volume="sounds[type].volume" @update="(res) => updated(type, res)"/>
|
||||||
</MkFolder>
|
</MkFolder>
|
||||||
</div>
|
</div>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
@@ -33,8 +27,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { Ref, computed, ref } from 'vue';
|
import { Ref, computed, ref } from 'vue';
|
||||||
import type { SoundType, OperationType } from '@/scripts/sound.js';
|
|
||||||
import type { SoundStore } from '@/store.js';
|
|
||||||
import XSound from './sounds.sound.vue';
|
import XSound from './sounds.sound.vue';
|
||||||
import MkRange from '@/components/MkRange.vue';
|
import MkRange from '@/components/MkRange.vue';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
@@ -42,39 +34,23 @@ import FormSection from '@/components/form/section.vue';
|
|||||||
import MkFolder from '@/components/MkFolder.vue';
|
import MkFolder from '@/components/MkFolder.vue';
|
||||||
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 { operationTypes } from '@/scripts/sound.js';
|
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
import MkSwitch from '@/components/MkSwitch.vue';
|
|
||||||
|
|
||||||
const notUseSound = computed(defaultStore.makeGetterSetter('sound_notUseSound'));
|
|
||||||
const useSoundOnlyWhenActive = computed(defaultStore.makeGetterSetter('sound_useSoundOnlyWhenActive'));
|
|
||||||
const masterVolume = computed(defaultStore.makeGetterSetter('sound_masterVolume'));
|
const masterVolume = computed(defaultStore.makeGetterSetter('sound_masterVolume'));
|
||||||
|
|
||||||
const sounds = ref<Record<OperationType, Ref<SoundStore>>>({
|
const soundsKeys = ['note', 'noteMy', 'notification', 'antenna', 'channel'] as const;
|
||||||
|
|
||||||
|
const sounds = ref<Record<typeof soundsKeys[number], Ref<any>>>({
|
||||||
note: defaultStore.reactiveState.sound_note,
|
note: defaultStore.reactiveState.sound_note,
|
||||||
noteMy: defaultStore.reactiveState.sound_noteMy,
|
noteMy: defaultStore.reactiveState.sound_noteMy,
|
||||||
notification: defaultStore.reactiveState.sound_notification,
|
notification: defaultStore.reactiveState.sound_notification,
|
||||||
antenna: defaultStore.reactiveState.sound_antenna,
|
antenna: defaultStore.reactiveState.sound_antenna,
|
||||||
channel: defaultStore.reactiveState.sound_channel,
|
channel: defaultStore.reactiveState.sound_channel,
|
||||||
reaction: defaultStore.reactiveState.sound_reaction,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function getSoundTypeName(f: SoundType): string {
|
|
||||||
switch (f) {
|
|
||||||
case null:
|
|
||||||
return i18n.ts.none;
|
|
||||||
case '_driveFile_':
|
|
||||||
return i18n.ts._soundSettings.driveFile;
|
|
||||||
default:
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function updated(type: keyof typeof sounds.value, sound) {
|
async function updated(type: keyof typeof sounds.value, sound) {
|
||||||
const v: SoundStore = {
|
const v = {
|
||||||
type: sound.type,
|
type: sound.type,
|
||||||
fileId: sound.fileId,
|
|
||||||
fileUrl: sound.fileUrl,
|
|
||||||
volume: sound.volume,
|
volume: sound.volume,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user