Compare commits

..

20 commits

Author SHA1 Message Date
syuilo
c48acad04b 🎨 2025-06-29 17:21:43 +09:00
github-actions[bot]
5d3bb02f4b Bump version to 2025.6.4-alpha.3 2025-06-29 06:47:43 +00:00
syuilo
933e252687 fix of f1deb89e34 2025-06-29 15:36:39 +09:00
syuilo
f1deb89e34 refactor(frontend): improve pagination implementation 2025-06-29 15:11:25 +09:00
syuilo
8bc822d829 feat(backend): クリップ内でノートを検索できるように 2025-06-29 15:10:51 +09:00
syuilo
c215cccf1d enhance(frontend): ファイルアップロード時にセンシティブ設定されているか表示するように 2025-06-29 08:50:55 +09:00
github-actions[bot]
0685bdf05c Bump version to 2025.6.4-alpha.2 2025-06-28 12:52:32 +00:00
syuilo
3394ed2122
New Crowdin updates (#16207)
* New translations ja-jp.yml (Catalan)

* New translations ja-jp.yml (Spanish)

* New translations ja-jp.yml (Spanish)

* New translations ja-jp.yml (German)

* New translations ja-jp.yml (German)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Chinese Simplified)

* New translations ja-jp.yml (Catalan)

* New translations ja-jp.yml (Spanish)

* New translations ja-jp.yml (Catalan)

* New translations ja-jp.yml (German)

* New translations ja-jp.yml (Italian)

* New translations ja-jp.yml (Korean)

* New translations ja-jp.yml (Portuguese)

* New translations ja-jp.yml (Chinese Simplified)

* New translations ja-jp.yml (Chinese Traditional)

* New translations ja-jp.yml (English)

* New translations ja-jp.yml (Chinese Traditional)

* New translations ja-jp.yml (Korean)

* New translations ja-jp.yml (Catalan)

* New translations ja-jp.yml (Catalan)

* New translations ja-jp.yml (Chinese Simplified)

* New translations ja-jp.yml (Korean)

* New translations ja-jp.yml (Spanish)

* New translations ja-jp.yml (English)

* New translations ja-jp.yml (Chinese Traditional)

* New translations ja-jp.yml (Portuguese)

* New translations ja-jp.yml (English)

* New translations ja-jp.yml (Portuguese)

* New translations ja-jp.yml (English)
2025-06-28 21:43:22 +09:00
syuilo
c5a440cf22 Update types.ts 2025-06-28 21:43:14 +09:00
syuilo
3c6f07fc8c feat: モデログを検索できるように 2025-06-28 21:38:54 +09:00
syuilo
3c5ed0ffbb enhance(frontend): improve modlog pagination 2025-06-28 21:18:36 +09:00
syuilo
b8e8f3ad25 enhance: ページネーション(一覧表示)の基準日時を指定できるように sinceId/untilIdが指定可能なエンドポイントにおいて、sinceDate/untilDateも指定可能に 2025-06-28 20:21:21 +09:00
syuilo
012b2a9764 enhance(frontend): improve MkTl rendering 2025-06-28 19:24:55 +09:00
syuilo
dfbc40f868 lint 2025-06-28 19:20:02 +09:00
syuilo
32ddaa0cf8 Update about-misskey.vue 2025-06-28 12:02:16 +09:00
syuilo
bf6e218355 refactor 2025-06-28 12:00:15 +09:00
syuilo
19ef6c0b14 Update about-misskey.vue 2025-06-27 20:10:17 +09:00
syuilo
535b86f05e lint 2025-06-27 10:02:49 +09:00
taichan
01a94eaecb
chore(CI): cache ffmpeg (#16223)
* ci: use daily cache for ffmpeg

* fix(ci): input type

* Fix current date

* Just use Daily cache

* fix condition
2025-06-26 19:08:47 +09:00
syuilo
9a28fa0534 refactor(frontend/pref): refactor preferences manager
Refactored preferences manager to decouple account context and storage provider, improving normalization and loading of profiles. Replaced static profile creation/normalization with instance-based logic, and updated usage in preferences.ts to pass account context explicitly. This enhances maintainability and prepares for better guest account handling.
2025-06-26 16:25:43 +09:00
156 changed files with 2099 additions and 1373 deletions

View file

@ -18,6 +18,14 @@ on:
- packages/misskey-js/** - packages/misskey-js/**
- .github/workflows/test-backend.yml - .github/workflows/test-backend.yml
- .github/misskey/test.yml - .github/misskey/test.yml
workflow_dispatch:
inputs:
force_ffmpeg_cache_update:
description: 'Force update ffmpeg cache'
required: false
default: false
type: boolean
jobs: jobs:
unit: unit:
name: Unit tests (backend) name: Unit tests (backend)
@ -47,7 +55,22 @@ jobs:
submodules: true submodules: true
- name: Setup pnpm - name: Setup pnpm
uses: pnpm/action-setup@v4.1.0 uses: pnpm/action-setup@v4.1.0
- name: Get current date
id: current-date
run: echo "today=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Setup and Restore ffmpeg/ffprobe Cache
id: cache-ffmpeg
uses: actions/cache@v4
with:
path: |
/usr/local/bin/ffmpeg
/usr/local/bin/ffprobe
# daily cache
key: ${{ runner.os }}-ffmpeg-${{ steps.current-date.outputs.today }}
restore-keys: |
${{ runner.os }}-ffmpeg-${{ steps.current-date.outputs.today }}
- name: Install FFmpeg - name: Install FFmpeg
if: steps.cache-ffmpeg.outputs.cache-hit != 'true' || github.event.inputs.force_ffmpeg_cache_update == true
run: | run: |
for i in {1..3}; do for i in {1..3}; do
echo "Attempt $i: Installing FFmpeg..." echo "Attempt $i: Installing FFmpeg..."

View file

@ -14,6 +14,13 @@ on:
- packages/backend/** - packages/backend/**
- packages/misskey-js/** - packages/misskey-js/**
- .github/workflows/test-federation.yml - .github/workflows/test-federation.yml
workflow_dispatch:
inputs:
force_ffmpeg_cache_update:
description: 'Force update ffmpeg cache'
required: false
default: false
type: boolean
jobs: jobs:
test: test:
@ -30,7 +37,22 @@ jobs:
submodules: true submodules: true
- name: Setup pnpm - name: Setup pnpm
uses: pnpm/action-setup@v4.1.0 uses: pnpm/action-setup@v4.1.0
- name: Get current date
id: current-date
run: echo "today=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Setup and Restore ffmpeg/ffprobe Cache
id: cache-ffmpeg
uses: actions/cache@v4
with:
path: |
/usr/local/bin/ffmpeg
/usr/local/bin/ffprobe
# daily cache
key: ${{ runner.os }}-ffmpeg-${{ steps.current-date.outputs.today }}
restore-keys: |
${{ runner.os }}-ffmpeg-${{ steps.current-date.outputs.today }}
- name: Install FFmpeg - name: Install FFmpeg
if: steps.cache-ffmpeg.outputs.cache-hit != 'true' || github.event.inputs.force_ffmpeg_cache_update == true
run: | run: |
for i in {1..3}; do for i in {1..3}; do
echo "Attempt $i: Installing FFmpeg..." echo "Attempt $i: Installing FFmpeg..."

View file

@ -2,14 +2,19 @@
### General ### General
- Feat: ノートの下書き機能 - Feat: ノートの下書き機能
- Feat: クリップ内でノートを検索できるように
### Client ### Client
- Feat: モデログを検索できるように
- Enhance: 設定の自動バックアップをオンにした直後に自動バックアップするように - Enhance: 設定の自動バックアップをオンにした直後に自動バックアップするように
- Enhance: ファイルアップロード前にキャプション設定を行えるように - Enhance: ファイルアップロード前にキャプション設定を行えるように
- Enhance: ページネーションの並び順を逆にできるように - Enhance: ファイルアップロード時にセンシティブ設定されているか表示するように
- Enhance: ページネーション(一覧表示)の並び順を逆にできるように
- Enhance: ページネーション(一覧表示)の基準日時を指定できるように
- Fix: ファイルがドライブの既定アップロード先に指定したフォルダにアップロードされない問題を修正 - Fix: ファイルがドライブの既定アップロード先に指定したフォルダにアップロードされない問題を修正
### Server ### Server
- Enhance: sinceId/untilIdが指定可能なエンドポイントにおいて、sinceDate/untilDateも指定可能に
- Fix: ジョブキューのProgressの値を正しく計算する - Fix: ジョブキューのProgressの値を正しく計算する

View file

@ -1313,6 +1313,7 @@ availableRoles: "Roles disponibles "
acknowledgeNotesAndEnable: "Activa'l després de comprendre els possibles perills." acknowledgeNotesAndEnable: "Activa'l després de comprendre els possibles perills."
federationSpecified: "Aquest servidor treballa amb una federació de llistes blanques. No pot interactuar amb altres servidors que no siguin els especificats per l'administrador." federationSpecified: "Aquest servidor treballa amb una federació de llistes blanques. No pot interactuar amb altres servidors que no siguin els especificats per l'administrador."
federationDisabled: "La unió es troba deshabilitada en aquest servidor. No es pot interactuar amb usuaris d'altres servidors." federationDisabled: "La unió es troba deshabilitada en aquest servidor. No es pot interactuar amb usuaris d'altres servidors."
draft: "Esborrany "
confirmOnReact: "Confirmar en reaccionar" confirmOnReact: "Confirmar en reaccionar"
reactAreYouSure: "Vols reaccionar amb \"{emoji}\"?" reactAreYouSure: "Vols reaccionar amb \"{emoji}\"?"
markAsSensitiveConfirm: "Vols marcar aquest contingut com a sensible?" markAsSensitiveConfirm: "Vols marcar aquest contingut com a sensible?"
@ -1350,7 +1351,7 @@ embed: "Incrustar"
settingsMigrating: "Estem migrant la teva configuració. Si us plau espera un moment... (També pots fer la migració més tard, manualment, anant a Preferències → Altres → Migrar configuració antiga)" settingsMigrating: "Estem migrant la teva configuració. Si us plau espera un moment... (També pots fer la migració més tard, manualment, anant a Preferències → Altres → Migrar configuració antiga)"
readonly: "Només lectura" readonly: "Només lectura"
goToDeck: "Tornar al tauler" goToDeck: "Tornar al tauler"
federationJobs: "Treballs sindicats " federationJobs: "Treballs de federació"
driveAboutTip: "Al Disc veure's una llista de tots els arxius que has anat pujant.<br>\nPots tornar-los a fer servir adjuntant-los a notes noves o pots adelantar-te i pujar arxius per publicar-los més tard!<br>\n<b>Tingués en compte que si esborres un arxiu també desapareixerà de tots els llocs on l'has fet servir (notes, pàgines, avatars, imatges de capçalera, etc.)</b><br>\nTambé pots crear carpetes per organitzar les." driveAboutTip: "Al Disc veure's una llista de tots els arxius que has anat pujant.<br>\nPots tornar-los a fer servir adjuntant-los a notes noves o pots adelantar-te i pujar arxius per publicar-los més tard!<br>\n<b>Tingués en compte que si esborres un arxiu també desapareixerà de tots els llocs on l'has fet servir (notes, pàgines, avatars, imatges de capçalera, etc.)</b><br>\nTambé pots crear carpetes per organitzar les."
scrollToClose: "Desplaçar per tancar" scrollToClose: "Desplaçar per tancar"
advice: "Consell" advice: "Consell"
@ -1367,6 +1368,9 @@ redisplayAllTips: "Torna ha mostrat tots els trucs i consells"
hideAllTips: "Amagar tots els trucs i consells" hideAllTips: "Amagar tots els trucs i consells"
defaultImageCompressionLevel: "Nivell de comprensió de la imatge per defecte" defaultImageCompressionLevel: "Nivell de comprensió de la imatge per defecte"
defaultImageCompressionLevel_description: "Baixa, conserva la qualitat de la imatge però la mida de l'arxiu és més gran. <br>Alta, redueix la mida de l'arxiu però també la qualitat de la imatge." defaultImageCompressionLevel_description: "Baixa, conserva la qualitat de la imatge però la mida de l'arxiu és més gran. <br>Alta, redueix la mida de l'arxiu però també la qualitat de la imatge."
_order:
newest: "Més recent"
oldest: "Cronològic"
_chat: _chat:
noMessagesYet: "Encara no tens missatges " noMessagesYet: "Encara no tens missatges "
newMessage: "Missatge nou" newMessage: "Missatge nou"
@ -1993,6 +1997,7 @@ _role:
uploadableFileTypes: "Tipus de fitxers que en podeu pujar" uploadableFileTypes: "Tipus de fitxers que en podeu pujar"
uploadableFileTypes_caption: "Especifica el tipus MIME. Es poden especificar diferents tipus MIME separats amb una nova línia, i es poden especificar comodins amb asteriscs (*). (Per exemple: image/*)" uploadableFileTypes_caption: "Especifica el tipus MIME. Es poden especificar diferents tipus MIME separats amb una nova línia, i es poden especificar comodins amb asteriscs (*). (Per exemple: image/*)"
uploadableFileTypes_caption2: "Pot que no sigui possible determinar el tipus MIME d'alguns arxius. Per permetre aquests tipus d'arxius afegeix {x} a les especificacions." uploadableFileTypes_caption2: "Pot que no sigui possible determinar el tipus MIME d'alguns arxius. Per permetre aquests tipus d'arxius afegeix {x} a les especificacions."
noteDraftLimit: "Nombre possible d'esborranys de notes al servidor"
_condition: _condition:
roleAssignedTo: "Assignat a rols manuals" roleAssignedTo: "Assignat a rols manuals"
isLocal: "Usuari local" isLocal: "Usuari local"
@ -2152,6 +2157,7 @@ _theme:
install: "Instal·lar un tema" install: "Instal·lar un tema"
manage: "Gestionar els temes " manage: "Gestionar els temes "
code: "Codi del tema" code: "Codi del tema"
copyThemeCode: "Copiar el codi del tema"
description: "Descripció" description: "Descripció"
installed: "{name} Instal·lat " installed: "{name} Instal·lat "
installedThemes: "Temes instal·lats " installedThemes: "Temes instal·lats "
@ -3103,6 +3109,7 @@ _serverSetupWizard:
text2: "Si ho desitges, agrairíem molt la teva donació per poder seguir desenvolupant el projecte." text2: "Si ho desitges, agrairíem molt la teva donació per poder seguir desenvolupant el projecte."
text3: "També hi ha privilegis especials per als donants!" text3: "També hi ha privilegis especials per als donants!"
_uploader: _uploader:
editImage: "Edició d'imatges"
compressedToX: "Comprimit a {x}" compressedToX: "Comprimit a {x}"
savedXPercent: "{x}% d'estalvi " savedXPercent: "{x}% d'estalvi "
abortConfirm: "Hi ha un arxiu que no s'ha pujat, vols cancel·lar?" abortConfirm: "Hi ha un arxiu que no s'ha pujat, vols cancel·lar?"
@ -3171,3 +3178,18 @@ _imageEffector:
checker: "Escacs" checker: "Escacs"
blockNoise: "Bloqueig de soroll" blockNoise: "Bloqueig de soroll"
tearing: "Trencament d'imatge " tearing: "Trencament d'imatge "
drafts: "Esborrany "
_drafts:
select: "Seleccionar esborrany"
cannotCreateDraftAnymore: "S'ha sobrepassat el nombre màxim d'esborranys que es poden crear."
cannotCreateDraftOfRenote: "No es poden crear esborranys de remotes."
delete: "Esborrar esborranys"
deleteAreYouSure: "Vols esborrar els esborranys?"
noDrafts: "No hi ha esborranys"
replyTo: "Respondre a {user}"
quoteOf: "Citar les notes de {user}"
postTo: "Destinat a {channel}"
saveToDraft: "Desar com a esborrany"
restoreFromDraft: "Restaurar des dels esborranys"
restore: "Restaurar esborrany"
listDrafts: "Llistat d'esborranys"

View file

@ -1347,7 +1347,7 @@ right: "Rechts"
bottom: "Unten" bottom: "Unten"
top: "Oben" top: "Oben"
embed: "Einbetten" embed: "Einbetten"
settingsMigrating: "Ihre Einstellungen werden gerade migriert, Bitte warten Sie einen Moment... (Sie können die Einstellungen später auch manuell migrieren, indem Sie zu Einstellungen → Sonstiges → Alte Einstellungen migrieren gehen)" settingsMigrating: "Deine Einstellungen werden gerade migriert. Bitte warte einen Moment... (Du kannst die Einstellungen später auch manuell migrieren, indem du zu Einstellungen → Anderes → Alte Einstellungen migrieren gehst)"
readonly: "Nur Lesezugriff" readonly: "Nur Lesezugriff"
goToDeck: "Zurück zum Deck" goToDeck: "Zurück zum Deck"
federationJobs: "Föderation Jobs" federationJobs: "Föderation Jobs"
@ -1645,6 +1645,7 @@ _serverSettings:
allowExternalApRedirect_description: "Wenn diese Option aktiviert ist, können andere Server Inhalte von Drittanbietern über diesen Server abfragen, was jedoch zu Content-Spoofing führen kann." allowExternalApRedirect_description: "Wenn diese Option aktiviert ist, können andere Server Inhalte von Drittanbietern über diesen Server abfragen, was jedoch zu Content-Spoofing führen kann."
userGeneratedContentsVisibilityForVisitor: "Sichtbarkeit von nutzergenerierten Inhalten für Gäste" userGeneratedContentsVisibilityForVisitor: "Sichtbarkeit von nutzergenerierten Inhalten für Gäste"
userGeneratedContentsVisibilityForVisitor_description: "Dies ist nützlich, um zu verhindern, dass unangemessene Inhalte, die nicht gut moderiert sind, ungewollt über deinen eigenen Server im Internet veröffentlicht werden." userGeneratedContentsVisibilityForVisitor_description: "Dies ist nützlich, um zu verhindern, dass unangemessene Inhalte, die nicht gut moderiert sind, ungewollt über deinen eigenen Server im Internet veröffentlicht werden."
userGeneratedContentsVisibilityForVisitor_description2: "Die uneingeschränkte Veröffentlichung aller Inhalte des Servers im Internet, einschließlich der vom Server empfangenen Fremdinhalte, birgt Risiken. Dies ist besonders wichtig für Betrachter, die sich des dezentralen Charakters der Inhalte nicht bewusst sind, da sie selbst fremde Inhalte fälschlicherweise als auf dem Server erstellte Inhalte wahrnehmen könnten."
_userGeneratedContentsVisibilityForVisitor: _userGeneratedContentsVisibilityForVisitor:
all: "Alles ist öffentlich" all: "Alles ist öffentlich"
localOnly: "Nur lokale Inhalte werden veröffentlicht, fremde Inhalte bleiben privat" localOnly: "Nur lokale Inhalte werden veröffentlicht, fremde Inhalte bleiben privat"
@ -2464,6 +2465,8 @@ _visibility:
disableFederation: "Deföderieren" disableFederation: "Deföderieren"
disableFederationDescription: "Nicht an andere Instanzen übertragen" disableFederationDescription: "Nicht an andere Instanzen übertragen"
_postForm: _postForm:
quitInspiteOfThereAreUnuploadedFilesConfirm: "Es gibt Dateien, die nicht hochgeladen wurden. Möchtest du diese verwerfen und das Formular schließen?"
uploaderTip: "Die Datei wurde noch nicht hochgeladen. Über das Dateimenü kannst du sie umbenennen, das Bild zuschneiden, ein Wasserzeichen hinzufügen, komprimieren usw. Die Datei wird automatisch hochgeladen, wenn du eine Notiz veröffentlichst."
replyPlaceholder: "Dieser Notiz antworten …" replyPlaceholder: "Dieser Notiz antworten …"
quotePlaceholder: "Diese Notiz zitieren …" quotePlaceholder: "Diese Notiz zitieren …"
channelPlaceholder: "In einen Kanal senden" channelPlaceholder: "In einen Kanal senden"
@ -2844,8 +2847,12 @@ _dataSaver:
_avatar: _avatar:
title: "Animierte Profilbilder deaktivieren" title: "Animierte Profilbilder deaktivieren"
description: "Die Animation von Profilbildern wird angehalten. Da animierte Bilder eine größere Dateigröße haben können als normale Bilder, kann dies den Datenverkehr weiter reduzieren." description: "Die Animation von Profilbildern wird angehalten. Da animierte Bilder eine größere Dateigröße haben können als normale Bilder, kann dies den Datenverkehr weiter reduzieren."
_urlPreviewThumbnail:
title: "URL-Vorschaubilder ausblenden"
description: "URL-Vorschaubilder werden nicht mehr geladen."
_disableUrlPreview: _disableUrlPreview:
title: "URL-Vorschau deaktivieren" title: "URL-Vorschau deaktivieren"
description: "Deaktiviert die URL-Vorschaufunktion. Anders als bei reinen Vorschaubildern wird dadurch das Laden der verlinkten Informationen selbst reduziert."
_code: _code:
title: "Code-Hervorhebungen ausblenden" title: "Code-Hervorhebungen ausblenden"
description: "Wenn Code-Hervorhebungen in MFM usw. verwendet werden, werden sie erst geladen, wenn sie angetippt werden. Die Syntaxhervorhebung erfordert das Herunterladen der Definitionsdateien für jede Programmiersprache. Es ist daher zu erwarten, dass die Deaktivierung des automatischen Ladens dieser Dateien die Menge des Datenverkehrs reduziert." description: "Wenn Code-Hervorhebungen in MFM usw. verwendet werden, werden sie erst geladen, wenn sie angetippt werden. Die Syntaxhervorhebung erfordert das Herunterladen der Definitionsdateien für jede Programmiersprache. Es ist daher zu erwarten, dass die Deaktivierung des automatischen Ladens dieser Dateien die Menge des Datenverkehrs reduziert."
@ -2903,6 +2910,8 @@ _offlineScreen:
_urlPreviewSetting: _urlPreviewSetting:
title: "Einstellungen der URL-Vorschau" title: "Einstellungen der URL-Vorschau"
enable: "URL-Vorschau aktivieren" enable: "URL-Vorschau aktivieren"
allowRedirect: "Umleitung von URL-Vorschauen erlauben"
allowRedirectDescription: "Wenn für eine URL eine Umleitung festgelegt ist, kann diese Funktion aktiviert werden, um der Umleitung zu folgen und eine Vorschau des umgeleiteten Inhalts anzuzeigen. Die Deaktivierung spart Serverressourcen, aber der Inhalt des Weiterleitungsziels wird nicht angezeigt."
timeout: "Zeitüberschreitung beim Abrufen der Vorschau (ms)" timeout: "Zeitüberschreitung beim Abrufen der Vorschau (ms)"
timeoutDescription: "Übersteigt die für die Vorschau benötigte Zeit diesen Wert, wird keine Vorschau generiert." timeoutDescription: "Übersteigt die für die Vorschau benötigte Zeit diesen Wert, wird keine Vorschau generiert."
maximumContentLength: "Maximale Content-Length (Bytes)" maximumContentLength: "Maximale Content-Length (Bytes)"
@ -3064,8 +3073,11 @@ _serverSetupWizard:
single_description: "Verwende den Server alleine als deinen eigenen." single_description: "Verwende den Server alleine als deinen eigenen."
single_youCanCreateMultipleAccounts: "Bei Bedarf können mehrere Konten eingerichtet werden, auch wenn es sich um einen Ein-Personen-Server handelt." single_youCanCreateMultipleAccounts: "Bei Bedarf können mehrere Konten eingerichtet werden, auch wenn es sich um einen Ein-Personen-Server handelt."
group: "Gruppenserver" group: "Gruppenserver"
group_description: "Lade andere vertrauenswürdige Benutzer ein und verwende es mit mehreren Personen."
open: "Offener Server" open: "Offener Server"
open_description: "Registrierung für alle öffnen." open_description: "Registrierung für alle öffnen."
openServerAdvice: "Die Aufnahme einer unbestimmten Anzahl von Nutzern birgt Risiken. Es wird empfohlen, mit einem zuverlässigen Moderationssystem zu arbeiten, um eventuell auftretende Probleme behandeln zu können."
openServerAntiSpamAdvice: "Große Sorgfalt muss auch auf die Sicherheit gelegt werden, z. B. durch die Aktivierung von Anti-Bot-Funktionen wie reCAPTCHA, um sicherzustellen, dass der Server nicht zum Verbreiten von Spam genutzt wird."
howManyUsersDoYouExpect: "Mit wie vielen Benutzern rechnest du?" howManyUsersDoYouExpect: "Mit wie vielen Benutzern rechnest du?"
_scale: _scale:
small: "Weniger als 100 (kleiner Maßstab)" small: "Weniger als 100 (kleiner Maßstab)"
@ -3076,6 +3088,8 @@ _serverSetupWizard:
doYouConnectToFediverse_description1: "Bei Anschluss an ein Netz von verteilten Servern (Fediverse) können Inhalte mit anderen Servern ausgetauscht werden." doYouConnectToFediverse_description1: "Bei Anschluss an ein Netz von verteilten Servern (Fediverse) können Inhalte mit anderen Servern ausgetauscht werden."
doYouConnectToFediverse_description2: "Die Verbindung mit dem Fediverse wird auch als „Föderation“ bezeichnet." doYouConnectToFediverse_description2: "Die Verbindung mit dem Fediverse wird auch als „Föderation“ bezeichnet."
youCanConfigureMoreFederationSettingsLater: "Erweiterte Einstellungen, wie z. B. die Angabe von föderierbaren Servern, können später vorgenommen werden." youCanConfigureMoreFederationSettingsLater: "Erweiterte Einstellungen, wie z. B. die Angabe von föderierbaren Servern, können später vorgenommen werden."
adminInfo: "Administrator-Informationen"
adminInfo_description: "Legt die Administrator-Informationen fest, die für den Empfang von Anfragen verwendet werden."
adminInfo_mustBeFilled: "Dies ist auf einem offenen Server oder bei aktivierter Föderation erforderlich." adminInfo_mustBeFilled: "Dies ist auf einem offenen Server oder bei aktivierter Föderation erforderlich."
followingSettingsAreRecommended: "Die folgenden Einstellungen werden empfohlen" followingSettingsAreRecommended: "Die folgenden Einstellungen werden empfohlen"
applyTheseSettings: "Diese Einstellungen anwenden" applyTheseSettings: "Diese Einstellungen anwenden"
@ -3110,10 +3124,12 @@ _userLists:
watermark: "Wasserzeichen" watermark: "Wasserzeichen"
defaultPreset: "Standard-Voreinstellungen" defaultPreset: "Standard-Voreinstellungen"
_watermarkEditor: _watermarkEditor:
tip: "Dem Bild kann ein Wasserzeichen, z. B. eine Quellenangabe, hinzugefügt werden."
quitWithoutSaveConfirm: "Nicht gespeicherte Änderungen verwerfen?" quitWithoutSaveConfirm: "Nicht gespeicherte Änderungen verwerfen?"
driveFileTypeWarn: "Diese Datei wird nicht unterstützt" driveFileTypeWarn: "Diese Datei wird nicht unterstützt"
driveFileTypeWarnDescription: "Bilddatei auswählen" driveFileTypeWarnDescription: "Bilddatei auswählen"
title: "Wasserzeichen bearbeiten" title: "Wasserzeichen bearbeiten"
cover: "Alles bedecken"
opacity: "Transparenz" opacity: "Transparenz"
scale: "Größe" scale: "Größe"
text: "Text" text: "Text"
@ -3121,6 +3137,9 @@ _watermarkEditor:
type: "Art" type: "Art"
image: "Bilder" image: "Bilder"
advanced: "Fortgeschritten" advanced: "Fortgeschritten"
stripe: "Streifen"
stripeWidth: "Linienbreite"
stripeFrequency: "Linienanzahl"
angle: "Winkel" angle: "Winkel"
_imageEffector: _imageEffector:
title: "Effekte" title: "Effekte"
@ -3133,3 +3152,9 @@ _imageEffector:
invert: "Farben umkehren" invert: "Farben umkehren"
grayscale: "Schwarzweiß" grayscale: "Schwarzweiß"
colorAdjust: "Farbkorrektur" colorAdjust: "Farbkorrektur"
colorClamp: "Farbkomprimierung"
colorClampAdvanced: "Farbkomprimierung (erweitert)"
distort: "Verzerrung"
stripe: "Streifen"
_drafts:
restore: "Wiederherstellen"

View file

@ -327,7 +327,7 @@ dark: "Dark"
lightThemes: "Light themes" lightThemes: "Light themes"
darkThemes: "Dark themes" darkThemes: "Dark themes"
syncDeviceDarkMode: "Sync Dark Mode with your device settings" syncDeviceDarkMode: "Sync Dark Mode with your device settings"
switchDarkModeManuallyWhenSyncEnabledConfirm: "\"{x}\" is turned on, Would you like to turn off synchronization and switch modes manually?" switchDarkModeManuallyWhenSyncEnabledConfirm: "\"{x}\" is turned on. Would you like to turn off synchronization and switch modes manually?"
drive: "Drive" drive: "Drive"
fileName: "Filename" fileName: "Filename"
selectFile: "Select a file" selectFile: "Select a file"
@ -1313,6 +1313,7 @@ availableRoles: "Available roles"
acknowledgeNotesAndEnable: "Turn on after understanding the precautions." acknowledgeNotesAndEnable: "Turn on after understanding the precautions."
federationSpecified: "This server is operated in a whitelist federation. Interacting with servers other than those designated by the administrator is not allowed." federationSpecified: "This server is operated in a whitelist federation. Interacting with servers other than those designated by the administrator is not allowed."
federationDisabled: "Federation is disabled on this server. You cannot interact with users on other servers." federationDisabled: "Federation is disabled on this server. You cannot interact with users on other servers."
draft: "Drafts"
confirmOnReact: "Confirm when reacting" confirmOnReact: "Confirm when reacting"
reactAreYouSure: "Would you like to add a \"{emoji}\" reaction?" reactAreYouSure: "Would you like to add a \"{emoji}\" reaction?"
markAsSensitiveConfirm: "Do you want to set this media as sensitive?" markAsSensitiveConfirm: "Do you want to set this media as sensitive?"
@ -1367,6 +1368,9 @@ redisplayAllTips: "Show all “Tips & Tricks” again"
hideAllTips: "Hide all \"Tips & Tricks\"" hideAllTips: "Hide all \"Tips & Tricks\""
defaultImageCompressionLevel: "Default image compression level" defaultImageCompressionLevel: "Default image compression level"
defaultImageCompressionLevel_description: "High, reduces the file size but also the image quality. <br>High, reduces the file size but also the image quality." defaultImageCompressionLevel_description: "High, reduces the file size but also the image quality. <br>High, reduces the file size but also the image quality."
_order:
newest: "Newest First"
oldest: "Oldest First"
_chat: _chat:
noMessagesYet: "No messages yet" noMessagesYet: "No messages yet"
newMessage: "New message" newMessage: "New message"
@ -1993,6 +1997,7 @@ _role:
uploadableFileTypes: "Uploadable file types" uploadableFileTypes: "Uploadable file types"
uploadableFileTypes_caption: "Specifies the allowed MIME/file types. Multiple MIME types can be specified by separating them with a new line, and wildcards can be specified with an asterisk (*). (e.g., image/*)" uploadableFileTypes_caption: "Specifies the allowed MIME/file types. Multiple MIME types can be specified by separating them with a new line, and wildcards can be specified with an asterisk (*). (e.g., image/*)"
uploadableFileTypes_caption2: "Some files types might fail to be detected. To allow such files, add {x} to the specification." uploadableFileTypes_caption2: "Some files types might fail to be detected. To allow such files, add {x} to the specification."
noteDraftLimit: "Number of possible drafts of server notes"
_condition: _condition:
roleAssignedTo: "Assigned to manual roles" roleAssignedTo: "Assigned to manual roles"
isLocal: "Local user" isLocal: "Local user"
@ -2152,6 +2157,7 @@ _theme:
install: "Install a theme" install: "Install a theme"
manage: "Manage themes" manage: "Manage themes"
code: "Theme code" code: "Theme code"
copyThemeCode: "Copy theme code"
description: "Description" description: "Description"
installed: "{name} has been installed" installed: "{name} has been installed"
installedThemes: "Installed themes" installedThemes: "Installed themes"
@ -3103,6 +3109,7 @@ _serverSetupWizard:
text2: "We would appreciate your support so that we can continue to develop this software further into the future." text2: "We would appreciate your support so that we can continue to develop this software further into the future."
text3: "There are also special benefits for supporters!" text3: "There are also special benefits for supporters!"
_uploader: _uploader:
editImage: "Edit Image"
compressedToX: "Compressed to {x}" compressedToX: "Compressed to {x}"
savedXPercent: "Saving {x}%" savedXPercent: "Saving {x}%"
abortConfirm: "Some files have not been uploaded, do you want to abort?" abortConfirm: "Some files have not been uploaded, do you want to abort?"
@ -3159,8 +3166,8 @@ _imageEffector:
glitch: "Glitch" glitch: "Glitch"
mirror: "Mirror" mirror: "Mirror"
invert: "Invert Colors" invert: "Invert Colors"
grayscale: "white-black" grayscale: "Grayscale"
colorAdjust: "Colour Correction" colorAdjust: "Color Correction"
colorClamp: "Color Compression" colorClamp: "Color Compression"
colorClampAdvanced: "Color Compression (Advanced)" colorClampAdvanced: "Color Compression (Advanced)"
distort: "Distortion" distort: "Distortion"
@ -3171,3 +3178,18 @@ _imageEffector:
checker: "Checker" checker: "Checker"
blockNoise: "Block Noise" blockNoise: "Block Noise"
tearing: "Tearing" tearing: "Tearing"
drafts: "Drafts"
_drafts:
select: "Select Draft"
cannotCreateDraftAnymore: "The number of drafts that can be created has been exceeded."
cannotCreateDraftOfRenote: "You cannot create a draft of a renote."
delete: "Delete Draft"
deleteAreYouSure: "Delete draft?"
noDrafts: "No drafts"
replyTo: "Reply to {user}"
quoteOf: "Citation to {user}'s note"
postTo: "Posting to {channel}"
saveToDraft: "Save to Draft"
restoreFromDraft: "Restore from Draft"
restore: "Restore"
listDrafts: "List of Drafts"

View file

@ -65,7 +65,7 @@ copyFileId: "Copiar ID del archivo"
copyFolderId: "Copiar ID de carpeta" copyFolderId: "Copiar ID de carpeta"
copyProfileUrl: "Copiar la URL del perfil" copyProfileUrl: "Copiar la URL del perfil"
searchUser: "Buscar un usuario" searchUser: "Buscar un usuario"
searchThisUsersNotes: "" searchThisUsersNotes: "Buscar en las notas de este usuario"
reply: "Responder" reply: "Responder"
loadMore: "Ver más" loadMore: "Ver más"
showMore: "Ver más" showMore: "Ver más"
@ -125,7 +125,7 @@ renoteToOtherChannel: "Renotar a otro canal"
pinnedNote: "Nota fijada" pinnedNote: "Nota fijada"
pinned: "Fijar al perfil" pinned: "Fijar al perfil"
you: "Tú" you: "Tú"
clickToShow: "Click para ver" clickToShow: "Haz clic para verlo"
sensitive: "Marcado como sensible" sensitive: "Marcado como sensible"
add: "Agregar" add: "Agregar"
reaction: "Reacción" reaction: "Reacción"
@ -168,7 +168,7 @@ customEmojis: "Emojis personalizados"
emoji: "Emoji" emoji: "Emoji"
emojis: "Emoji" emojis: "Emoji"
emojiName: "Nombre del emoji" emojiName: "Nombre del emoji"
emojiUrl: "URL de la imágen del emoji" emojiUrl: "URL de la imagen del emoji"
addEmoji: "Agregar emoji" addEmoji: "Agregar emoji"
settingGuide: "Configuración sugerida" settingGuide: "Configuración sugerida"
cacheRemoteFiles: "Mantener en cache los archivos remotos" cacheRemoteFiles: "Mantener en cache los archivos remotos"
@ -848,7 +848,7 @@ info: "Información"
userInfo: "Información del usuario" userInfo: "Información del usuario"
unknown: "Desconocido" unknown: "Desconocido"
onlineStatus: "En línea" onlineStatus: "En línea"
hideOnlineStatus: "mostrarse como desconectado" hideOnlineStatus: "Mostrarse como desconectado"
hideOnlineStatusDescription: "Ocultar su estado en línea puede reducir la eficacia de algunas funciones, como la búsqueda" hideOnlineStatusDescription: "Ocultar su estado en línea puede reducir la eficacia de algunas funciones, como la búsqueda"
online: "En línea" online: "En línea"
active: "Activo" active: "Activo"
@ -1313,6 +1313,7 @@ availableRoles: "Roles disponibles "
acknowledgeNotesAndEnable: "Activar después de comprender las precauciones" acknowledgeNotesAndEnable: "Activar después de comprender las precauciones"
federationSpecified: "Este servidor opera en una federación de listas blancas. No puede interactuar con otros servidores que no sean los especificados por el administrador." federationSpecified: "Este servidor opera en una federación de listas blancas. No puede interactuar con otros servidores que no sean los especificados por el administrador."
federationDisabled: "La federación está desactivada en este servidor. No puede interactuar con usuarios de otros servidores" federationDisabled: "La federación está desactivada en este servidor. No puede interactuar con usuarios de otros servidores"
draft: "Borrador"
confirmOnReact: "Confirmar la reacción" confirmOnReact: "Confirmar la reacción"
reactAreYouSure: "¿Quieres añadir una reacción «{emoji}»?" reactAreYouSure: "¿Quieres añadir una reacción «{emoji}»?"
markAsSensitiveConfirm: "¿Desea establecer este medio multimedia(Imagen,vídeo...) como sensible?" markAsSensitiveConfirm: "¿Desea establecer este medio multimedia(Imagen,vídeo...) como sensible?"
@ -1367,6 +1368,9 @@ redisplayAllTips: "Volver a mostrar todos \"Trucos y consejos\""
hideAllTips: "Ocultar todos los \"Trucos y consejos\"" hideAllTips: "Ocultar todos los \"Trucos y consejos\""
defaultImageCompressionLevel: "Nivel de compresión de la imagen por defecto" defaultImageCompressionLevel: "Nivel de compresión de la imagen por defecto"
defaultImageCompressionLevel_description: "Baja, conserva la calidad de la imagen pero la medida del archivo es más grande. <br>Alta, reduce la medida del archivo pero también la calidad de la imagen." defaultImageCompressionLevel_description: "Baja, conserva la calidad de la imagen pero la medida del archivo es más grande. <br>Alta, reduce la medida del archivo pero también la calidad de la imagen."
_order:
newest: "Los más recientes primero"
oldest: "Los más antiguos primero"
_chat: _chat:
noMessagesYet: "Aún no hay mensajes" noMessagesYet: "Aún no hay mensajes"
newMessage: "Mensajes nuevos" newMessage: "Mensajes nuevos"
@ -1382,7 +1386,7 @@ _chat:
noInvitations: "No hay invitación." noInvitations: "No hay invitación."
history: "Historial" history: "Historial"
noHistory: "No hay datos en el historial" noHistory: "No hay datos en el historial"
noRooms: "Sala no encontrada" noRooms: "No te has unido a ninguna sala "
inviteUser: "Invitar usuarios" inviteUser: "Invitar usuarios"
sentInvitations: "Invitaciones enviadas" sentInvitations: "Invitaciones enviadas"
join: "Unirse" join: "Unirse"
@ -1483,7 +1487,7 @@ _accountSettings:
makeNotesHiddenBeforeDescription: "Mientras esta función esté activada, las notas que hayan pasado la fecha y hora fijadas o hayan transcurrido el tiempo establecido sólo serán visibles para ti (se harán privadas). Si la desactivas, también se restablecerá el estado público de las notas." makeNotesHiddenBeforeDescription: "Mientras esta función esté activada, las notas que hayan pasado la fecha y hora fijadas o hayan transcurrido el tiempo establecido sólo serán visibles para ti (se harán privadas). Si la desactivas, también se restablecerá el estado público de las notas."
mayNotEffectForFederatedNotes: "Notas federadas por un servidor remoto pueden no verse afectadas." mayNotEffectForFederatedNotes: "Notas federadas por un servidor remoto pueden no verse afectadas."
mayNotEffectSomeSituations: "Estas restricciones son simplificadas. Pueden no aplicarse en algunas situaciones, como cuando se visualiza en un servidor remoto o durante la moderación." mayNotEffectSomeSituations: "Estas restricciones son simplificadas. Pueden no aplicarse en algunas situaciones, como cuando se visualiza en un servidor remoto o durante la moderación."
notesHavePassedSpecifiedPeriod: "Ten en cuenta que el tiempo especificado ha pasado" notesHavePassedSpecifiedPeriod: "Notas publicadas durante el siguiente tiempo específico"
notesOlderThanSpecifiedDateAndTime: "Notas antes de la fecha y hora especificadas" notesOlderThanSpecifiedDateAndTime: "Notas antes de la fecha y hora especificadas"
_abuseUserReport: _abuseUserReport:
forward: "Reenviar" forward: "Reenviar"
@ -1993,6 +1997,7 @@ _role:
uploadableFileTypes: "Tipos de archivos que se pueden cargar." uploadableFileTypes: "Tipos de archivos que se pueden cargar."
uploadableFileTypes_caption: "Especifica los tipos MIME/archivos permitidos. Se pueden especificar varios tipos MIME separándolos con una nueva línea, y se pueden especificar comodines con un asterisco (*). (por ejemplo, image/*)" uploadableFileTypes_caption: "Especifica los tipos MIME/archivos permitidos. Se pueden especificar varios tipos MIME separándolos con una nueva línea, y se pueden especificar comodines con un asterisco (*). (por ejemplo, image/*)"
uploadableFileTypes_caption2: "Es posible que no se detecten algunos tipos de archivos. Para permitir estos archivos, añade {x} a la especificación." uploadableFileTypes_caption2: "Es posible que no se detecten algunos tipos de archivos. Para permitir estos archivos, añade {x} a la especificación."
noteDraftLimit: "Número de posibles borradores de notas del servidor"
_condition: _condition:
roleAssignedTo: "Asignado a roles manuales" roleAssignedTo: "Asignado a roles manuales"
isLocal: "Usuario local" isLocal: "Usuario local"
@ -2152,6 +2157,7 @@ _theme:
install: "Instalar tema" install: "Instalar tema"
manage: "Gestor de temas" manage: "Gestor de temas"
code: "Código del tema" code: "Código del tema"
copyThemeCode: "Copiar el código del tema"
description: "Descripción" description: "Descripción"
installed: "{name} ha sido instalado" installed: "{name} ha sido instalado"
installedThemes: "Temas instalados" installedThemes: "Temas instalados"
@ -2262,7 +2268,7 @@ _2fa:
setupCompleted: "Configuración completada" setupCompleted: "Configuración completada"
step4: "Ahora cuando inicie sesión, ingrese el mismo token" step4: "Ahora cuando inicie sesión, ingrese el mismo token"
securityKeyNotSupported: "Tu navegador no soporta claves de autenticación." securityKeyNotSupported: "Tu navegador no soporta claves de autenticación."
registerTOTPBeforeKey: "Please set up an authenticator app to register a security or pass key.\npor favor. configura una aplicación de autenticación para registrar una llave de seguridad." registerTOTPBeforeKey: "Por favor. configura una aplicación de autenticación para registrar una llave de seguridad."
securityKeyInfo: "Se puede configurar el inicio de sesión usando una clave de seguridad de hardware que soporte FIDO2 o con un certificado de huella digital o con un PIN" securityKeyInfo: "Se puede configurar el inicio de sesión usando una clave de seguridad de hardware que soporte FIDO2 o con un certificado de huella digital o con un PIN"
registerSecurityKey: "Registrar una llave de seguridad" registerSecurityKey: "Registrar una llave de seguridad"
securityKeyName: "Ingresa un nombre para la clave" securityKeyName: "Ingresa un nombre para la clave"
@ -2902,7 +2908,7 @@ _reversi:
opponentHasSettingsChanged: "El oponente ha cambiado su configuración" opponentHasSettingsChanged: "El oponente ha cambiado su configuración"
allowIrregularRules: "Reglas irregulares (completamente libre)" allowIrregularRules: "Reglas irregulares (completamente libre)"
disallowIrregularRules: "Sin reglas irregulares " disallowIrregularRules: "Sin reglas irregulares "
showBoardLabels: "Mostrar el número de línea y de columna en el tablero de juego." showBoardLabels: "Mostrar el número de línea y la letra de columna en el tablero de juego."
useAvatarAsStone: "Usar los avatares de los usuarios como fichas\n" useAvatarAsStone: "Usar los avatares de los usuarios como fichas\n"
_offlineScreen: _offlineScreen:
title: "Fuera de línea. No se puede conectar con el servidor" title: "Fuera de línea. No se puede conectar con el servidor"
@ -3103,6 +3109,7 @@ _serverSetupWizard:
text2: "Agradeceríamos su apoyo para que podamos seguir desarrollando este software en el futuro." text2: "Agradeceríamos su apoyo para que podamos seguir desarrollando este software en el futuro."
text3: "También hay beneficios especiales para los donantes" text3: "También hay beneficios especiales para los donantes"
_uploader: _uploader:
editImage: "Editar la imagen"
compressedToX: "Comprimir a {x}" compressedToX: "Comprimir a {x}"
savedXPercent: "Guardando {x}%" savedXPercent: "Guardando {x}%"
abortConfirm: "Algunos archivos no se han cargado, ¿deseas cancelar?" abortConfirm: "Algunos archivos no se han cargado, ¿deseas cancelar?"
@ -3171,3 +3178,18 @@ _imageEffector:
checker: "Corrector" checker: "Corrector"
blockNoise: "Bloquear Ruido" blockNoise: "Bloquear Ruido"
tearing: "Rasgado de Imagen (Tearing)" tearing: "Rasgado de Imagen (Tearing)"
drafts: "Borrador"
_drafts:
select: "Seleccionar borradores"
cannotCreateDraftAnymore: "Se ha superado el número de borradores que se pueden crear."
cannotCreateDraftOfRenote: "No se pueden crear borradores de renotas."
delete: "Eliminar borrador"
deleteAreYouSure: "¿Quieres borrar el borrador?"
noDrafts: "No hay borradores disponibles."
replyTo: "Responder a {user}"
quoteOf: "Citar las notas de {user}"
postTo: "Destino a {channel}"
saveToDraft: "Guardar como borrador"
restoreFromDraft: "Restaurar desde los borradores"
restore: "Restaurar"
listDrafts: "Listar los borradores"

View file

@ -3169,3 +3169,5 @@ _imageEffector:
stripe: "Strisce" stripe: "Strisce"
polkadot: "A pallini" polkadot: "A pallini"
checker: "revisore" checker: "revisore"
_drafts:
restore: "Ripristina"

View file

@ -1313,6 +1313,7 @@ availableRoles: "사용 가능한 역할"
acknowledgeNotesAndEnable: "활성화 하기 전에 주의 사항을 확인했습니다." acknowledgeNotesAndEnable: "활성화 하기 전에 주의 사항을 확인했습니다."
federationSpecified: "이 서버는 화이트 리스트 제도로 운영 중 입니다. 정해진 리모트 서버가 아닌 경우 연합되지 않습니다." federationSpecified: "이 서버는 화이트 리스트 제도로 운영 중 입니다. 정해진 리모트 서버가 아닌 경우 연합되지 않습니다."
federationDisabled: "이 서버는 연합을 하지 않고 있습니다. 리모트 서버 유저와 통신을 할 수 없습니다." federationDisabled: "이 서버는 연합을 하지 않고 있습니다. 리모트 서버 유저와 통신을 할 수 없습니다."
draft: "초안"
confirmOnReact: "리액션할 때 확인" confirmOnReact: "리액션할 때 확인"
reactAreYouSure: "\" {emoji} \"로 리액션하시겠습니까?" reactAreYouSure: "\" {emoji} \"로 리액션하시겠습니까?"
markAsSensitiveConfirm: "이 미디어를 민감한 미디어로 설정하시겠습니까?" markAsSensitiveConfirm: "이 미디어를 민감한 미디어로 설정하시겠습니까?"
@ -1367,6 +1368,9 @@ redisplayAllTips: "모든 '팁과 유용한 정보'를 재표시"
hideAllTips: "모든 '팁과 유용한 정보'를 비표시" hideAllTips: "모든 '팁과 유용한 정보'를 비표시"
defaultImageCompressionLevel: "기본 이미지 압축 정도" defaultImageCompressionLevel: "기본 이미지 압축 정도"
defaultImageCompressionLevel_description: "낮추면 화질을 유지합니다만 파일 크기는 증가합니다. <br>높이면 파일 크기를 줄일 수 있습니다만 화질은 저하됩니다." defaultImageCompressionLevel_description: "낮추면 화질을 유지합니다만 파일 크기는 증가합니다. <br>높이면 파일 크기를 줄일 수 있습니다만 화질은 저하됩니다."
_order:
newest: "최신 순"
oldest: "오래된 순"
_chat: _chat:
noMessagesYet: "아직 메시지가 없습니다" noMessagesYet: "아직 메시지가 없습니다"
newMessage: "새로운 메시지" newMessage: "새로운 메시지"
@ -1993,6 +1997,7 @@ _role:
uploadableFileTypes: "업로드 가능한 파일 유형" uploadableFileTypes: "업로드 가능한 파일 유형"
uploadableFileTypes_caption: "MIME 유형을 " uploadableFileTypes_caption: "MIME 유형을 "
uploadableFileTypes_caption2: "파일에 따라서는 유형을 검사하지 못하는 경우가 있습니다. 그러한 파일을 허가하는 경우에는 {x}를 지정으로 추가해주십시오." uploadableFileTypes_caption2: "파일에 따라서는 유형을 검사하지 못하는 경우가 있습니다. 그러한 파일을 허가하는 경우에는 {x}를 지정으로 추가해주십시오."
noteDraftLimit: "서버측 노트 초안 작성 가능 수"
_condition: _condition:
roleAssignedTo: "수동 역할에 이미 할당됨" roleAssignedTo: "수동 역할에 이미 할당됨"
isLocal: "로컬 유저" isLocal: "로컬 유저"
@ -2152,6 +2157,7 @@ _theme:
install: "테마 설치" install: "테마 설치"
manage: "테마 관리" manage: "테마 관리"
code: "테마 코드" code: "테마 코드"
copyThemeCode: "테마 코드 복사"
description: "설명" description: "설명"
installed: "{name} 테마가 설치되었습니다" installed: "{name} 테마가 설치되었습니다"
installedThemes: "설치된 테마" installedThemes: "설치된 테마"
@ -3103,6 +3109,7 @@ _serverSetupWizard:
text2: "앞으로도 계속해서 개발을 할 수 있도록 괜찮으시다면 부디 기부를 부탁드립니다." text2: "앞으로도 계속해서 개발을 할 수 있도록 괜찮으시다면 부디 기부를 부탁드립니다."
text3: "지원자 대상 특전도 있습니다!" text3: "지원자 대상 특전도 있습니다!"
_uploader: _uploader:
editImage: "이미지 편집"
compressedToX: "{x}로 압축" compressedToX: "{x}로 압축"
savedXPercent: "{x}% 절약" savedXPercent: "{x}% 절약"
abortConfirm: "업로드되지 않은 파일이 있습니다만, 그만 두시겠습니까?" abortConfirm: "업로드되지 않은 파일이 있습니다만, 그만 두시겠습니까?"
@ -3171,3 +3178,18 @@ _imageEffector:
checker: "체크 무늬" checker: "체크 무늬"
blockNoise: "노이즈 방지" blockNoise: "노이즈 방지"
tearing: "티어링" tearing: "티어링"
drafts: "초안"
_drafts:
select: "초안 선택"
cannotCreateDraftAnymore: "초안 작성 가능 수를 초과했습니다."
cannotCreateDraftOfRenote: "리노트 초안은 작성할 수 없습니다."
delete: "초안 삭제\n"
deleteAreYouSure: "초안을 삭제하시겠습니까?"
noDrafts: "초안 없음\n"
replyTo: "{user}에 회신"
quoteOf: "{user} 노트에 인용"
postTo: "{channel}에 게시"
saveToDraft: "초안에 저장"
restoreFromDraft: "초안에서 복원\n"
restore: "복원"
listDrafts: "초안 목록"

View file

@ -298,6 +298,7 @@ uploadFromUrl: "Enviar por URL"
uploadFromUrlDescription: "URL do arquivo que você deseja enviar" uploadFromUrlDescription: "URL do arquivo que você deseja enviar"
uploadFromUrlRequested: "Upload solicitado" uploadFromUrlRequested: "Upload solicitado"
uploadFromUrlMayTakeTime: "Pode levar algum tempo para que o upload seja concluído." uploadFromUrlMayTakeTime: "Pode levar algum tempo para que o upload seja concluído."
uploadNFiles: "Enviar {n} arquivos"
explore: "Explorar" explore: "Explorar"
messageRead: "Lida" messageRead: "Lida"
noMoreHistory: "Não existe histórico anterior" noMoreHistory: "Não existe histórico anterior"
@ -326,6 +327,7 @@ dark: "Escuro"
lightThemes: "Tema claro" lightThemes: "Tema claro"
darkThemes: "Tema escuro" darkThemes: "Tema escuro"
syncDeviceDarkMode: "Sincronize com o modo escuro do dispositivo" syncDeviceDarkMode: "Sincronize com o modo escuro do dispositivo"
switchDarkModeManuallyWhenSyncEnabledConfirm: "\"{x}\" está ativado. Você gostaria de desligar a sincronização e alterar manualmente?"
drive: "Drive" drive: "Drive"
fileName: "Nome do Ficheiro" fileName: "Nome do Ficheiro"
selectFile: "Selecione os arquivos" selectFile: "Selecione os arquivos"
@ -578,6 +580,7 @@ newNoteRecived: "Nova nota recebida"
newNote: "Nova Nota" newNote: "Nova Nota"
sounds: "Sons" sounds: "Sons"
sound: "Sons" sound: "Sons"
notificationSoundSettings: "Configurações de som de notificações"
listen: "Ouvir" listen: "Ouvir"
none: "Nenhum" none: "Nenhum"
showInPage: "Ver na página" showInPage: "Ver na página"
@ -999,6 +1002,7 @@ failedToUpload: "Falha ao enviar"
cannotUploadBecauseInappropriate: "Esse arquivo não pôde ser enviado porque partes dele foram detectadas como potencialmente inapropriadas." cannotUploadBecauseInappropriate: "Esse arquivo não pôde ser enviado porque partes dele foram detectadas como potencialmente inapropriadas."
cannotUploadBecauseNoFreeSpace: "Envio falhou devido à falta de capacidade no Drive." cannotUploadBecauseNoFreeSpace: "Envio falhou devido à falta de capacidade no Drive."
cannotUploadBecauseExceedsFileSizeLimit: "Não é possível realizar o upload deste arquivo porque ele excede o tamanho máximo permitido." cannotUploadBecauseExceedsFileSizeLimit: "Não é possível realizar o upload deste arquivo porque ele excede o tamanho máximo permitido."
cannotUploadBecauseUnallowedFileType: "Não foi possível fazer o envio, pois o formato do arquivo não foi autorizado."
beta: "Beta" beta: "Beta"
enableAutoSensitive: "Marcar automaticamente como conteúdo sensível" enableAutoSensitive: "Marcar automaticamente como conteúdo sensível"
enableAutoSensitiveDescription: "Quando disponível, a marcação de mídia sensível será automaticamente atribuído ao conteúdo de mídia usando aprendizado de máquina. Mesmo que você desative essa função, em alguns servidores, isso pode ser configurado automaticamente." enableAutoSensitiveDescription: "Quando disponível, a marcação de mídia sensível será automaticamente atribuído ao conteúdo de mídia usando aprendizado de máquina. Mesmo que você desative essa função, em alguns servidores, isso pode ser configurado automaticamente."
@ -1309,6 +1313,7 @@ availableRoles: "Cargos disponíveis"
acknowledgeNotesAndEnable: "Ative após compreender as precauções." acknowledgeNotesAndEnable: "Ative após compreender as precauções."
federationSpecified: "Esse servidor opera com uma lista branca de federação. Interagir com servidores diferentes daqueles designados pela administração não é permitido." federationSpecified: "Esse servidor opera com uma lista branca de federação. Interagir com servidores diferentes daqueles designados pela administração não é permitido."
federationDisabled: "Federação está desabilitada nesse servidor. Você não pode interagir com usuários de outros servidores." federationDisabled: "Federação está desabilitada nesse servidor. Você não pode interagir com usuários de outros servidores."
draft: "Rascunhos"
confirmOnReact: "Confirmar ao reagir" confirmOnReact: "Confirmar ao reagir"
reactAreYouSure: "Você deseja adicionar uma reação \"{emoji}\"?" reactAreYouSure: "Você deseja adicionar uma reação \"{emoji}\"?"
markAsSensitiveConfirm: "Você deseja definir essa mídia como sensível?" markAsSensitiveConfirm: "Você deseja definir essa mídia como sensível?"
@ -1326,6 +1331,7 @@ restore: "Redefinir"
syncBetweenDevices: "Sincronizar entre dispositivos" syncBetweenDevices: "Sincronizar entre dispositivos"
preferenceSyncConflictTitle: "O valor configurado já existe no servidor." preferenceSyncConflictTitle: "O valor configurado já existe no servidor."
preferenceSyncConflictText: "As preferências com a sincronização ativada irão salvar os seus valores no servidor. Porém, já existem valores no servidor. Qual conjunto de valores você deseja sobrescrever?" preferenceSyncConflictText: "As preferências com a sincronização ativada irão salvar os seus valores no servidor. Porém, já existem valores no servidor. Qual conjunto de valores você deseja sobrescrever?"
preferenceSyncConflictChoiceMerge: "Combinar"
preferenceSyncConflictChoiceServer: "Valor configurado no servidor" preferenceSyncConflictChoiceServer: "Valor configurado no servidor"
preferenceSyncConflictChoiceDevice: "Valor configurado no dispositivo" preferenceSyncConflictChoiceDevice: "Valor configurado no dispositivo"
preferenceSyncConflictChoiceCancel: "Cancelar a habilitação de sincronização" preferenceSyncConflictChoiceCancel: "Cancelar a habilitação de sincronização"
@ -1356,6 +1362,15 @@ emojiMute: "Silenciar emoji"
emojiUnmute: "Reativar emoji" emojiUnmute: "Reativar emoji"
muteX: "Silenciar {x}" muteX: "Silenciar {x}"
unmuteX: "Reativar {x}" unmuteX: "Reativar {x}"
abort: "Abortar"
tip: "Dicas e Truques"
redisplayAllTips: "Mostrar todas as \"Dicas e Truques\" novamente"
hideAllTips: "Ocultas todas as \"Dicas e Truques\""
defaultImageCompressionLevel: "Nível de compressão de imagem padrão"
defaultImageCompressionLevel_description: "Alto, reduz o tamanho do arquivo mas, também, a qualidade da imagem.<br>Alto, reduz o tamanho do arquivo mas, também, a qualidade da imagem."
_order:
newest: "Priorizar Mais Novos"
oldest: "Priorizar Mais Antigos"
_chat: _chat:
noMessagesYet: "Ainda não há mensagens" noMessagesYet: "Ainda não há mensagens"
newMessage: "Nova mensagem" newMessage: "Nova mensagem"
@ -1442,6 +1457,8 @@ _settings:
contentsUpdateFrequency: "Frequência da obtenção de conteúdo" contentsUpdateFrequency: "Frequência da obtenção de conteúdo"
contentsUpdateFrequency_description: "Quanto maior o valor, mais o conteúdo atualiza. Porém, há uma diminuição do desempenho e aumento do tráfego e consumo de memória." contentsUpdateFrequency_description: "Quanto maior o valor, mais o conteúdo atualiza. Porém, há uma diminuição do desempenho e aumento do tráfego e consumo de memória."
contentsUpdateFrequency_description2: "Quando o modo tempo-real está ativado, o conteúdo é atualizado em tempo real, ignorando essa opção." contentsUpdateFrequency_description2: "Quando o modo tempo-real está ativado, o conteúdo é atualizado em tempo real, ignorando essa opção."
showUrlPreview: "Exibir prévia de URL"
showAvailableReactionsFirstInNote: "Exibir reações disponíveis no topo."
_chat: _chat:
showSenderName: "Exibir nome de usuário do remetente" showSenderName: "Exibir nome de usuário do remetente"
sendOnEnter: "Pressionar Enter para enviar" sendOnEnter: "Pressionar Enter para enviar"
@ -1977,6 +1994,10 @@ _role:
canImportMuting: "Permitir importação de silenciamentos" canImportMuting: "Permitir importação de silenciamentos"
canImportUserLists: "Permitir importação de listas" canImportUserLists: "Permitir importação de listas"
chatAvailability: "Permitir Conversas" chatAvailability: "Permitir Conversas"
uploadableFileTypes: "Tipos de arquivo enviáveis"
uploadableFileTypes_caption: "Especifica tipos MIME permitidos. Múltiplos tipos MIME podem ser especificados separando-os por linha. Curingas podem ser especificados com um asterisco (*). (exemplo, image/*)"
uploadableFileTypes_caption2: "Alguns tipos de arquivos podem não ser detectados. Para permiti-los, adicione {x} à especificação."
noteDraftLimit: "Limite de rascunhos possíveis"
_condition: _condition:
roleAssignedTo: "Atribuído a cargos manuais" roleAssignedTo: "Atribuído a cargos manuais"
isLocal: "Usuário local" isLocal: "Usuário local"
@ -2136,6 +2157,7 @@ _theme:
install: "Instalar um tema" install: "Instalar um tema"
manage: "Gerenciar temas" manage: "Gerenciar temas"
code: "Código do tema" code: "Código do tema"
copyThemeCode: "Copiar código do tema"
description: "Descrição" description: "Descrição"
installed: "{name} foi instalado" installed: "{name} foi instalado"
installedThemes: "Temas instalados" installedThemes: "Temas instalados"
@ -2449,6 +2471,8 @@ _visibility:
disableFederation: "Defederar" disableFederation: "Defederar"
disableFederationDescription: "Não transmitir às outras instâncias" disableFederationDescription: "Não transmitir às outras instâncias"
_postForm: _postForm:
quitInspiteOfThereAreUnuploadedFilesConfirm: "Há arquivos que não foram enviados, gostaria de descartá-los e fechar o editor?"
uploaderTip: "O arquivo ainda não foi enviado. No menu do arquivo, você pode renomear, cortar, adicionar uma marca d'água, comprimir ou descomprimir um arquivo. Arquivos serão enviados automaticamente ao publicar a nota."
replyPlaceholder: "Responder a essa nota..." replyPlaceholder: "Responder a essa nota..."
quotePlaceholder: "Citar essa nota..." quotePlaceholder: "Citar essa nota..."
channelPlaceholder: "Postar em canal..." channelPlaceholder: "Postar em canal..."
@ -2829,6 +2853,12 @@ _dataSaver:
_avatar: _avatar:
title: "Imagem do avatar" title: "Imagem do avatar"
description: "Parar animação de avatares. Imagens animadas podem ter um arquivo mais pesado do que imagens normais, potencialmente levando a reduções no tráfego de dados." description: "Parar animação de avatares. Imagens animadas podem ter um arquivo mais pesado do que imagens normais, potencialmente levando a reduções no tráfego de dados."
_urlPreviewThumbnail:
title: "Esconder miniaturas em prévias de URL"
description: "Miniaturas em prévias de URL não serão carregadas."
_disableUrlPreview:
title: "Desabilitar prévias de URL"
description: "Desabilita a função de prévias de URL. Diferente das miniaturas, essa função impede o carregamento de toda informação do link."
_code: _code:
title: "Destaque de código" title: "Destaque de código"
description: "Se as notações de formatação de código forem utilizadas em MFM, elas não irão carregar até serem selecionadas. Destaque de código exige baixar arquivos de alta definição para cada linguagem de programação. Logo, desabilitar o carregamento automático desses arquivos diminui a quantidade de informação comunicada." description: "Se as notações de formatação de código forem utilizadas em MFM, elas não irão carregar até serem selecionadas. Destaque de código exige baixar arquivos de alta definição para cada linguagem de programação. Logo, desabilitar o carregamento automático desses arquivos diminui a quantidade de informação comunicada."
@ -2886,6 +2916,8 @@ _offlineScreen:
_urlPreviewSetting: _urlPreviewSetting:
title: "Configurações da prévia de URL" title: "Configurações da prévia de URL"
enable: "Habilitar prévia de URL" enable: "Habilitar prévia de URL"
allowRedirect: "Permitir redirecionamentos de URL em prévias."
allowRedirectDescription: "Se um URL tem um redirecionamento, você pode habilitar essa função para segui-lo e exibir a prévia do conteúdo redirecionado. Desabilitar isso irá economizar recursos, mas o conteúdo não será exibido."
timeout: "Tempo máximo para obter a prévia (ms)" timeout: "Tempo máximo para obter a prévia (ms)"
timeoutDescription: "Se demorar mais que esse valor para obter uma prévia, ela não será gerada." timeoutDescription: "Se demorar mais que esse valor para obter uma prévia, ela não será gerada."
maximumContentLength: "Content-Length máximo (em bytes)" maximumContentLength: "Content-Length máximo (em bytes)"
@ -3076,6 +3108,15 @@ _serverSetupWizard:
text1: "Misskey é software aberto desenvolvido por voluntários." text1: "Misskey é software aberto desenvolvido por voluntários."
text2: "Nós apreciaríamos o seu apoio para podermos continuar o desenvolvimento desse software no futuro." text2: "Nós apreciaríamos o seu apoio para podermos continuar o desenvolvimento desse software no futuro."
text3: "Também há benefícios especiais para apoiadores!" text3: "Também há benefícios especiais para apoiadores!"
_uploader:
editImage: "Editar Imagem"
compressedToX: "Comprimido para {x}"
savedXPercent: "Salvando {x}%"
abortConfirm: "Alguns arquivos não foram enviados, deseja abortar?"
doneConfirm: "Alguns arquivos não foram enviados, deseja continuar mesmo assim?"
maxFileSizeIsX: "O tamanho máximo de arquivos enviados é {x}"
allowedTypes: "Tipos de arquivo enviáveis"
tip: "O arquivo não foi enviado. Então, esse diálogo permite que você confirme, renomeie, comprima e recorte o arquivo antes de enviar. Quando estiver pronto, você pode enviar apertando o botão \"Enviar\"."
_clientPerformanceIssueTip: _clientPerformanceIssueTip:
title: "Dicas de desempenho" title: "Dicas de desempenho"
makeSureDisabledAdBlocker: "Desative o seu bloqueador de anúncios" makeSureDisabledAdBlocker: "Desative o seu bloqueador de anúncios"
@ -3084,8 +3125,20 @@ _clientPerformanceIssueTip:
makeSureDisabledCustomCss_description: "Substituir o estilo da página pode afetar o desempenho. Certifique-se que o CSS personalizado ou extensões que modifiquem o estilo da página estejam desabilitados." makeSureDisabledCustomCss_description: "Substituir o estilo da página pode afetar o desempenho. Certifique-se que o CSS personalizado ou extensões que modifiquem o estilo da página estejam desabilitados."
makeSureDisabledAddons: "Desabilite extensões" makeSureDisabledAddons: "Desabilite extensões"
makeSureDisabledAddons_description: "Algumas extensões podem afetar comportamentos do cliente e afetar o desempenho. Por favor, desative as extensões do seu navegador e veja se isso melhora a situação." makeSureDisabledAddons_description: "Algumas extensões podem afetar comportamentos do cliente e afetar o desempenho. Por favor, desative as extensões do seu navegador e veja se isso melhora a situação."
_clip:
tip: "Clip é uma função que permite organização das suas notas."
_userLists:
tip: "Listas podem conter qualquer usuário que você especificar em sua criação. A lista criada aparece como uma linha do tempo exibindo usuários selecionados."
watermark: "Marca d'água"
defaultPreset: "Predefinição Padrão"
_watermarkEditor: _watermarkEditor:
tip: "Uma marca d'água, como informação de autoria, pode ser adicionada à imagem."
quitWithoutSaveConfirm: "Descartar mudanças?"
driveFileTypeWarn: "Esse arquivo não é compatível" driveFileTypeWarn: "Esse arquivo não é compatível"
driveFileTypeWarnDescription: "Escolha um arquivo de imagem"
title: "Editar marca d'água"
cover: "Cobrir tudo"
repeat: "Espalhar pelo conteúdo"
opacity: "Opacidade" opacity: "Opacidade"
scale: "Tamanho" scale: "Tamanho"
text: "Texto" text: "Texto"
@ -3093,4 +3146,42 @@ _watermarkEditor:
type: "Tipo" type: "Tipo"
image: "imagem" image: "imagem"
advanced: "Avançado" advanced: "Avançado"
stripe: "Listras"
stripeWidth: "Largura da linha"
stripeFrequency: "Número de linhas"
angle: "Ângulo" angle: "Ângulo"
polkadot: "Bolinhas"
checker: "Xadrez"
polkadotMainDotOpacity: "Opacidade da bolinha principal"
polkadotMainDotRadius: "Raio da bolinha principal"
polkadotSubDotOpacity: "Opacidade da bolinha secundária"
polkadotSubDotRadius: "Raio das bolinhas adicionais"
polkadotSubDotDivisions: "Número de bolinhas adicionais"
_imageEffector:
title: "Efeitos"
addEffect: "Adicionar efeitos"
discardChangesConfirm: "Tem certeza que deseja sair? Há mudanças não salvas."
_fxs:
chromaticAberration: "Aberração cromática"
glitch: "Glitch"
mirror: "Espelho"
invert: "Inverter Cores"
grayscale: "Tons de Cinza"
colorAdjust: "Correção de Cores"
colorClamp: "Compressão de Cores"
colorClampAdvanced: "Compressão Avançada de Cores"
distort: "Distorção"
threshold: "Limiarização Binária"
zoomLines: "Linhas de Ação"
stripe: "Listras"
polkadot: "Bolinhas"
checker: "Xadrez"
blockNoise: "Bloquear Ruído"
tearing: "Descontinuidade"
drafts: "Rascunhos"
_drafts:
select: "Selecionar Rascunho"
cannotCreateDraftAnymore: "O número máximo de rascunhos foi excedido."
cannotCreateDraftOfRenote: "Você não pode criar o rascunho de uma repostagem."
delete: "Excluir Rascunho"
restore: "Redefinir"

View file

@ -584,6 +584,7 @@ masterVolume: "ระดับเสียงหลัก"
notUseSound: "ไม่ใช้เสียง" notUseSound: "ไม่ใช้เสียง"
useSoundOnlyWhenActive: "มีเสียงออกเฉพาะตอนกำลังใช้ Misskey อยู่เท่านั้น" useSoundOnlyWhenActive: "มีเสียงออกเฉพาะตอนกำลังใช้ Misskey อยู่เท่านั้น"
details: "รายละเอียด" details: "รายละเอียด"
renoteDetails: "รายละเอียดรีโน้ต"
chooseEmoji: "เลือกเอโมจิ" chooseEmoji: "เลือกเอโมจิ"
unableToProcess: "ไม่สามารถดำเนินการให้เสร็จสิ้นได้" unableToProcess: "ไม่สามารถดำเนินการให้เสร็จสิ้นได้"
recentUsed: "ใช้ล่าสุด" recentUsed: "ใช้ล่าสุด"
@ -691,6 +692,7 @@ userSaysSomethingAbout: "{name} พูดอะไรบางอย่างเ
makeActive: "เปิดใช้งาน" makeActive: "เปิดใช้งาน"
display: "แสดงผล" display: "แสดงผล"
copy: "คัดลอก" copy: "คัดลอก"
copiedToClipboard: "คัดลอกไปยังคลิปบอร์ดแล้ว"
metrics: "เมตริก" metrics: "เมตริก"
overview: "ภาพรวม" overview: "ภาพรวม"
logs: "ปูม" logs: "ปูม"
@ -785,6 +787,7 @@ wide: "กว้าง"
narrow: "ชิด" narrow: "ชิด"
reloadToApplySetting: "การตั้งค่านี้จะมีผลหลังจากโหลดหน้าซ้ำเท่านั้น ต้องการที่จะโหลดใหม่เลยไหม?" reloadToApplySetting: "การตั้งค่านี้จะมีผลหลังจากโหลดหน้าซ้ำเท่านั้น ต้องการที่จะโหลดใหม่เลยไหม?"
needReloadToApply: "ต้องรีโหลดเพื่อให้การเปลี่ยนแปลงมีผล" needReloadToApply: "ต้องรีโหลดเพื่อให้การเปลี่ยนแปลงมีผล"
needToRestartServerToApply: "จำเป็นต้องรีสตาร์ทเซิร์ฟเวอร์เพื่อให้การเปลี่ยนแปลงมีผล"
showTitlebar: "แสดงแถบชื่อ" showTitlebar: "แสดงแถบชื่อ"
clearCache: "ล้างแคช" clearCache: "ล้างแคช"
onlineUsersCount: "{n} รายกำลังออนไลน์" onlineUsersCount: "{n} รายกำลังออนไลน์"

View file

@ -1313,6 +1313,7 @@ availableRoles: "可用角色"
acknowledgeNotesAndEnable: "理解注意事项后再开启。" acknowledgeNotesAndEnable: "理解注意事项后再开启。"
federationSpecified: "此服务器已开启联合白名单。只能与管理员指定的服务器通信。" federationSpecified: "此服务器已开启联合白名单。只能与管理员指定的服务器通信。"
federationDisabled: "此服务器已禁用联合。无法与其它服务器上的用户通信。" federationDisabled: "此服务器已禁用联合。无法与其它服务器上的用户通信。"
draft: "草稿"
confirmOnReact: "发送回应前需要确认" confirmOnReact: "发送回应前需要确认"
reactAreYouSure: "要用「{emoji}」进行回应吗?" reactAreYouSure: "要用「{emoji}」进行回应吗?"
markAsSensitiveConfirm: "要将此媒体标记为敏感吗?" markAsSensitiveConfirm: "要将此媒体标记为敏感吗?"
@ -1367,6 +1368,9 @@ redisplayAllTips: "重新显示所有的提示和技巧"
hideAllTips: "隐藏所有的提示和技巧" hideAllTips: "隐藏所有的提示和技巧"
defaultImageCompressionLevel: "默认图像压缩等级" defaultImageCompressionLevel: "默认图像压缩等级"
defaultImageCompressionLevel_description: "较低的等级可以保持画质,但会增加文件大小。<br>较高的等级可以减少文件大小,但相对应的画质将会降低。" defaultImageCompressionLevel_description: "较低的等级可以保持画质,但会增加文件大小。<br>较高的等级可以减少文件大小,但相对应的画质将会降低。"
_order:
newest: "从新到旧"
oldest: "从旧到新"
_chat: _chat:
noMessagesYet: "还没有消息" noMessagesYet: "还没有消息"
newMessage: "新消息" newMessage: "新消息"
@ -1993,6 +1997,7 @@ _role:
uploadableFileTypes: "可上传的文件类型" uploadableFileTypes: "可上传的文件类型"
uploadableFileTypes_caption: "指定 MIME 类型。可用换行指定多个类型,也可以用星号(*)作为通配符。(如 image/*" uploadableFileTypes_caption: "指定 MIME 类型。可用换行指定多个类型,也可以用星号(*)作为通配符。(如 image/*"
uploadableFileTypes_caption2: "文件根据文件的不同,可能无法判断其类型。若要允许此类文件,请在指定中添加 {x}。" uploadableFileTypes_caption2: "文件根据文件的不同,可能无法判断其类型。若要允许此类文件,请在指定中添加 {x}。"
noteDraftLimit: "可在服务器上创建多少草稿"
_condition: _condition:
roleAssignedTo: "已分配给手动角色" roleAssignedTo: "已分配给手动角色"
isLocal: "是本地用户" isLocal: "是本地用户"
@ -2152,6 +2157,7 @@ _theme:
install: "安装主题" install: "安装主题"
manage: "主题管理" manage: "主题管理"
code: "主题代码" code: "主题代码"
copyThemeCode: "复制主题代码"
description: "描述" description: "描述"
installed: "{name} 已安装" installed: "{name} 已安装"
installedThemes: "已安装的主题" installedThemes: "已安装的主题"
@ -3103,6 +3109,7 @@ _serverSetupWizard:
text2: "为了今后也能继续开发,如果可以的话,请考虑一下捐助。" text2: "为了今后也能继续开发,如果可以的话,请考虑一下捐助。"
text3: "也有面向支援者的特典!" text3: "也有面向支援者的特典!"
_uploader: _uploader:
editImage: "编辑图像"
compressedToX: "压缩 {x}" compressedToX: "压缩 {x}"
savedXPercent: "节省了 {x}% 的空间" savedXPercent: "节省了 {x}% 的空间"
abortConfirm: "还有未上传的文件,要中止吗?" abortConfirm: "还有未上传的文件,要中止吗?"
@ -3171,3 +3178,18 @@ _imageEffector:
checker: "检查" checker: "检查"
blockNoise: "块状噪点" blockNoise: "块状噪点"
tearing: "撕裂" tearing: "撕裂"
drafts: "草稿"
_drafts:
select: "选择草稿"
cannotCreateDraftAnymore: "已超过可创建的草稿数量。"
cannotCreateDraftOfRenote: "无法创建转帖草稿。"
delete: "删除草稿"
deleteAreYouSure: "要删除草稿吗?"
noDrafts: "没有草稿"
replyTo: "回复给 {user}"
quoteOf: "对 {user} 帖子的引用"
postTo: "向 {channel} 的投稿"
saveToDraft: "保存到草稿"
restoreFromDraft: "从草稿恢复"
restore: "恢复"
listDrafts: "草稿一览"

View file

@ -1313,6 +1313,7 @@ availableRoles: "可用角色"
acknowledgeNotesAndEnable: "了解注意事項後再開啟。" acknowledgeNotesAndEnable: "了解注意事項後再開啟。"
federationSpecified: "此伺服器以白名單聯邦的方式運作。除了管理員指定的伺服器外,它無法與其他伺服器互動。" federationSpecified: "此伺服器以白名單聯邦的方式運作。除了管理員指定的伺服器外,它無法與其他伺服器互動。"
federationDisabled: "此伺服器未開啟站台聯邦。無法與其他伺服器上的使用者互動。" federationDisabled: "此伺服器未開啟站台聯邦。無法與其他伺服器上的使用者互動。"
draft: "草稿\n"
confirmOnReact: "在做出反應前先確認" confirmOnReact: "在做出反應前先確認"
reactAreYouSure: "用「 {emoji} 」反應嗎?" reactAreYouSure: "用「 {emoji} 」反應嗎?"
markAsSensitiveConfirm: "要將這個媒體設定為敏感嗎?" markAsSensitiveConfirm: "要將這個媒體設定為敏感嗎?"
@ -1367,6 +1368,9 @@ redisplayAllTips: "重新顯示所有「提示與技巧」"
hideAllTips: "隱藏所有「提示與技巧」" hideAllTips: "隱藏所有「提示與技巧」"
defaultImageCompressionLevel: "預設的影像壓縮程度" defaultImageCompressionLevel: "預設的影像壓縮程度"
defaultImageCompressionLevel_description: "低的話可以保留畫質,但是會增加檔案的大小。<br>高的話可以減少檔案大小,但是會降低畫質。" defaultImageCompressionLevel_description: "低的話可以保留畫質,但是會增加檔案的大小。<br>高的話可以減少檔案大小,但是會降低畫質。"
_order:
newest: "最新的在前"
oldest: "最舊的在前"
_chat: _chat:
noMessagesYet: "尚無訊息" noMessagesYet: "尚無訊息"
newMessage: "新訊息" newMessage: "新訊息"
@ -1993,6 +1997,7 @@ _role:
uploadableFileTypes: "可上傳的檔案類型" uploadableFileTypes: "可上傳的檔案類型"
uploadableFileTypes_caption: "請指定 MIME 類型。可以用換行區隔多個類型,也可以使用星號(*作為萬用字元進行指定。例如image/*\n" uploadableFileTypes_caption: "請指定 MIME 類型。可以用換行區隔多個類型,也可以使用星號(*作為萬用字元進行指定。例如image/*\n"
uploadableFileTypes_caption2: "有些檔案可能無法判斷其類型。若要允許這類檔案,請在指定中加入 {x}。" uploadableFileTypes_caption2: "有些檔案可能無法判斷其類型。若要允許這類檔案,請在指定中加入 {x}。"
noteDraftLimit: "伺服器端可建立的貼文草稿數量上限\n"
_condition: _condition:
roleAssignedTo: "手動指派角色完成" roleAssignedTo: "手動指派角色完成"
isLocal: "本地使用者" isLocal: "本地使用者"
@ -2152,6 +2157,7 @@ _theme:
install: "安裝佈景主題" install: "安裝佈景主題"
manage: "管理佈景主題" manage: "管理佈景主題"
code: "佈景主題代碼" code: "佈景主題代碼"
copyThemeCode: "複製主題代碼"
description: "描述" description: "描述"
installed: "{name}已安裝" installed: "{name}已安裝"
installedThemes: "已經安裝的佈景主題" installedThemes: "已經安裝的佈景主題"
@ -3103,6 +3109,7 @@ _serverSetupWizard:
text2: "為了能夠繼續開發,若您願意的話,請考慮進行捐款。\n" text2: "為了能夠繼續開發,若您願意的話,請考慮進行捐款。\n"
text3: "也有提供支援者專屬的特典!\n" text3: "也有提供支援者專屬的特典!\n"
_uploader: _uploader:
editImage: "編輯圖片"
compressedToX: "壓縮為 {x}" compressedToX: "壓縮為 {x}"
savedXPercent: "節省了 {x}%" savedXPercent: "節省了 {x}%"
abortConfirm: "有些檔案尚未上傳,您要中止嗎?" abortConfirm: "有些檔案尚未上傳,您要中止嗎?"
@ -3171,3 +3178,18 @@ _imageEffector:
checker: "棋盤格" checker: "棋盤格"
blockNoise: "阻擋雜訊" blockNoise: "阻擋雜訊"
tearing: "撕裂" tearing: "撕裂"
drafts: "草稿\n"
_drafts:
select: "選擇草槁"
cannotCreateDraftAnymore: "已超出可建立的草稿數量上限。\n"
cannotCreateDraftOfRenote: "無法建立轉發的草稿。\n"
delete: "刪除草稿"
deleteAreYouSure: "確定要刪除草稿嗎?\n"
noDrafts: "沒有草稿。\n"
replyTo: "回覆給 {user}\n"
quoteOf: "引用自 {user} 的貼文\n"
postTo: "發佈到 {channel}\n"
saveToDraft: "儲存為草稿"
restoreFromDraft: "從草稿復原\n"
restore: "還原"
listDrafts: "草稿清單"

View file

@ -1,6 +1,6 @@
{ {
"name": "misskey", "name": "misskey",
"version": "2025.6.4-alpha.1", "version": "2025.6.4-alpha.3",
"codename": "nasubi", "codename": "nasubi",
"repository": { "repository": {
"type": "git", "type": "git",

View file

@ -98,6 +98,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
state: { type: 'string', nullable: true, default: null }, state: { type: 'string', nullable: true, default: null },
reporterOrigin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'combined' }, reporterOrigin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'combined' },
targetUserOrigin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'combined' }, targetUserOrigin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'combined' },
@ -115,7 +117,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.abuseUserReportsRepository.createQueryBuilder('report'), ps.sinceId, ps.untilId); const query = this.queryService.makePaginationQuery(this.abuseUserReportsRepository.createQueryBuilder('report'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate);
switch (ps.state) { switch (ps.state) {
case 'resolved': query.andWhere('report.resolved = TRUE'); break; case 'resolved': query.andWhere('report.resolved = TRUE'); break;

View file

@ -34,6 +34,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
publishing: { type: 'boolean', default: null, nullable: true }, publishing: { type: 'boolean', default: null, nullable: true },
}, },
required: [], required: [],
@ -48,7 +50,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
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, ps.sinceDate, ps.untilDate);
if (ps.publishing === true) { if (ps.publishing === true) {
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) { } else if (ps.publishing === false) {

View file

@ -68,6 +68,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
userId: { type: 'string', format: 'misskey:id', nullable: true }, userId: { type: 'string', format: 'misskey:id', nullable: true },
status: { type: 'string', enum: ['all', 'active', 'archived'], default: 'active' }, status: { type: 'string', enum: ['all', 'active', 'archived'], default: 'active' },
}, },
@ -87,7 +89,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private idService: IdService, private idService: IdService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.announcementsRepository.createQueryBuilder('announcement'), ps.sinceId, ps.untilId); const query = this.queryService.makePaginationQuery(this.announcementsRepository.createQueryBuilder('announcement'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate);
if (ps.status === 'archived') { if (ps.status === 'archived') {
query.andWhere('announcement.isActive = false'); query.andWhere('announcement.isActive = false');

View file

@ -71,6 +71,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
userId: { type: 'string', format: 'misskey:id', nullable: true }, userId: { type: 'string', format: 'misskey:id', nullable: true },
}, },
required: [], required: [],

View file

@ -34,6 +34,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
userId: { type: 'string', format: 'misskey:id', nullable: true }, userId: { type: 'string', format: 'misskey:id', nullable: true },
type: { type: 'string', nullable: true, pattern: /^[a-zA-Z0-9\/\-*]+$/.toString().slice(1, -1) }, type: { type: 'string', nullable: true, pattern: /^[a-zA-Z0-9\/\-*]+$/.toString().slice(1, -1) },
origin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'local' }, origin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'local' },
@ -57,7 +59,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.driveFilesRepository.createQueryBuilder('file'), ps.sinceId, ps.untilId); const query = this.queryService.makePaginationQuery(this.driveFilesRepository.createQueryBuilder('file'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate);
if (ps.userId) { if (ps.userId) {
query.andWhere('file.userId = :userId', { userId: ps.userId }); query.andWhere('file.userId = :userId', { userId: ps.userId });

View file

@ -74,6 +74,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: [], required: [],
} as const; } as const;
@ -89,7 +91,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private emojiEntityService: EmojiEntityService, private emojiEntityService: EmojiEntityService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const q = this.queryService.makePaginationQuery(this.emojisRepository.createQueryBuilder('emoji'), ps.sinceId, ps.untilId); const q = this.queryService.makePaginationQuery(this.emojisRepository.createQueryBuilder('emoji'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate);
if (ps.host == null) { if (ps.host == null) {
q.andWhere('emoji.host IS NOT NULL'); q.andWhere('emoji.host IS NOT NULL');

View file

@ -68,6 +68,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: [], required: [],
} as const; } as const;
@ -82,7 +84,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const q = this.queryService.makePaginationQuery(this.emojisRepository.createQueryBuilder('emoji'), ps.sinceId, ps.untilId) const q = this.queryService.makePaginationQuery(this.emojisRepository.createQueryBuilder('emoji'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('emoji.host IS NULL'); .andWhere('emoji.host IS NULL');
let emojis: MiEmoji[]; let emojis: MiEmoji[];

View file

@ -49,6 +49,8 @@ export const paramDef = {
roleId: { type: 'string', format: 'misskey:id' }, roleId: { type: 'string', format: 'misskey:id' },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
}, },
required: ['roleId'], required: ['roleId'],
@ -76,7 +78,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw new ApiError(meta.errors.noSuchRole); throw new ApiError(meta.errors.noSuchRole);
} }
const query = this.queryService.makePaginationQuery(this.roleAssignmentsRepository.createQueryBuilder('assign'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.roleAssignmentsRepository.createQueryBuilder('assign'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('assign.roleId = :roleId', { roleId: role.id }) .andWhere('assign.roleId = :roleId', { roleId: role.id })
.andWhere(new Brackets(qb => { .andWhere(new Brackets(qb => {
qb qb

View file

@ -9,6 +9,7 @@ import type { ModerationLogsRepository } from '@/models/_.js';
import { QueryService } from '@/core/QueryService.js'; import { QueryService } from '@/core/QueryService.js';
import { DI } from '@/di-symbols.js'; import { DI } from '@/di-symbols.js';
import { ModerationLogEntityService } from '@/core/entities/ModerationLogEntityService.js'; import { ModerationLogEntityService } from '@/core/entities/ModerationLogEntityService.js';
import { sqlLikeEscape } from '@/misc/sql-like-escape.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],
@ -63,8 +64,11 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
type: { type: 'string', nullable: true }, type: { type: 'string', nullable: true },
userId: { type: 'string', format: 'misskey:id', nullable: true }, userId: { type: 'string', format: 'misskey:id', nullable: true },
search: { type: 'string', nullable: true },
}, },
required: [], required: [],
} as const; } as const;
@ -79,19 +83,24 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.moderationLogsRepository.createQueryBuilder('report'), ps.sinceId, ps.untilId); const query = this.queryService.makePaginationQuery(this.moderationLogsRepository.createQueryBuilder('log'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate);
if (ps.type != null) { if (ps.type != null) {
query.andWhere('report.type = :type', { type: ps.type }); query.andWhere('log.type = :type', { type: ps.type });
} }
if (ps.userId != null) { if (ps.userId != null) {
query.andWhere('report.userId = :userId', { userId: ps.userId }); query.andWhere('log.userId = :userId', { userId: ps.userId });
} }
const reports = await query.limit(ps.limit).getMany(); if (ps.search != null) {
const escapedSearch = sqlLikeEscape(ps.search);
query.andWhere('log.info::text ILIKE :search', { search: `%${escapedSearch}%` });
}
return await this.moderationLogEntityService.packMany(reports); const logs = await query.limit(ps.limit).getMany();
return await this.moderationLogEntityService.packMany(logs);
}); });
} }
} }

View file

@ -33,6 +33,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
isActive: { type: 'boolean', default: true }, isActive: { type: 'boolean', default: true },
}, },
required: [], required: [],
@ -48,7 +50,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private announcementEntityService: AnnouncementEntityService, private announcementEntityService: AnnouncementEntityService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.announcementsRepository.createQueryBuilder('announcement'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.announcementsRepository.createQueryBuilder('announcement'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('announcement.isActive = :isActive', { isActive: ps.isActive }) .andWhere('announcement.isActive = :isActive', { isActive: ps.isActive })
.andWhere(new Brackets(qb => { .andWhere(new Brackets(qb => {
if (me) qb.orWhere('announcement.userId = :meId', { meId: me.id }); if (me) qb.orWhere('announcement.userId = :meId', { meId: me.id });

View file

@ -34,6 +34,8 @@ export const paramDef = {
limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: [], required: [],
} as const; } as const;
@ -48,7 +50,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.blockingsRepository.createQueryBuilder('blocking'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.blockingsRepository.createQueryBuilder('blocking'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('blocking.blockerId = :meId', { meId: me.id }); .andWhere('blocking.blockerId = :meId', { meId: me.id });
const blockings = await query const blockings = await query

View file

@ -33,6 +33,8 @@ export const paramDef = {
properties: { properties: {
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 5 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 5 },
}, },
required: [], required: [],
@ -53,8 +55,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
this.channelFollowingsRepository.createQueryBuilder(), this.channelFollowingsRepository.createQueryBuilder(),
ps.sinceId, ps.sinceId,
ps.untilId, ps.untilId,
null, ps.sinceDate,
null, ps.untilDate,
'followeeId', 'followeeId',
) )
.andWhere({ followerId: me.id }); .andWhere({ followerId: me.id });

View file

@ -33,6 +33,8 @@ export const paramDef = {
properties: { properties: {
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 5 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 5 },
}, },
required: [], required: [],
@ -48,7 +50,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.channelsRepository.createQueryBuilder('channel'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.channelsRepository.createQueryBuilder('channel'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('channel.isArchived = FALSE') .andWhere('channel.isArchived = FALSE')
.andWhere({ userId: me.id }); .andWhere({ userId: me.id });

View file

@ -35,6 +35,8 @@ export const paramDef = {
type: { type: 'string', enum: ['nameAndDescription', 'nameOnly'], default: 'nameAndDescription' }, type: { type: 'string', enum: ['nameAndDescription', 'nameOnly'], default: 'nameAndDescription' },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 5 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 5 },
}, },
required: ['query'], required: ['query'],
@ -50,7 +52,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.channelsRepository.createQueryBuilder('channel'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.channelsRepository.createQueryBuilder('channel'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('channel.isArchived = FALSE'); .andWhere('channel.isArchived = FALSE');
if (ps.query !== '') { if (ps.query !== '') {

View file

@ -9,6 +9,7 @@ import { DI } from '@/di-symbols.js';
import { ChatService } from '@/core/ChatService.js'; import { ChatService } from '@/core/ChatService.js';
import { ChatEntityService } from '@/core/entities/ChatEntityService.js'; import { ChatEntityService } from '@/core/entities/ChatEntityService.js';
import { ApiError } from '@/server/api/error.js'; import { ApiError } from '@/server/api/error.js';
import { IdService } from '@/core/IdService.js';
export const meta = { export const meta = {
tags: ['chat'], tags: ['chat'],
@ -42,6 +43,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
roomId: { type: 'string', format: 'misskey:id' }, roomId: { type: 'string', format: 'misskey:id' },
}, },
required: ['roomId'], required: ['roomId'],
@ -52,8 +55,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
constructor( constructor(
private chatEntityService: ChatEntityService, private chatEntityService: ChatEntityService,
private chatService: ChatService, private chatService: ChatService,
private idService: IdService,
) { ) {
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 sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.gen(ps.sinceDate!) : null);
await this.chatService.checkChatAvailability(me.id, 'read'); await this.chatService.checkChatAvailability(me.id, 'read');
const room = await this.chatService.findRoomById(ps.roomId); const room = await this.chatService.findRoomById(ps.roomId);
@ -65,7 +72,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw new ApiError(meta.errors.noSuchRoom); throw new ApiError(meta.errors.noSuchRoom);
} }
const messages = await this.chatService.roomTimeline(room.id, ps.limit, ps.sinceId, ps.untilId); const messages = await this.chatService.roomTimeline(room.id, ps.limit, sinceId, untilId);
this.chatService.readRoomChatMessage(me.id, room.id); this.chatService.readRoomChatMessage(me.id, room.id);

View file

@ -10,6 +10,7 @@ import { GetterService } from '@/server/api/GetterService.js';
import { ChatService } from '@/core/ChatService.js'; import { ChatService } from '@/core/ChatService.js';
import { ChatEntityService } from '@/core/entities/ChatEntityService.js'; import { ChatEntityService } from '@/core/entities/ChatEntityService.js';
import { ApiError } from '@/server/api/error.js'; import { ApiError } from '@/server/api/error.js';
import { IdService } from '@/core/IdService.js';
export const meta = { export const meta = {
tags: ['chat'], tags: ['chat'],
@ -43,6 +44,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
userId: { type: 'string', format: 'misskey:id' }, userId: { type: 'string', format: 'misskey:id' },
}, },
required: ['userId'], required: ['userId'],
@ -54,8 +57,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private chatEntityService: ChatEntityService, private chatEntityService: ChatEntityService,
private chatService: ChatService, private chatService: ChatService,
private getterService: GetterService, private getterService: GetterService,
private idService: IdService,
) { ) {
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 sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.gen(ps.sinceDate!) : null);
await this.chatService.checkChatAvailability(me.id, 'read'); await this.chatService.checkChatAvailability(me.id, 'read');
const other = await this.getterService.getUser(ps.userId).catch(err => { const other = await this.getterService.getUser(ps.userId).catch(err => {
@ -63,7 +70,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw err; throw err;
}); });
const messages = await this.chatService.userTimeline(me.id, other.id, ps.limit, ps.sinceId, ps.untilId); const messages = await this.chatService.userTimeline(me.id, other.id, ps.limit, sinceId, untilId);
this.chatService.readUserChatMessage(me.id, other.id); this.chatService.readUserChatMessage(me.id, other.id);

View file

@ -9,6 +9,7 @@ import { DI } from '@/di-symbols.js';
import { ChatService } from '@/core/ChatService.js'; import { ChatService } from '@/core/ChatService.js';
import { ChatEntityService } from '@/core/entities/ChatEntityService.js'; import { ChatEntityService } from '@/core/entities/ChatEntityService.js';
import { ApiError } from '@/server/api/error.js'; import { ApiError } from '@/server/api/error.js';
import { IdService } from '@/core/IdService.js';
export const meta = { export const meta = {
tags: ['chat'], tags: ['chat'],
@ -37,6 +38,8 @@ export const paramDef = {
limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
} as const; } as const;
@ -45,11 +48,15 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
constructor( constructor(
private chatEntityService: ChatEntityService, private chatEntityService: ChatEntityService,
private chatService: ChatService, private chatService: ChatService,
private idService: IdService,
) { ) {
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 sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.gen(ps.sinceDate!) : null);
await this.chatService.checkChatAvailability(me.id, 'read'); await this.chatService.checkChatAvailability(me.id, 'read');
const invitations = await this.chatService.getReceivedRoomInvitationsWithPagination(me.id, ps.limit, ps.sinceId, ps.untilId); const invitations = await this.chatService.getReceivedRoomInvitationsWithPagination(me.id, ps.limit, sinceId, untilId);
return this.chatEntityService.packRoomInvitations(invitations, me); return this.chatEntityService.packRoomInvitations(invitations, me);
}); });
} }

View file

@ -10,6 +10,7 @@ import { DI } from '@/di-symbols.js';
import { ApiError } from '@/server/api/error.js'; import { ApiError } from '@/server/api/error.js';
import { ChatService } from '@/core/ChatService.js'; import { ChatService } from '@/core/ChatService.js';
import { ChatEntityService } from '@/core/entities/ChatEntityService.js'; import { ChatEntityService } from '@/core/entities/ChatEntityService.js';
import { IdService } from '@/core/IdService.js';
export const meta = { export const meta = {
tags: ['chat'], tags: ['chat'],
@ -44,6 +45,8 @@ export const paramDef = {
limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: ['roomId'], required: ['roomId'],
} as const; } as const;
@ -53,8 +56,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
constructor( constructor(
private chatService: ChatService, private chatService: ChatService,
private chatEntityService: ChatEntityService, private chatEntityService: ChatEntityService,
private idService: IdService,
) { ) {
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 sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.gen(ps.sinceDate!) : null);
await this.chatService.checkChatAvailability(me.id, 'read'); await this.chatService.checkChatAvailability(me.id, 'read');
const room = await this.chatService.findMyRoomById(me.id, ps.roomId); const room = await this.chatService.findMyRoomById(me.id, ps.roomId);
@ -62,7 +69,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw new ApiError(meta.errors.noSuchRoom); throw new ApiError(meta.errors.noSuchRoom);
} }
const invitations = await this.chatService.getSentRoomInvitationsWithPagination(ps.roomId, ps.limit, ps.sinceId, ps.untilId); const invitations = await this.chatService.getSentRoomInvitationsWithPagination(ps.roomId, ps.limit, sinceId, untilId);
return this.chatEntityService.packRoomInvitations(invitations, me); return this.chatEntityService.packRoomInvitations(invitations, me);
}); });
} }

View file

@ -9,6 +9,7 @@ import { DI } from '@/di-symbols.js';
import { ChatService } from '@/core/ChatService.js'; import { ChatService } from '@/core/ChatService.js';
import { ChatEntityService } from '@/core/entities/ChatEntityService.js'; import { ChatEntityService } from '@/core/entities/ChatEntityService.js';
import { ApiError } from '@/server/api/error.js'; import { ApiError } from '@/server/api/error.js';
import { IdService } from '@/core/IdService.js';
export const meta = { export const meta = {
tags: ['chat'], tags: ['chat'],
@ -37,6 +38,8 @@ export const paramDef = {
limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
} as const; } as const;
@ -45,11 +48,15 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
constructor( constructor(
private chatService: ChatService, private chatService: ChatService,
private chatEntityService: ChatEntityService, private chatEntityService: ChatEntityService,
private idService: IdService,
) { ) {
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 sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.gen(ps.sinceDate!) : null);
await this.chatService.checkChatAvailability(me.id, 'read'); await this.chatService.checkChatAvailability(me.id, 'read');
const memberships = await this.chatService.getMyMemberships(me.id, ps.limit, ps.sinceId, ps.untilId); const memberships = await this.chatService.getMyMemberships(me.id, ps.limit, sinceId, untilId);
return this.chatEntityService.packRoomMemberships(memberships, me, { return this.chatEntityService.packRoomMemberships(memberships, me, {
populateUser: false, populateUser: false,

View file

@ -9,6 +9,7 @@ import { DI } from '@/di-symbols.js';
import { ChatService } from '@/core/ChatService.js'; import { ChatService } from '@/core/ChatService.js';
import { ApiError } from '@/server/api/error.js'; import { ApiError } from '@/server/api/error.js';
import { ChatEntityService } from '@/core/entities/ChatEntityService.js'; import { ChatEntityService } from '@/core/entities/ChatEntityService.js';
import { IdService } from '@/core/IdService.js';
export const meta = { export const meta = {
tags: ['chat'], tags: ['chat'],
@ -43,6 +44,8 @@ export const paramDef = {
limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: ['roomId'], required: ['roomId'],
} as const; } as const;
@ -52,8 +55,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
constructor( constructor(
private chatService: ChatService, private chatService: ChatService,
private chatEntityService: ChatEntityService, private chatEntityService: ChatEntityService,
private idService: IdService,
) { ) {
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 sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.gen(ps.sinceDate!) : null);
await this.chatService.checkChatAvailability(me.id, 'read'); await this.chatService.checkChatAvailability(me.id, 'read');
const room = await this.chatService.findRoomById(ps.roomId); const room = await this.chatService.findRoomById(ps.roomId);
@ -65,7 +72,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw new ApiError(meta.errors.noSuchRoom); throw new ApiError(meta.errors.noSuchRoom);
} }
const memberships = await this.chatService.getRoomMembershipsWithPagination(room.id, ps.limit, ps.sinceId, ps.untilId); const memberships = await this.chatService.getRoomMembershipsWithPagination(room.id, ps.limit, sinceId, untilId);
return this.chatEntityService.packRoomMemberships(memberships, me, { return this.chatEntityService.packRoomMemberships(memberships, me, {
populateUser: true, populateUser: true,

View file

@ -9,6 +9,7 @@ import { DI } from '@/di-symbols.js';
import { ChatService } from '@/core/ChatService.js'; import { ChatService } from '@/core/ChatService.js';
import { ChatEntityService } from '@/core/entities/ChatEntityService.js'; import { ChatEntityService } from '@/core/entities/ChatEntityService.js';
import { ApiError } from '@/server/api/error.js'; import { ApiError } from '@/server/api/error.js';
import { IdService } from '@/core/IdService.js';
export const meta = { export const meta = {
tags: ['chat'], tags: ['chat'],
@ -37,6 +38,8 @@ export const paramDef = {
limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
} as const; } as const;
@ -45,11 +48,15 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
constructor( constructor(
private chatEntityService: ChatEntityService, private chatEntityService: ChatEntityService,
private chatService: ChatService, private chatService: ChatService,
private idService: IdService,
) { ) {
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 sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.gen(ps.sinceDate!) : null);
await this.chatService.checkChatAvailability(me.id, 'read'); await this.chatService.checkChatAvailability(me.id, 'read');
const rooms = await this.chatService.getOwnedRoomsWithPagination(me.id, ps.limit, ps.sinceId, ps.untilId); const rooms = await this.chatService.getOwnedRoomsWithPagination(me.id, ps.limit, sinceId, untilId);
return this.chatEntityService.packRooms(rooms, me); return this.chatEntityService.packRooms(rooms, me);
}); });
} }

View file

@ -4,11 +4,13 @@
*/ */
import { Inject, Injectable } from '@nestjs/common'; import { Inject, Injectable } from '@nestjs/common';
import { Brackets } from 'typeorm';
import { Endpoint } from '@/server/api/endpoint-base.js'; import { Endpoint } from '@/server/api/endpoint-base.js';
import type { NotesRepository, ClipsRepository, ClipNotesRepository } from '@/models/_.js'; import type { NotesRepository, ClipsRepository, ClipNotesRepository } from '@/models/_.js';
import { QueryService } from '@/core/QueryService.js'; import { QueryService } from '@/core/QueryService.js';
import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
import { DI } from '@/di-symbols.js'; import { DI } from '@/di-symbols.js';
import { sqlLikeEscape } from '@/misc/sql-like-escape.js';
import { ApiError } from '../../error.js'; import { ApiError } from '../../error.js';
export const meta = { export const meta = {
@ -44,6 +46,9 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
search: { type: 'string', minLength: 1, maxLength: 100, nullable: true },
}, },
required: ['clipId'], required: ['clipId'],
} as const; } as const;
@ -76,7 +81,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw new ApiError(meta.errors.noSuchClip); throw new ApiError(meta.errors.noSuchClip);
} }
const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.innerJoin(this.clipNotesRepository.metadata.targetName, 'clipNote', 'clipNote.noteId = note.id') .innerJoin(this.clipNotesRepository.metadata.targetName, 'clipNote', 'clipNote.noteId = note.id')
.innerJoinAndSelect('note.user', 'user') .innerJoinAndSelect('note.user', 'user')
.leftJoinAndSelect('note.reply', 'reply') .leftJoinAndSelect('note.reply', 'reply')
@ -95,6 +100,15 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
this.queryService.generateBlockedUserQueryForNotes(query, me, { noteColumn: 'renote' }); this.queryService.generateBlockedUserQueryForNotes(query, me, { noteColumn: 'renote' });
} }
if (ps.search != null) {
for (const word of ps.search!.trim().split(' ')) {
query.andWhere(new Brackets(qb => {
qb.orWhere('note.text ILIKE :search', { search: `%${sqlLikeEscape(word)}%` });
qb.orWhere('note.cw ILIKE :search', { search: `%${sqlLikeEscape(word)}%` });
}));
}
}
const notes = await query const notes = await query
.limit(ps.limit) .limit(ps.limit)
.getMany(); .getMany();

View file

@ -34,6 +34,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
folderId: { type: 'string', format: 'misskey:id', nullable: true, default: null }, folderId: { type: 'string', format: 'misskey:id', nullable: true, default: null },
type: { type: 'string', nullable: true, pattern: /^[a-zA-Z\/\-*]+$/.toString().slice(1, -1) }, type: { type: 'string', nullable: true, pattern: /^[a-zA-Z\/\-*]+$/.toString().slice(1, -1) },
sort: { type: 'string', nullable: true, enum: ['+createdAt', '-createdAt', '+name', '-name', '+size', '-size', null] }, sort: { type: 'string', nullable: true, enum: ['+createdAt', '-createdAt', '+name', '-name', '+size', '-size', null] },
@ -51,7 +53,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.driveFilesRepository.createQueryBuilder('file'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.driveFilesRepository.createQueryBuilder('file'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('file.userId = :userId', { userId: me.id }); .andWhere('file.userId = :userId', { userId: me.id });
if (ps.folderId) { if (ps.folderId) {

View file

@ -9,8 +9,8 @@ import type { NotesRepository, DriveFilesRepository } from '@/models/_.js';
import { QueryService } from '@/core/QueryService.js'; import { QueryService } from '@/core/QueryService.js';
import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
import { DI } from '@/di-symbols.js'; import { DI } from '@/di-symbols.js';
import { ApiError } from '../../../error.js';
import { RoleService } from '@/core/RoleService.js'; import { RoleService } from '@/core/RoleService.js';
import { ApiError } from '../../../error.js';
export const meta = { export const meta = {
tags: ['drive', 'notes'], tags: ['drive', 'notes'],
@ -45,6 +45,8 @@ export const paramDef = {
properties: { properties: {
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
fileId: { type: 'string', format: 'misskey:id' }, fileId: { type: 'string', format: 'misskey:id' },
}, },
@ -75,7 +77,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw new ApiError(meta.errors.noSuchFile); throw new ApiError(meta.errors.noSuchFile);
} }
const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId); const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate);
query.andWhere(':file <@ note.fileIds', { file: [file.id] }); query.andWhere(':file <@ note.fileIds', { file: [file.id] });
const notes = await query.limit(ps.limit).getMany(); const notes = await query.limit(ps.limit).getMany();

View file

@ -34,6 +34,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
folderId: { type: 'string', format: 'misskey:id', nullable: true, default: null }, folderId: { type: 'string', format: 'misskey:id', nullable: true, default: null },
}, },
required: [], required: [],
@ -49,7 +51,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.driveFoldersRepository.createQueryBuilder('folder'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.driveFoldersRepository.createQueryBuilder('folder'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('folder.userId = :userId', { userId: me.id }); .andWhere('folder.userId = :userId', { userId: me.id });
if (ps.folderId) { if (ps.folderId) {

View file

@ -34,6 +34,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
type: { type: 'string', pattern: /^[a-zA-Z\/\-*]+$/.toString().slice(1, -1) }, type: { type: 'string', pattern: /^[a-zA-Z\/\-*]+$/.toString().slice(1, -1) },
}, },
required: [], required: [],
@ -49,7 +51,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.driveFilesRepository.createQueryBuilder('file'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.driveFilesRepository.createQueryBuilder('file'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('file.userId = :userId', { userId: me.id }); .andWhere('file.userId = :userId', { userId: me.id });
if (ps.type) { if (ps.type) {

View file

@ -32,6 +32,8 @@ export const paramDef = {
host: { type: 'string' }, host: { type: 'string' },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
}, },
required: ['host'], required: ['host'],
@ -47,7 +49,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.followingsRepository.createQueryBuilder('following'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.followingsRepository.createQueryBuilder('following'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('following.followeeHost = :host', { host: ps.host }); .andWhere('following.followeeHost = :host', { host: ps.host });
const followings = await query const followings = await query

View file

@ -32,6 +32,8 @@ export const paramDef = {
host: { type: 'string' }, host: { type: 'string' },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
}, },
required: ['host'], required: ['host'],
@ -47,7 +49,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.followingsRepository.createQueryBuilder('following'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.followingsRepository.createQueryBuilder('following'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('following.followerHost = :host', { host: ps.host }); .andWhere('following.followerHost = :host', { host: ps.host });
const followings = await query const followings = await query

View file

@ -32,6 +32,8 @@ export const paramDef = {
host: { type: 'string' }, host: { type: 'string' },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
}, },
required: ['host'], required: ['host'],
@ -47,7 +49,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.usersRepository.createQueryBuilder('user'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.usersRepository.createQueryBuilder('user'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('user.host = :host', { host: ps.host }); .andWhere('user.host = :host', { host: ps.host });
const users = await query const users = await query

View file

@ -44,6 +44,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: [], required: [],
} as const; } as const;
@ -58,7 +60,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.flashLikesRepository.createQueryBuilder('like'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.flashLikesRepository.createQueryBuilder('like'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('like.userId = :meId', { meId: me.id }) .andWhere('like.userId = :meId', { meId: me.id })
.leftJoinAndSelect('like.flash', 'flash'); .leftJoinAndSelect('like.flash', 'flash');

View file

@ -34,6 +34,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: [], required: [],
} as const; } as const;
@ -48,7 +50,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.flashsRepository.createQueryBuilder('flash'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.flashsRepository.createQueryBuilder('flash'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('flash.userId = :meId', { meId: me.id }); .andWhere('flash.userId = :meId', { meId: me.id });
const flashs = await query const flashs = await query

View file

@ -49,6 +49,8 @@ export const paramDef = {
properties: { properties: {
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
}, },
required: [], required: [],
@ -64,7 +66,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.followRequestsRepository.createQueryBuilder('request'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.followRequestsRepository.createQueryBuilder('request'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('request.followeeId = :meId', { meId: me.id }); .andWhere('request.followeeId = :meId', { meId: me.id });
const requests = await query const requests = await query

View file

@ -49,6 +49,8 @@ export const paramDef = {
properties: { properties: {
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
}, },
required: [], required: [],
@ -64,7 +66,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.followRequestsRepository.createQueryBuilder('request'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.followRequestsRepository.createQueryBuilder('request'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('request.followerId = :meId', { meId: me.id }); .andWhere('request.followerId = :meId', { meId: me.id });
const requests = await query const requests = await query

View file

@ -30,6 +30,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: [], required: [],
} as const; } as const;
@ -44,7 +46,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.galleryPostsRepository.createQueryBuilder('post'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.galleryPostsRepository.createQueryBuilder('post'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.innerJoinAndSelect('post.user', 'user'); .innerJoinAndSelect('post.user', 'user');
const posts = await query.limit(ps.limit).getMany(); const posts = await query.limit(ps.limit).getMany();

View file

@ -34,6 +34,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: [], required: [],
} as const; } as const;
@ -48,7 +50,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.noteFavoritesRepository.createQueryBuilder('favorite'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.noteFavoritesRepository.createQueryBuilder('favorite'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('favorite.userId = :meId', { meId: me.id }) .andWhere('favorite.userId = :meId', { meId: me.id })
.leftJoinAndSelect('favorite.note', 'note'); .leftJoinAndSelect('favorite.note', 'note');

View file

@ -45,6 +45,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: [], required: [],
} as const; } as const;
@ -59,7 +61,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.galleryLikesRepository.createQueryBuilder('like'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.galleryLikesRepository.createQueryBuilder('like'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('like.userId = :meId', { meId: me.id }) .andWhere('like.userId = :meId', { meId: me.id })
.leftJoinAndSelect('like.post', 'post'); .leftJoinAndSelect('like.post', 'post');

View file

@ -34,6 +34,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: [], required: [],
} as const; } as const;
@ -48,7 +50,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.galleryPostsRepository.createQueryBuilder('post'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.galleryPostsRepository.createQueryBuilder('post'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('post.userId = :meId', { meId: me.id }); .andWhere('post.userId = :meId', { meId: me.id });
const posts = await query const posts = await query

View file

@ -49,6 +49,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
markAsRead: { type: 'boolean', default: true }, markAsRead: { type: 'boolean', default: true },
// 後方互換のため、廃止された通知タイプも受け付ける // 後方互換のため、廃止された通知タイプも受け付ける
includeTypes: { type: 'array', items: { includeTypes: { type: 'array', items: {
@ -64,15 +66,14 @@ export const paramDef = {
@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
constructor( constructor(
@Inject(DI.redis)
private redisClient: Redis.Redis,
private idService: IdService, private idService: IdService,
private notificationEntityService: NotificationEntityService, private notificationEntityService: NotificationEntityService,
private notificationService: NotificationService, private notificationService: NotificationService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const EXTRA_LIMIT = 100; const EXTRA_LIMIT = 100;
const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : undefined);
const sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.gen(ps.sinceDate!) : undefined);
// includeTypes が空の場合はクエリしない // includeTypes が空の場合はクエリしない
if (ps.includeTypes && ps.includeTypes.length === 0) { if (ps.includeTypes && ps.includeTypes.length === 0) {
@ -87,8 +88,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const excludeTypes = ps.excludeTypes && ps.excludeTypes.filter(type => !(obsoleteNotificationTypes).includes(type as any)) as typeof groupedNotificationTypes[number][]; const excludeTypes = ps.excludeTypes && ps.excludeTypes.filter(type => !(obsoleteNotificationTypes).includes(type as any)) as typeof groupedNotificationTypes[number][];
const notifications = await this.notificationService.getNotifications(me.id, { const notifications = await this.notificationService.getNotifications(me.id, {
sinceId: ps.sinceId, sinceId: sinceId,
untilId: ps.untilId, untilId: untilId,
limit: ps.limit, limit: ps.limit,
includeTypes, includeTypes,
excludeTypes, excludeTypes,

View file

@ -44,6 +44,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
markAsRead: { type: 'boolean', default: true }, markAsRead: { type: 'boolean', default: true },
// 後方互換のため、廃止された通知タイプも受け付ける // 後方互換のため、廃止された通知タイプも受け付ける
includeTypes: { type: 'array', items: { includeTypes: { type: 'array', items: {
@ -59,17 +61,14 @@ export const paramDef = {
@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
constructor( constructor(
@Inject(DI.redis)
private redisClient: Redis.Redis,
@Inject(DI.notesRepository)
private notesRepository: NotesRepository,
private idService: IdService, private idService: IdService,
private notificationEntityService: NotificationEntityService, private notificationEntityService: NotificationEntityService,
private notificationService: NotificationService, private notificationService: NotificationService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : undefined);
const sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.gen(ps.sinceDate!) : undefined);
// includeTypes が空の場合はクエリしない // includeTypes が空の場合はクエリしない
if (ps.includeTypes && ps.includeTypes.length === 0) { if (ps.includeTypes && ps.includeTypes.length === 0) {
return []; return [];
@ -83,8 +82,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const excludeTypes = ps.excludeTypes && ps.excludeTypes.filter(type => !(obsoleteNotificationTypes).includes(type as any)) as typeof notificationTypes[number][]; const excludeTypes = ps.excludeTypes && ps.excludeTypes.filter(type => !(obsoleteNotificationTypes).includes(type as any)) as typeof notificationTypes[number][];
const notifications = await this.notificationService.getNotifications(me.id, { const notifications = await this.notificationService.getNotifications(me.id, {
sinceId: ps.sinceId, sinceId: sinceId,
untilId: ps.untilId, untilId: untilId,
limit: ps.limit, limit: ps.limit,
includeTypes, includeTypes,
excludeTypes, excludeTypes,

View file

@ -44,6 +44,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: [], required: [],
} as const; } as const;
@ -58,7 +60,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.pageLikesRepository.createQueryBuilder('like'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.pageLikesRepository.createQueryBuilder('like'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('like.userId = :meId', { meId: me.id }) .andWhere('like.userId = :meId', { meId: me.id })
.leftJoinAndSelect('like.page', 'page'); .leftJoinAndSelect('like.page', 'page');

View file

@ -34,6 +34,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: [], required: [],
} as const; } as const;
@ -48,7 +50,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.pagesRepository.createQueryBuilder('page'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.pagesRepository.createQueryBuilder('page'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('page.userId = :meId', { meId: me.id }); .andWhere('page.userId = :meId', { meId: me.id });
const pages = await query const pages = await query

View file

@ -31,6 +31,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: [], required: [],
} as const; } as const;
@ -45,7 +47,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.signinsRepository.createQueryBuilder('signin'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.signinsRepository.createQueryBuilder('signin'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('signin.userId = :meId', { meId: me.id }); .andWhere('signin.userId = :meId', { meId: me.id });
const history = await query.limit(ps.limit).getMany(); const history = await query.limit(ps.limit).getMany();

View file

@ -34,6 +34,8 @@ export const paramDef = {
limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: [], required: [],
} as const; } as const;
@ -48,7 +50,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.registrationTicketsRepository.createQueryBuilder('ticket'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.registrationTicketsRepository.createQueryBuilder('ticket'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('ticket.createdById = :meId', { meId: me.id }) .andWhere('ticket.createdById = :meId', { meId: me.id })
.leftJoinAndSelect('ticket.createdBy', 'createdBy') .leftJoinAndSelect('ticket.createdBy', 'createdBy')
.leftJoinAndSelect('ticket.usedBy', 'usedBy'); .leftJoinAndSelect('ticket.usedBy', 'usedBy');

View file

@ -34,6 +34,8 @@ export const paramDef = {
limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: [], required: [],
} as const; } as const;
@ -48,7 +50,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.mutingsRepository.createQueryBuilder('muting'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.mutingsRepository.createQueryBuilder('muting'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('muting.muterId = :meId', { meId: me.id }); .andWhere('muting.muterId = :meId', { meId: me.id });
const mutings = await query const mutings = await query

View file

@ -35,6 +35,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: [], required: [],
} as const; } as const;
@ -49,7 +51,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('note.visibility = \'public\'') .andWhere('note.visibility = \'public\'')
.andWhere('note.localOnly = FALSE') .andWhere('note.localOnly = FALSE')
.innerJoinAndSelect('note.user', 'user') .innerJoinAndSelect('note.user', 'user')

View file

@ -34,6 +34,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: ['noteId'], required: ['noteId'],
} as const; } as const;
@ -48,7 +50,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere(new Brackets(qb => { .andWhere(new Brackets(qb => {
qb qb
.where('note.replyId = :noteId', { noteId: ps.noteId }) .where('note.replyId = :noteId', { noteId: ps.noteId })

View file

@ -39,6 +39,8 @@ export const paramDef = {
limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: [], required: [],
} as const; } as const;
@ -53,7 +55,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private noteDraftEntityService: NoteDraftEntityService, private noteDraftEntityService: NoteDraftEntityService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery<MiNoteDraft>(this.noteDraftsRepository.createQueryBuilder('drafts'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery<MiNoteDraft>(this.noteDraftsRepository.createQueryBuilder('drafts'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('drafts.userId = :meId', { meId: me.id }); .andWhere('drafts.userId = :meId', { meId: me.id });
const drafts = await query const drafts = await query

View file

@ -35,6 +35,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
visibility: { type: 'string' }, visibility: { type: 'string' },
}, },
required: [], required: [],
@ -57,7 +59,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
.select('following.followeeId') .select('following.followeeId')
.where('following.followerId = :followerId', { followerId: me.id }); .where('following.followerId = :followerId', { followerId: me.id });
const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere(new Brackets(qb => { .andWhere(new Brackets(qb => {
qb // このmeIdAsListパラメータはqueryServiceのgenerateVisibilityQueryでセットされる qb // このmeIdAsListパラメータはqueryServiceのgenerateVisibilityQueryでセットされる
.where(':meIdAsList <@ note.mentions') .where(':meIdAsList <@ note.mentions')

View file

@ -47,6 +47,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: ['noteId'], required: ['noteId'],
} as const; } as const;
@ -61,7 +63,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.noteReactionsRepository.createQueryBuilder('reaction'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.noteReactionsRepository.createQueryBuilder('reaction'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('reaction.noteId = :noteId', { noteId: ps.noteId }) .andWhere('reaction.noteId = :noteId', { noteId: ps.noteId })
.leftJoinAndSelect('reaction.user', 'user') .leftJoinAndSelect('reaction.user', 'user')
.leftJoinAndSelect('reaction.note', 'note'); .leftJoinAndSelect('reaction.note', 'note');

View file

@ -43,6 +43,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: ['noteId'], required: ['noteId'],
} as const; } as const;
@ -63,7 +65,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw err; throw err;
}); });
const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('note.renoteId = :renoteId', { renoteId: note.id }) .andWhere('note.renoteId = :renoteId', { renoteId: note.id })
.innerJoinAndSelect('note.user', 'user') .innerJoinAndSelect('note.user', 'user')
.leftJoinAndSelect('note.reply', 'reply') .leftJoinAndSelect('note.reply', 'reply')

View file

@ -32,6 +32,8 @@ export const paramDef = {
noteId: { type: 'string', format: 'misskey:id' }, noteId: { type: 'string', format: 'misskey:id' },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
}, },
required: ['noteId'], required: ['noteId'],
@ -47,7 +49,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('note.replyId = :replyId', { replyId: ps.noteId }) .andWhere('note.replyId = :replyId', { replyId: ps.noteId })
.innerJoinAndSelect('note.user', 'user') .innerJoinAndSelect('note.user', 'user')
.leftJoinAndSelect('note.reply', 'reply') .leftJoinAndSelect('note.reply', 'reply')

View file

@ -72,6 +72,8 @@ export const paramDef = {
poll: { type: 'boolean', nullable: true, default: null }, poll: { type: 'boolean', nullable: true, default: null },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
}, },
}, },
@ -88,7 +90,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.innerJoinAndSelect('note.user', 'user') .innerJoinAndSelect('note.user', 'user')
.leftJoinAndSelect('note.reply', 'reply') .leftJoinAndSelect('note.reply', 'reply')
.leftJoinAndSelect('note.renote', 'renote') .leftJoinAndSelect('note.renote', 'renote')

View file

@ -8,6 +8,7 @@ import { Endpoint } from '@/server/api/endpoint-base.js';
import { SearchService } from '@/core/SearchService.js'; import { SearchService } from '@/core/SearchService.js';
import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
import { RoleService } from '@/core/RoleService.js'; import { RoleService } from '@/core/RoleService.js';
import { IdService } from '@/core/IdService.js';
import { ApiError } from '../../error.js'; import { ApiError } from '../../error.js';
export const meta = { export const meta = {
@ -40,6 +41,8 @@ export const paramDef = {
query: { type: 'string' }, query: { type: 'string' },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
offset: { type: 'integer', default: 0 }, offset: { type: 'integer', default: 0 },
host: { host: {
@ -60,8 +63,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private noteEntityService: NoteEntityService, private noteEntityService: NoteEntityService,
private searchService: SearchService, private searchService: SearchService,
private roleService: RoleService, private roleService: RoleService,
private idService: IdService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : undefined);
const sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.gen(ps.sinceDate!) : undefined);
const policies = await this.roleService.getUserPolicies(me ? me.id : null); const policies = await this.roleService.getUserPolicies(me ? me.id : null);
if (!policies.canSearchNotes) { if (!policies.canSearchNotes) {
throw new ApiError(meta.errors.unavailable); throw new ApiError(meta.errors.unavailable);
@ -72,8 +79,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
channelId: ps.channelId, channelId: ps.channelId,
host: ps.host, host: ps.host,
}, { }, {
untilId: ps.untilId, untilId: untilId,
sinceId: ps.sinceId, sinceId: sinceId,
limit: ps.limit, limit: ps.limit,
}); });

View file

@ -34,6 +34,8 @@ export const paramDef = {
limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: [], required: [],
} as const; } as const;
@ -48,7 +50,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.renoteMutingsRepository.createQueryBuilder('muting'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.renoteMutingsRepository.createQueryBuilder('muting'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('muting.muterId = :meId', { meId: me.id }); .andWhere('muting.muterId = :meId', { meId: me.id });
const mutings = await query const mutings = await query

View file

@ -27,6 +27,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
my: { type: 'boolean', default: false }, my: { type: 'boolean', default: false },
}, },
required: [], required: [],
@ -42,7 +44,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.reversiGamesRepository.createQueryBuilder('game'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.reversiGamesRepository.createQueryBuilder('game'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.innerJoinAndSelect('game.user1', 'user1') .innerJoinAndSelect('game.user1', 'user1')
.innerJoinAndSelect('game.user2', 'user2'); .innerJoinAndSelect('game.user2', 'user2');

View file

@ -51,6 +51,8 @@ export const paramDef = {
roleId: { type: 'string', format: 'misskey:id' }, roleId: { type: 'string', format: 'misskey:id' },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
}, },
required: ['roleId'], required: ['roleId'],
@ -79,7 +81,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw new ApiError(meta.errors.noSuchRole); throw new ApiError(meta.errors.noSuchRole);
} }
const query = this.queryService.makePaginationQuery(this.roleAssignmentsRepository.createQueryBuilder('assign'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.roleAssignmentsRepository.createQueryBuilder('assign'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('assign.roleId = :roleId', { roleId: role.id }) .andWhere('assign.roleId = :roleId', { roleId: role.id })
.andWhere(new Brackets(qb => { .andWhere(new Brackets(qb => {
qb qb

View file

@ -33,6 +33,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: ['userId'], required: ['userId'],
} as const; } as const;
@ -47,7 +49,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.clipsRepository.createQueryBuilder('clip'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.clipsRepository.createQueryBuilder('clip'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('clip.userId = :userId', { userId: ps.userId }) .andWhere('clip.userId = :userId', { userId: ps.userId })
.andWhere('clip.isPublic = true'); .andWhere('clip.isPublic = true');

View file

@ -33,11 +33,12 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: ['userId'], required: ['userId'],
} as const; } as const;
// eslint-disable-next-line import/no-default-export
@Injectable() @Injectable()
export default class extends Endpoint<typeof meta, typeof paramDef> { export default class extends Endpoint<typeof meta, typeof paramDef> {
constructor( constructor(
@ -48,7 +49,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.flashsRepository.createQueryBuilder('flash'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.flashsRepository.createQueryBuilder('flash'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('flash.userId = :userId', { userId: ps.userId }) .andWhere('flash.userId = :userId', { userId: ps.userId })
.andWhere('flash.visibility = \'public\''); .andWhere('flash.visibility = \'public\'');

View file

@ -76,6 +76,8 @@ export const paramDef = {
properties: { properties: {
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
}, },
}, },
@ -132,7 +134,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
} }
} }
const query = this.queryService.makePaginationQuery(this.followingsRepository.createQueryBuilder('following'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.followingsRepository.createQueryBuilder('following'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('following.followeeId = :userId', { userId: user.id }) .andWhere('following.followeeId = :userId', { userId: user.id })
.innerJoinAndSelect('following.follower', 'follower'); .innerJoinAndSelect('following.follower', 'follower');

View file

@ -83,6 +83,8 @@ export const paramDef = {
properties: { properties: {
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
birthday: { ...birthdaySchema, nullable: true }, birthday: { ...birthdaySchema, nullable: true },
}, },
@ -140,7 +142,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
} }
} }
const query = this.queryService.makePaginationQuery(this.followingsRepository.createQueryBuilder('following'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.followingsRepository.createQueryBuilder('following'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('following.followerId = :userId', { userId: user.id }) .andWhere('following.followerId = :userId', { userId: user.id })
.innerJoinAndSelect('following.followee', 'followee'); .innerJoinAndSelect('following.followee', 'followee');

View file

@ -33,6 +33,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: ['userId'], required: ['userId'],
} as const; } as const;
@ -47,7 +49,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.galleryPostsRepository.createQueryBuilder('post'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.galleryPostsRepository.createQueryBuilder('post'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('post.userId = :userId', { userId: ps.userId }); .andWhere('post.userId = :userId', { userId: ps.userId });
const posts = await query const posts = await query

View file

@ -64,6 +64,8 @@ export const paramDef = {
limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: ['listId'], required: ['listId'],
} as const; } as const;
@ -94,7 +96,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
throw new ApiError(meta.errors.noSuchList); throw new ApiError(meta.errors.noSuchList);
} }
const query = this.queryService.makePaginationQuery(this.userListMembershipsRepository.createQueryBuilder('membership'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.userListMembershipsRepository.createQueryBuilder('membership'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('membership.userListId = :userListId', { userListId: userList.id }) .andWhere('membership.userListId = :userListId', { userListId: userList.id })
.innerJoinAndSelect('membership.user', 'user'); .innerJoinAndSelect('membership.user', 'user');

View file

@ -33,6 +33,8 @@ 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' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
}, },
required: ['userId'], required: ['userId'],
} as const; } as const;
@ -47,7 +49,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService, private queryService: QueryService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.pagesRepository.createQueryBuilder('page'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.pagesRepository.createQueryBuilder('page'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('page.userId = :userId', { userId: ps.userId }) .andWhere('page.userId = :userId', { userId: ps.userId })
.andWhere('page.visibility = \'public\''); .andWhere('page.visibility = \'public\'');

View file

@ -7,6 +7,7 @@ import { Injectable } from '@nestjs/common';
import { Endpoint } from '@/server/api/endpoint-base.js'; import { Endpoint } from '@/server/api/endpoint-base.js';
import { EmojiEntityService } from '@/core/entities/EmojiEntityService.js'; import { EmojiEntityService } from '@/core/entities/EmojiEntityService.js';
import { CustomEmojiService, fetchEmojisHostTypes, fetchEmojisSortKeys } from '@/core/CustomEmojiService.js'; import { CustomEmojiService, fetchEmojisHostTypes, fetchEmojisSortKeys } from '@/core/CustomEmojiService.js';
import { IdService } from '@/core/IdService.js';
export const meta = { export const meta = {
tags: ['admin'], tags: ['admin'],
@ -65,6 +66,8 @@ export const paramDef = {
}, },
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
sinceDate: { type: 'integer' },
untilDate: { type: 'integer' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
page: { type: 'integer' }, page: { type: 'integer' },
sortKeys: { sortKeys: {
@ -84,8 +87,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
constructor( constructor(
private customEmojiService: CustomEmojiService, private customEmojiService: CustomEmojiService,
private emojiEntityService: EmojiEntityService, private emojiEntityService: EmojiEntityService,
private idService: IdService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : undefined);
const sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.gen(ps.sinceDate!) : undefined);
const q = ps.query; const q = ps.query;
const result = await this.customEmojiService.fetchEmojis( const result = await this.customEmojiService.fetchEmojis(
{ {
@ -105,8 +112,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
hostType: q?.hostType, hostType: q?.hostType,
roleIds: q?.roleIds, roleIds: q?.roleIds,
}, },
sinceId: ps.sinceId, sinceId: sinceId,
untilId: ps.untilId, untilId: untilId,
}, },
{ {
limit: ps.limit, limit: ps.limit,

View file

@ -153,6 +153,9 @@ export default [
autofix: true, autofix: true,
}], }],
'vue/attribute-hyphenation': ['error', 'never'], 'vue/attribute-hyphenation': ['error', 'never'],
'vue/no-mutating-props': ['error', {
shallowOnly: true,
}],
}, },
}, },
]; ];

View file

@ -7,7 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<button <button
v-if="!link" v-if="!link"
ref="el" class="_button" ref="el" class="_button"
:class="[$style.root, { [$style.inline]: inline, [$style.primary]: primary, [$style.gradate]: gradate, [$style.danger]: danger, [$style.rounded]: rounded, [$style.full]: full, [$style.small]: small, [$style.large]: large, [$style.transparent]: transparent, [$style.asLike]: asLike, [$style.iconOnly]: iconOnly, [$style.wait]: wait }]" :class="[$style.root, { [$style.inline]: inline, [$style.primary]: primary, [$style.gradate]: gradate, [$style.danger]: danger, [$style.rounded]: rounded, [$style.full]: full, [$style.small]: small, [$style.large]: large, [$style.transparent]: transparent, [$style.asLike]: asLike, [$style.iconOnly]: iconOnly, [$style.wait]: wait, [$style.active]: active }]"
:type="type" :type="type"
:name="name" :name="name"
:value="value" :value="value"
@ -22,7 +22,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</button> </button>
<MkA <MkA
v-else class="_button" v-else class="_button"
:class="[$style.root, { [$style.inline]: inline, [$style.primary]: primary, [$style.gradate]: gradate, [$style.danger]: danger, [$style.rounded]: rounded, [$style.full]: full, [$style.small]: small, [$style.large]: large, [$style.transparent]: transparent, [$style.asLike]: asLike, [$style.iconOnly]: iconOnly, [$style.wait]: wait }]" :class="[$style.root, { [$style.inline]: inline, [$style.primary]: primary, [$style.gradate]: gradate, [$style.danger]: danger, [$style.rounded]: rounded, [$style.full]: full, [$style.small]: small, [$style.large]: large, [$style.transparent]: transparent, [$style.asLike]: asLike, [$style.iconOnly]: iconOnly, [$style.wait]: wait, [$style.active]: active }]"
:to="to ?? '#'" :to="to ?? '#'"
:behavior="linkBehavior" :behavior="linkBehavior"
@mousedown="onMousedown" @mousedown="onMousedown"
@ -58,6 +58,7 @@ const props = defineProps<{
value?: string; value?: string;
disabled?: boolean; disabled?: boolean;
iconOnly?: boolean; iconOnly?: boolean;
active?: boolean;
}>(); }>();
const emit = defineEmits<{ const emit = defineEmits<{
@ -252,6 +253,10 @@ function onMousedown(evt: MouseEvent): void {
} }
} }
&.active {
color: var(--MI_THEME-accent) !important;
}
&:disabled { &:disabled {
opacity: 0.5; opacity: 0.5;
} }

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
--> -->
<template> <template>
<MkPagination :pagination="pagination"> <MkPagination :paginator="paginator">
<template #empty><MkResult type="empty"/></template> <template #empty><MkResult type="empty"/></template>
<template #default="{ items }"> <template #default="{ items }">
@ -14,13 +14,13 @@ SPDX-License-Identifier: AGPL-3.0-only
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import type { PagingCtx } from '@/composables/use-pagination.js'; import type { Paginator } from '@/utility/paginator.js';
import MkChannelPreview from '@/components/MkChannelPreview.vue'; import MkChannelPreview from '@/components/MkChannelPreview.vue';
import MkPagination from '@/components/MkPagination.vue'; import MkPagination from '@/components/MkPagination.vue';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
pagination: PagingCtx; paginator: Paginator;
noGap?: boolean; noGap?: boolean;
extractor?: (item: any) => any; extractor?: (item: any) => any;
}>(), { }>(), {

View file

@ -130,7 +130,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { nextTick, onActivated, onBeforeUnmount, onMounted, ref, useTemplateRef, watch, computed, TransitionGroup } from 'vue'; import { nextTick, onActivated, onBeforeUnmount, onMounted, ref, useTemplateRef, watch, computed, TransitionGroup, markRaw } from 'vue';
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import MkButton from './MkButton.vue'; import MkButton from './MkButton.vue';
import type { MenuItem } from '@/types/menu.js'; import type { MenuItem } from '@/types/menu.js';
@ -146,10 +146,10 @@ import { prefer } from '@/preferences.js';
import { chooseFileFromPcAndUpload, selectDriveFolder } from '@/utility/drive.js'; import { chooseFileFromPcAndUpload, selectDriveFolder } from '@/utility/drive.js';
import { store } from '@/store.js'; import { store } from '@/store.js';
import { isSeparatorNeeded, getSeparatorInfo, makeDateGroupedTimelineComputedRef } from '@/utility/timeline-date-separate.js'; import { isSeparatorNeeded, getSeparatorInfo, makeDateGroupedTimelineComputedRef } from '@/utility/timeline-date-separate.js';
import { usePagination } from '@/composables/use-pagination.js';
import { globalEvents, useGlobalEvent } from '@/events.js'; import { globalEvents, useGlobalEvent } from '@/events.js';
import { checkDragDataType, getDragData, setDragData } from '@/drag-and-drop.js'; import { checkDragDataType, getDragData, setDragData } from '@/drag-and-drop.js';
import { getDriveFileMenu } from '@/utility/get-drive-file-menu.js'; import { getDriveFileMenu } from '@/utility/get-drive-file-menu.js';
import { Paginator } from '@/utility/paginator.js';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
initialFolder?: Misskey.entities.DriveFolder['id'] | null; initialFolder?: Misskey.entities.DriveFolder['id'] | null;
@ -195,33 +195,23 @@ const fetching = ref(true);
const sortModeSelect = ref<NonNullable<Misskey.entities.DriveFilesRequest['sort']>>('+createdAt'); const sortModeSelect = ref<NonNullable<Misskey.entities.DriveFilesRequest['sort']>>('+createdAt');
const filesPaginator = usePagination({ const filesPaginator = markRaw(new Paginator('drive/files', {
ctx: { limit: 30,
endpoint: 'drive/files', canFetchDetection: 'limit',
limit: 30, params: () => ({ // computedParams使
canFetchDetection: 'limit', folderId: folder.value ? folder.value.id : null,
params: computed(() => ({ type: props.type,
folderId: folder.value ? folder.value.id : null, sort: sortModeSelect.value,
type: props.type, }),
sort: sortModeSelect.value, }));
})),
},
autoInit: false,
autoReInit: false,
});
const foldersPaginator = usePagination({ const foldersPaginator = markRaw(new Paginator('drive/folders', {
ctx: { limit: 30,
endpoint: 'drive/folders', canFetchDetection: 'limit',
limit: 30, params: () => ({ // computedParams使
canFetchDetection: 'limit', folderId: folder.value ? folder.value.id : null,
params: computed(() => ({ }),
folderId: folder.value ? folder.value.id : null, }));
})),
},
autoInit: false,
autoReInit: false,
});
const filesTimeline = makeDateGroupedTimelineComputedRef(filesPaginator.items, 'month'); const filesTimeline = makeDateGroupedTimelineComputedRef(filesPaginator.items, 'month');

View file

@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template> <template>
<div> <div>
<MkPagination v-slot="{ items }" :pagination="pagination"> <MkPagination v-slot="{ items }" :paginator="paginator">
<div :class="[$style.fileList, { [$style.grid]: viewMode === 'grid', [$style.list]: viewMode === 'list', '_gaps_s': viewMode === 'list' }]"> <div :class="[$style.fileList, { [$style.grid]: viewMode === 'grid', [$style.list]: viewMode === 'list', '_gaps_s': viewMode === 'list' }]">
<MkA <MkA
v-for="file in items" v-for="file in items"
@ -40,15 +40,15 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup> <script lang="ts" setup>
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import type { Paginator } from '@/utility/paginator.js';
import MkPagination from '@/components/MkPagination.vue'; import MkPagination from '@/components/MkPagination.vue';
import MkDriveFileThumbnail from '@/components/MkDriveFileThumbnail.vue'; import MkDriveFileThumbnail from '@/components/MkDriveFileThumbnail.vue';
import bytes from '@/filters/bytes.js'; import bytes from '@/filters/bytes.js';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import { dateString } from '@/filters/date.js'; import { dateString } from '@/filters/date.js';
import type { PagingCtx } from '@/composables/use-pagination.js';
defineProps<{ defineProps<{
pagination: PagingCtx<'admin/drive/files'>; paginator: Paginator<'admin/drive/files'>;
viewMode: 'grid' | 'list'; viewMode: 'grid' | 'list';
}>(); }>();
</script> </script>

View file

@ -187,7 +187,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkNoteSub v-for="note in replies" :key="note.id" :note="note" :class="$style.reply" :detail="true"/> <MkNoteSub v-for="note in replies" :key="note.id" :note="note" :class="$style.reply" :detail="true"/>
</div> </div>
<div v-else-if="tab === 'renotes'" :class="$style.tab_renotes"> <div v-else-if="tab === 'renotes'" :class="$style.tab_renotes">
<MkPagination :pagination="renotesPagination" :disableAutoLoad="true"> <MkPagination :paginator="renotesPaginator">
<template #default="{ items }"> <template #default="{ items }">
<div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); grid-gap: 12px;"> <div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); grid-gap: 12px;">
<MkA v-for="item in items" :key="item.id" :to="userPage(item.user)"> <MkA v-for="item in items" :key="item.id" :to="userPage(item.user)">
@ -204,7 +204,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<span style="margin-left: 4px;">{{ $appearNote.reactions[reaction] }}</span> <span style="margin-left: 4px;">{{ $appearNote.reactions[reaction] }}</span>
</button> </button>
</div> </div>
<MkPagination v-if="reactionTabType" :key="reactionTabType" :pagination="reactionsPagination" :disableAutoLoad="true"> <MkPagination v-if="reactionTabType" :key="reactionTabType" :paginator="reactionsPaginator">
<template #default="{ items }"> <template #default="{ items }">
<div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); grid-gap: 12px;"> <div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); grid-gap: 12px;">
<MkA v-for="item in items" :key="item.id" :to="userPage(item.user)"> <MkA v-for="item in items" :key="item.id" :to="userPage(item.user)">
@ -228,7 +228,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, inject, onMounted, provide, ref, useTemplateRef } from 'vue'; import { computed, inject, markRaw, onMounted, provide, ref, useTemplateRef } from 'vue';
import * as mfm from 'mfm-js'; import * as mfm from 'mfm-js';
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import { isLink } from '@@/js/is-link.js'; import { isLink } from '@@/js/is-link.js';
@ -274,6 +274,7 @@ import { prefer } from '@/preferences.js';
import { getPluginHandlers } from '@/plugin.js'; import { getPluginHandlers } from '@/plugin.js';
import { DI } from '@/di.js'; import { DI } from '@/di.js';
import { globalEvents, useGlobalEvent } from '@/events.js'; import { globalEvents, useGlobalEvent } from '@/events.js';
import { Paginator } from '@/utility/paginator.js';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
note: Misskey.entities.Note; note: Misskey.entities.Note;
@ -376,21 +377,19 @@ provide(DI.mfmEmojiReactCallback, (reaction) => {
const tab = ref(props.initialTab); const tab = ref(props.initialTab);
const reactionTabType = ref<string | null>(null); const reactionTabType = ref<string | null>(null);
const renotesPagination = computed(() => ({ const renotesPaginator = markRaw(new Paginator('notes/renotes', {
endpoint: 'notes/renotes',
limit: 10, limit: 10,
params: { params: {
noteId: appearNote.id, noteId: appearNote.id,
}, },
})); }));
const reactionsPagination = computed(() => ({ const reactionsPaginator = markRaw(new Paginator('notes/reactions', {
endpoint: 'notes/reactions',
limit: 10, limit: 10,
params: { computedParams: computed(() => ({
noteId: appearNote.id, noteId: appearNote.id,
type: reactionTabType.value, type: reactionTabType.value,
}, })),
})); }));
useTooltip(renoteButton, async (showing) => { useTooltip(renoteButton, async (showing) => {

View file

@ -18,7 +18,7 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.drafts }} ({{ currentDraftsCount }}/{{ $i?.policies.noteDraftLimit }}) {{ i18n.ts.drafts }} ({{ currentDraftsCount }}/{{ $i?.policies.noteDraftLimit }})
</template> </template>
<div class="_spacer"> <div class="_spacer">
<MkPagination ref="pagingEl" :pagination="paging" withControl> <MkPagination :paginator="paginator" withControl>
<template #empty> <template #empty>
<MkResult type="empty" :text="i18n.ts._drafts.noDrafts"/> <MkResult type="empty" :text="i18n.ts._drafts.noDrafts"/>
</template> </template>
@ -100,9 +100,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, shallowRef, useTemplateRef } from 'vue'; import { ref, shallowRef, markRaw } from 'vue';
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import type { PagingCtx } from '@/composables/use-pagination.js';
import MkButton from '@/components/MkButton.vue'; import MkButton from '@/components/MkButton.vue';
import MkPagination from '@/components/MkPagination.vue'; import MkPagination from '@/components/MkPagination.vue';
import MkModalWindow from '@/components/MkModalWindow.vue'; import MkModalWindow from '@/components/MkModalWindow.vue';
@ -111,6 +110,7 @@ import { i18n } from '@/i18n.js';
import * as os from '@/os.js'; import * as os from '@/os.js';
import { $i } from '@/i.js'; import { $i } from '@/i.js';
import { misskeyApi } from '@/utility/misskey-api'; import { misskeyApi } from '@/utility/misskey-api';
import { Paginator } from '@/utility/paginator.js';
const emit = defineEmits<{ const emit = defineEmits<{
(ev: 'restore', draft: Misskey.entities.NoteDraft): void; (ev: 'restore', draft: Misskey.entities.NoteDraft): void;
@ -118,12 +118,9 @@ const emit = defineEmits<{
(ev: 'closed'): void; (ev: 'closed'): void;
}>(); }>();
const paging = { const paginator = markRaw(new Paginator('notes/drafts/list', {
endpoint: 'notes/drafts/list',
limit: 10, limit: 10,
} satisfies PagingCtx; }));
const pagingComponent = useTemplateRef('pagingEl');
const currentDraftsCount = ref(0); const currentDraftsCount = ref(0);
misskeyApi('notes/drafts/count').then((count) => { misskeyApi('notes/drafts/count').then((count) => {
@ -151,7 +148,7 @@ async function deleteDraft(draft: Misskey.entities.NoteDraft) {
if (canceled) return; if (canceled) return;
os.apiWithDialog('notes/drafts/delete', { draftId: draft.id }).then(() => { os.apiWithDialog('notes/drafts/delete', { draftId: draft.id }).then(() => {
pagingComponent.value?.paginator.reload(); paginator.reload();
}); });
} }
</script> </script>

View file

@ -4,17 +4,17 @@ SPDX-License-Identifier: AGPL-3.0-only
--> -->
<template> <template>
<MkPagination ref="pagingComponent" :pagination="pagination" :disableAutoLoad="disableAutoLoad" :pullToRefresh="pullToRefresh" :withControl="withControl"> <MkPagination :paginator="paginator" :autoLoad="autoLoad" :pullToRefresh="pullToRefresh" :withControl="withControl">
<template #empty><MkResult type="empty" :text="i18n.ts.noNotes"/></template> <template #empty><MkResult type="empty" :text="i18n.ts.noNotes"/></template>
<template #default="{ items: notes }"> <template #default="{ items: notes }">
<div :class="[$style.root, { [$style.noGap]: noGap, '_gaps': !noGap }]"> <div :class="[$style.root, { [$style.noGap]: noGap, '_gaps': !noGap }]">
<template v-for="(note, i) in notes" :key="note.id"> <template v-for="(note, i) in notes" :key="note.id">
<div v-if="i > 0 && isSeparatorNeeded(pagingComponent.paginator.items.value[i -1].createdAt, note.createdAt)" :data-scroll-anchor="note.id"> <div v-if="i > 0 && isSeparatorNeeded(paginator.items.value[i -1].createdAt, note.createdAt)" :data-scroll-anchor="note.id">
<div :class="$style.date"> <div :class="$style.date">
<span><i class="ti ti-chevron-up"></i> {{ getSeparatorInfo(pagingComponent.paginator.items.value[i -1].createdAt, note.createdAt).prevText }}</span> <span><i class="ti ti-chevron-up"></i> {{ getSeparatorInfo(paginator.items.value[i -1].createdAt, note.createdAt).prevText }}</span>
<span style="height: 1em; width: 1px; background: var(--MI_THEME-divider);"></span> <span style="height: 1em; width: 1px; background: var(--MI_THEME-divider);"></span>
<span>{{ getSeparatorInfo(pagingComponent.paginator.items.value[i -1].createdAt, note.createdAt).nextText }} <i class="ti ti-chevron-down"></i></span> <span>{{ getSeparatorInfo(paginator.items.value[i -1].createdAt, note.createdAt).nextText }} <i class="ti ti-chevron-down"></i></span>
</div> </div>
<MkNote :class="$style.note" :note="note" :withHardMute="true"/> <MkNote :class="$style.note" :note="note" :withHardMute="true"/>
</div> </div>
@ -31,9 +31,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkPagination> </MkPagination>
</template> </template>
<script lang="ts" setup generic="T extends PagingCtx"> <script lang="ts" setup generic="T extends Paginator">
import { useTemplateRef } from 'vue'; import type { Paginator } from '@/utility/paginator.js';
import type { PagingCtx } from '@/composables/use-pagination.js';
import MkNote from '@/components/MkNote.vue'; import MkNote from '@/components/MkNote.vue';
import MkPagination from '@/components/MkPagination.vue'; import MkPagination from '@/components/MkPagination.vue';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
@ -41,24 +40,23 @@ import { globalEvents, useGlobalEvent } from '@/events.js';
import { isSeparatorNeeded, getSeparatorInfo } from '@/utility/timeline-date-separate.js'; import { isSeparatorNeeded, getSeparatorInfo } from '@/utility/timeline-date-separate.js';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
pagination: T; paginator: T;
noGap?: boolean; noGap?: boolean;
disableAutoLoad?: boolean; autoLoad?: boolean;
pullToRefresh?: boolean; pullToRefresh?: boolean;
withControl?: boolean; withControl?: boolean;
}>(), { }>(), {
autoLoad: true,
pullToRefresh: true, pullToRefresh: true,
withControl: true, withControl: true,
}); });
const pagingComponent = useTemplateRef('pagingComponent');
useGlobalEvent('noteDeleted', (noteId) => { useGlobalEvent('noteDeleted', (noteId) => {
pagingComponent.value?.paginator.removeItem(noteId); props.paginator.removeItem(noteId);
}); });
function reload() { function reload() {
return pagingComponent.value?.paginator.reload(); return props.paginator.reload();
} }
defineExpose({ defineExpose({

View file

@ -6,11 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template> <template>
<component :is="prefer.s.enablePullToRefresh && pullToRefresh ? MkPullToRefresh : 'div'" :refresher="() => paginator.reload()" @contextmenu.prevent.stop="onContextmenu"> <component :is="prefer.s.enablePullToRefresh && pullToRefresh ? MkPullToRefresh : 'div'" :refresher="() => paginator.reload()" @contextmenu.prevent.stop="onContextmenu">
<div> <div>
<div v-if="props.withControl" :class="$style.control"> <MkPaginationControl v-if="props.withControl" :paginator="paginator" style="margin-bottom: 10px"/>
<MkSelect v-model="order" :class="$style.order" :items="[{ label: i18n.ts._order.newest, value: 'newest' }, { label: i18n.ts._order.oldest, value: 'oldest' }]">
</MkSelect>
<MkButton iconOnly @click="paginator.reload()"><i class="ti ti-refresh"></i></MkButton>
</div>
<!-- :css="prefer.s.animation" にしたいけどバグる(おそらくvueのバグ) https://github.com/misskey-dev/misskey/issues/16078 --> <!-- :css="prefer.s.animation" にしたいけどバグる(おそらくvueのバグ) https://github.com/misskey-dev/misskey/issues/16078 -->
<Transition <Transition
@ -30,14 +26,14 @@ SPDX-License-Identifier: AGPL-3.0-only
<div v-else key="_root_" class="_gaps"> <div v-else key="_root_" class="_gaps">
<slot :items="paginator.items.value" :fetching="paginator.fetching.value || paginator.fetchingOlder.value"></slot> <slot :items="paginator.items.value" :fetching="paginator.fetching.value || paginator.fetchingOlder.value"></slot>
<div v-if="order === 'oldest'"> <div v-if="paginator.order.value === 'oldest'">
<MkButton v-if="!paginator.fetchingNewer.value" :class="$style.more" :wait="paginator.fetchingNewer.value" primary rounded @click="paginator.fetchNewer"> <MkButton v-if="!paginator.fetchingNewer.value" :class="$style.more" :wait="paginator.fetchingNewer.value" primary rounded @click="paginator.fetchNewer()">
{{ i18n.ts.loadMore }} {{ i18n.ts.loadMore }}
</MkButton> </MkButton>
<MkLoading v-else/> <MkLoading v-else/>
</div> </div>
<div v-else v-show="paginator.canFetchOlder.value"> <div v-else v-show="paginator.canFetchOlder.value">
<MkButton v-if="!paginator.fetchingOlder.value" :class="$style.more" :wait="paginator.fetchingOlder.value" primary rounded @click="paginator.fetchOlder"> <MkButton v-if="!paginator.fetchingOlder.value" :class="$style.more" :wait="paginator.fetchingOlder.value" primary rounded @click="paginator.fetchOlder()">
{{ i18n.ts.loadMore }} {{ i18n.ts.loadMore }}
</MkButton> </MkButton>
<MkLoading v-else/> <MkLoading v-else/>
@ -48,47 +44,29 @@ SPDX-License-Identifier: AGPL-3.0-only
</component> </component>
</template> </template>
<script lang="ts" setup generic="T extends PagingCtx"> <script lang="ts" setup generic="T extends Paginator, I = UnwrapRef<T['items']>">
import { isLink } from '@@/js/is-link.js'; import { isLink } from '@@/js/is-link.js';
import { ref, watch } from 'vue'; import { onMounted, watch } from 'vue';
import type { UnwrapRef } from 'vue'; import type { UnwrapRef } from 'vue';
import type { PagingCtx } from '@/composables/use-pagination.js'; import type { Paginator } from '@/utility/paginator.js';
import MkButton from '@/components/MkButton.vue'; import MkButton from '@/components/MkButton.vue';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import { prefer } from '@/preferences.js'; import { prefer } from '@/preferences.js';
import { usePagination } from '@/composables/use-pagination.js';
import MkPullToRefresh from '@/components/MkPullToRefresh.vue'; import MkPullToRefresh from '@/components/MkPullToRefresh.vue';
import MkSelect from '@/components/MkSelect.vue'; import MkPaginationControl from '@/components/MkPaginationControl.vue';
import * as os from '@/os.js'; import * as os from '@/os.js';
type Paginator = ReturnType<typeof usePagination<T['endpoint']>>;
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
pagination: T; paginator: T;
disableAutoLoad?: boolean; autoLoad?: boolean;
displayLimit?: number;
pullToRefresh?: boolean; pullToRefresh?: boolean;
withControl?: boolean; withControl?: boolean;
}>(), { }>(), {
displayLimit: 20, autoLoad: true,
pullToRefresh: true, pullToRefresh: true,
withControl: false, withControl: false,
}); });
const order = ref<'newest' | 'oldest'>(props.pagination.order ?? 'newest');
const paginator: Paginator = usePagination({
ctx: props.pagination,
});
watch(order, (newOrder) => {
paginator.updateCtx({
...props.pagination,
order: newOrder,
initialDirection: newOrder === 'oldest' ? 'newer' : 'older',
});
}, { immediate: false });
function onContextmenu(ev: MouseEvent) { function onContextmenu(ev: MouseEvent) {
if (ev.target && isLink(ev.target as HTMLElement)) return; if (ev.target && isLink(ev.target as HTMLElement)) return;
if (window.getSelection()?.toString() !== '') return; if (window.getSelection()?.toString() !== '') return;
@ -98,19 +76,27 @@ function onContextmenu(ev: MouseEvent) {
icon: 'ti ti-refresh', icon: 'ti ti-refresh',
text: i18n.ts.reload, text: i18n.ts.reload,
action: () => { action: () => {
paginator.reload(); props.paginator.reload();
}, },
}], ev); }], ev);
} }
if (props.autoLoad) {
onMounted(() => {
props.paginator.init();
});
}
if (props.paginator.computedParams) {
watch(props.paginator.computedParams, () => {
props.paginator.reload();
}, { immediate: false, deep: true });
}
defineSlots<{ defineSlots<{
empty: () => void; empty: () => void;
default: (props: { items: UnwrapRef<Paginator['items']> }) => void; default: (props: { items: I }) => void;
}>(); }>();
defineExpose({
paginator: paginator,
});
</script> </script>
<style lang="scss" module> <style lang="scss" module>
@ -123,17 +109,6 @@ defineExpose({
opacity: 0; opacity: 0;
} }
.control {
display: flex;
align-items: center;
margin-bottom: 10px;
}
.order {
flex: 1;
margin-right: 8px;
}
.more { .more {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;

View file

@ -0,0 +1,100 @@
<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<div :class="$style.root">
<div :class="$style.control">
<MkSelect v-model="order" :class="$style.order" :items="[{ label: i18n.ts._order.newest, value: 'newest' }, { label: i18n.ts._order.oldest, value: 'oldest' }]">
<template #prefix><i class="ti ti-arrows-sort"></i></template>
</MkSelect>
<MkButton v-if="paginator.canSearch" v-tooltip="i18n.ts.search" iconOnly transparent rounded :active="searchOpened" @click="searchOpened = !searchOpened"><i class="ti ti-search"></i></MkButton>
<MkButton v-if="canFilter" v-tooltip="i18n.ts.filter" iconOnly transparent rounded :active="filterOpened" @click="filterOpened = !filterOpened"><i class="ti ti-filter"></i></MkButton>
<MkButton v-tooltip="i18n.ts.dateAndTime" iconOnly transparent rounded :active="date != null" @click="date = date == null ? Date.now() : null"><i class="ti ti-calendar-clock"></i></MkButton>
<MkButton v-tooltip="i18n.ts.reload" iconOnly transparent rounded @click="paginator.reload()"><i class="ti ti-refresh"></i></MkButton>
</div>
<MkInput
v-if="searchOpened"
v-model="q"
type="search"
debounce
>
<template #label>{{ i18n.ts.search }}</template>
<template #prefix><i class="ti ti-search"></i></template>
</MkInput>
<MkInput
v-if="date != null"
type="date"
:modelValue="formatDateTimeString(new Date(date), 'yyyy-MM-dd')"
@update:modelValue="date = new Date($event).getTime()"
>
</MkInput>
<slot v-if="filterOpened"></slot>
</div>
</template>
<script lang="ts" setup generic="T extends Paginator">
import { ref, watch } from 'vue';
import type { Paginator } from '@/utility/paginator.js';
import MkButton from '@/components/MkButton.vue';
import { i18n } from '@/i18n.js';
import MkSelect from '@/components/MkSelect.vue';
import MkInput from '@/components/MkInput.vue';
import { formatDateTimeString } from '@/utility/format-time-string.js';
const props = withDefaults(defineProps<{
paginator: T;
canFilter?: boolean;
filterOpened?: boolean;
}>(), {
canFilter: false,
filterOpened: false,
});
const searchOpened = ref(false);
const filterOpened = ref(props.filterOpened);
const order = ref<'newest' | 'oldest'>('newest');
const date = ref<number | null>(null);
const q = ref<string | null>(null);
watch(order, () => {
props.paginator.order.value = order.value;
props.paginator.initialDirection = order.value === 'oldest' ? 'newer' : 'older';
props.paginator.reload();
});
watch(date, () => {
props.paginator.initialDate = date.value;
props.paginator.reload();
});
watch(q, () => {
props.paginator.searchQuery.value = q.value;
props.paginator.reload();
});
</script>
<style lang="scss" module>
.root {
display: flex;
flex-direction: column;
gap: 8px;
margin-bottom: 10px;
}
.control {
display: flex;
align-items: center;
gap: 4px;
}
.order {
flex: 1;
margin-right: 6px;
}
</style>

View file

@ -56,14 +56,12 @@ SPDX-License-Identifier: AGPL-3.0-only
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, watch, onUnmounted, provide, useTemplateRef, TransitionGroup, onMounted, shallowRef, ref } from 'vue'; import { computed, watch, onUnmounted, provide, useTemplateRef, TransitionGroup, onMounted, shallowRef, ref, markRaw } from 'vue';
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import { useInterval } from '@@/js/use-interval.js'; import { useInterval } from '@@/js/use-interval.js';
import { getScrollContainer, scrollToTop } from '@@/js/scroll.js'; import { getScrollContainer, scrollToTop } from '@@/js/scroll.js';
import type { BasicTimelineType } from '@/timelines.js'; import type { BasicTimelineType } from '@/timelines.js';
import type { PagingCtx } from '@/composables/use-pagination.js';
import type { SoundStore } from '@/preferences/def.js'; import type { SoundStore } from '@/preferences/def.js';
import { usePagination } from '@/composables/use-pagination.js';
import MkPullToRefresh from '@/components/MkPullToRefresh.vue'; import MkPullToRefresh from '@/components/MkPullToRefresh.vue';
import { useStream } from '@/stream.js'; import { useStream } from '@/stream.js';
import * as sound from '@/utility/sound.js'; import * as sound from '@/utility/sound.js';
@ -76,6 +74,7 @@ import MkButton from '@/components/MkButton.vue';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import { globalEvents, useGlobalEvent } from '@/events.js'; import { globalEvents, useGlobalEvent } from '@/events.js';
import { isSeparatorNeeded, getSeparatorInfo } from '@/utility/timeline-date-separate.js'; import { isSeparatorNeeded, getSeparatorInfo } from '@/utility/timeline-date-separate.js';
import { Paginator } from '@/utility/paginator.js';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
src: BasicTimelineType | 'mentions' | 'directs' | 'list' | 'antenna' | 'channel' | 'role'; src: BasicTimelineType | 'mentions' | 'directs' | 'list' | 'antenna' | 'channel' | 'role';
@ -102,6 +101,97 @@ provide('inTimeline', true);
provide('tl_withSensitive', computed(() => props.withSensitive)); provide('tl_withSensitive', computed(() => props.withSensitive));
provide('inChannel', computed(() => props.src === 'channel')); provide('inChannel', computed(() => props.src === 'channel'));
let paginator: Paginator;
if (props.src === 'antenna') {
paginator = markRaw(new Paginator('antennas/notes', {
computedParams: computed(() => ({
antennaId: props.antenna,
})),
useShallowRef: true,
}));
} else if (props.src === 'home') {
paginator = markRaw(new Paginator('notes/timeline', {
computedParams: computed(() => ({
withRenotes: props.withRenotes,
withFiles: props.onlyFiles ? true : undefined,
})),
useShallowRef: true,
}));
} else if (props.src === 'local') {
paginator = markRaw(new Paginator('notes/local-timeline', {
computedParams: computed(() => ({
withRenotes: props.withRenotes,
withReplies: props.withReplies,
withFiles: props.onlyFiles ? true : undefined,
})),
useShallowRef: true,
}));
} else if (props.src === 'social') {
paginator = markRaw(new Paginator('notes/hybrid-timeline', {
computedParams: computed(() => ({
withRenotes: props.withRenotes,
withReplies: props.withReplies,
withFiles: props.onlyFiles ? true : undefined,
})),
useShallowRef: true,
}));
} else if (props.src === 'global') {
paginator = markRaw(new Paginator('notes/global-timeline', {
computedParams: computed(() => ({
withRenotes: props.withRenotes,
withFiles: props.onlyFiles ? true : undefined,
})),
useShallowRef: true,
}));
} else if (props.src === 'mentions') {
paginator = markRaw(new Paginator('notes/mentions', {
useShallowRef: true,
}));
} else if (props.src === 'directs') {
paginator = markRaw(new Paginator('notes/mentions', {
params: {
visibility: 'specified',
},
useShallowRef: true,
}));
} else if (props.src === 'list') {
paginator = markRaw(new Paginator('notes/user-list-timeline', {
computedParams: computed(() => ({
withRenotes: props.withRenotes,
withFiles: props.onlyFiles ? true : undefined,
listId: props.list,
})),
useShallowRef: true,
}));
} else if (props.src === 'channel') {
paginator = markRaw(new Paginator('channels/timeline', {
computedParams: computed(() => ({
channelId: props.channel,
})),
useShallowRef: true,
}));
} else if (props.src === 'role') {
paginator = markRaw(new Paginator('roles/notes', {
computedParams: computed(() => ({
roleId: props.role,
})),
useShallowRef: true,
}));
} else {
throw new Error('Unrecognized timeline type: ' + props.src);
}
onMounted(() => {
paginator.init();
if (paginator.computedParams) {
watch(paginator.computedParams, () => {
paginator.reload();
}, { immediate: false, deep: true });
}
});
function isTop() { function isTop() {
if (scrollContainer == null) return true; if (scrollContainer == null) return true;
if (rootEl.value == null) return true; if (rootEl.value == null) return true;
@ -133,17 +223,6 @@ onUnmounted(() => {
} }
}); });
type TimelineQueryType = {
antennaId?: string,
withRenotes?: boolean,
withReplies?: boolean,
withFiles?: boolean,
visibility?: string,
listId?: string,
channelId?: string,
roleId?: string
};
let adInsertionCounter = 0; let adInsertionCounter = 0;
const MIN_POLLING_INTERVAL = 1000 * 10; const MIN_POLLING_INTERVAL = 1000 * 10;
@ -204,7 +283,6 @@ function prepend(note: Misskey.entities.Note) {
let connection: Misskey.ChannelConnection | null = null; let connection: Misskey.ChannelConnection | null = null;
let connection2: Misskey.ChannelConnection | null = null; let connection2: Misskey.ChannelConnection | null = null;
let paginationQuery: PagingCtx;
const stream = store.s.realtimeMode ? useStream() : null; const stream = store.s.realtimeMode ? useStream() : null;
@ -274,100 +352,17 @@ function disconnectChannel() {
if (connection2) connection2.dispose(); if (connection2) connection2.dispose();
} }
function updatePaginationQuery() { if (store.s.realtimeMode) {
let endpoint: keyof Misskey.Endpoints | null; connectChannel();
let query: TimelineQueryType | null;
if (props.src === 'antenna') {
endpoint = 'antennas/notes';
query = {
antennaId: props.antenna,
};
} else if (props.src === 'home') {
endpoint = 'notes/timeline';
query = {
withRenotes: props.withRenotes,
withFiles: props.onlyFiles ? true : undefined,
};
} else if (props.src === 'local') {
endpoint = 'notes/local-timeline';
query = {
withRenotes: props.withRenotes,
withReplies: props.withReplies,
withFiles: props.onlyFiles ? true : undefined,
};
} else if (props.src === 'social') {
endpoint = 'notes/hybrid-timeline';
query = {
withRenotes: props.withRenotes,
withReplies: props.withReplies,
withFiles: props.onlyFiles ? true : undefined,
};
} else if (props.src === 'global') {
endpoint = 'notes/global-timeline';
query = {
withRenotes: props.withRenotes,
withFiles: props.onlyFiles ? true : undefined,
};
} else if (props.src === 'mentions') {
endpoint = 'notes/mentions';
query = null;
} else if (props.src === 'directs') {
endpoint = 'notes/mentions';
query = {
visibility: 'specified',
};
} else if (props.src === 'list') {
endpoint = 'notes/user-list-timeline';
query = {
withRenotes: props.withRenotes,
withFiles: props.onlyFiles ? true : undefined,
listId: props.list,
};
} else if (props.src === 'channel') {
endpoint = 'channels/timeline';
query = {
channelId: props.channel,
};
} else if (props.src === 'role') {
endpoint = 'roles/notes';
query = {
roleId: props.role,
};
} else {
throw new Error('Unrecognized timeline type: ' + props.src);
}
paginationQuery = {
endpoint: endpoint,
limit: 10,
params: query,
};
} }
function refreshEndpointAndChannel() { watch(() => [props.list, props.antenna, props.channel, props.role, props.withRenotes], () => {
if (store.s.realtimeMode) { if (store.s.realtimeMode) {
disconnectChannel(); disconnectChannel();
connectChannel(); connectChannel();
} }
updatePaginationQuery();
}
// withRenotes
// IDTL
watch(() => [props.list, props.antenna, props.channel, props.role, props.withRenotes], refreshEndpointAndChannel);
// withSensitiveOK
watch(() => props.withSensitive, reloadTimeline);
//
refreshEndpointAndChannel();
const paginator = usePagination({
ctx: paginationQuery,
useShallowRef: true,
}); });
watch(() => props.withSensitive, reloadTimeline);
onUnmounted(() => { onUnmounted(() => {
disconnectChannel(); disconnectChannel();

View file

@ -42,7 +42,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onUnmounted, onMounted, computed, useTemplateRef, TransitionGroup } from 'vue'; import { onUnmounted, onMounted, computed, useTemplateRef, TransitionGroup, markRaw, watch } from 'vue';
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import { useInterval } from '@@/js/use-interval.js'; import { useInterval } from '@@/js/use-interval.js';
import type { notificationTypes } from '@@/js/const.js'; import type { notificationTypes } from '@@/js/const.js';
@ -53,8 +53,8 @@ import { i18n } from '@/i18n.js';
import MkPullToRefresh from '@/components/MkPullToRefresh.vue'; import MkPullToRefresh from '@/components/MkPullToRefresh.vue';
import { prefer } from '@/preferences.js'; import { prefer } from '@/preferences.js';
import { store } from '@/store.js'; import { store } from '@/store.js';
import { usePagination } from '@/composables/use-pagination.js';
import { isSeparatorNeeded, getSeparatorInfo } from '@/utility/timeline-date-separate.js'; import { isSeparatorNeeded, getSeparatorInfo } from '@/utility/timeline-date-separate.js';
import { Paginator } from '@/utility/paginator.js';
const props = defineProps<{ const props = defineProps<{
excludeTypes?: typeof notificationTypes[number][]; excludeTypes?: typeof notificationTypes[number][];
@ -62,21 +62,17 @@ const props = defineProps<{
const rootEl = useTemplateRef('rootEl'); const rootEl = useTemplateRef('rootEl');
const paginator = usePagination({ const paginator = prefer.s.useGroupedNotifications ? markRaw(new Paginator('i/notifications-grouped', {
ctx: prefer.s.useGroupedNotifications ? { limit: 20,
endpoint: 'i/notifications-grouped' as const, computedParams: computed(() => ({
limit: 20, excludeTypes: props.excludeTypes ?? undefined,
params: computed(() => ({ })),
excludeTypes: props.excludeTypes ?? undefined, })) : markRaw(new Paginator('i/notifications', {
})), limit: 20,
} : { computedParams: computed(() => ({
endpoint: 'i/notifications' as const, excludeTypes: props.excludeTypes ?? undefined,
limit: 20, })),
params: computed(() => ({ }));
excludeTypes: props.excludeTypes ?? undefined,
})),
},
});
const MIN_POLLING_INTERVAL = 1000 * 10; const MIN_POLLING_INTERVAL = 1000 * 10;
const POLLING_INTERVAL = const POLLING_INTERVAL =
@ -116,6 +112,14 @@ function reload() {
let connection: Misskey.ChannelConnection<Misskey.Channels['main']> | null = null; let connection: Misskey.ChannelConnection<Misskey.Channels['main']> | null = null;
onMounted(() => { onMounted(() => {
paginator.init();
if (paginator.computedParams) {
watch(paginator.computedParams, () => {
paginator.reload();
}, { immediate: false, deep: true });
}
if (store.s.realtimeMode) { if (store.s.realtimeMode) {
connection = useStream().useChannel('main'); connection = useStream().useChannel('main');
connection.on('notification', onNotification); connection.on('notification', onNotification);

View file

@ -9,7 +9,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div :class="$style.left"> <div :class="$style.left">
<slot v-if="item.type === 'event'" name="left" :event="item.data" :timestamp="item.timestamp" :delta="item.delta"></slot> <slot v-if="item.type === 'event'" name="left" :event="item.data" :timestamp="item.timestamp" :delta="item.delta"></slot>
</div> </div>
<div :class="[$style.center, item.type === 'date' ? $style.date : '']"> <div :class="[$style.center, item.type === 'date' ? $style.date : '', i === 0 ? $style.first : '', i === items.length - 1 ? $style.last : '']">
<div :class="$style.centerLine"></div> <div :class="$style.centerLine"></div>
<div :class="$style.centerPoint"></div> <div :class="$style.centerPoint"></div>
</div> </div>
@ -32,9 +32,12 @@ export type TlEvent<E = any> = {
<script lang="ts" setup generic="T extends unknown"> <script lang="ts" setup generic="T extends unknown">
import { computed } from 'vue'; import { computed } from 'vue';
const props = defineProps<{ const props = withDefaults(defineProps<{
events: TlEvent<T>[]; events: TlEvent<T>[];
}>(); groupBy?: 'd' | 'h';
}>(), {
groupBy: 'd',
});
const events = computed(() => { const events = computed(() => {
return props.events.toSorted((a, b) => b.timestamp - a.timestamp); return props.events.toSorted((a, b) => b.timestamp - a.timestamp);
@ -64,30 +67,41 @@ type TlItem<T> = ({
}); });
const items = computed<TlItem<T>[]>(() => { const items = computed<TlItem<T>[]>(() => {
const results: TlItem<T>[] = []; const results: TlItem<T>[] = [];
for (let i = 0; i < events.value.length; i++) {
const item = events.value[i];
const date = new Date(item.timestamp); for (let i = 0; i < events.value.length; i++) {
const nextDate = events.value[i + 1] ? new Date(events.value[i + 1].timestamp) : null; const item = events.value[i];
results.push({ const date = new Date(item.timestamp);
id: item.id, const nextDate = events.value[i + 1] ? new Date(events.value[i + 1].timestamp) : null;
type: 'event',
timestamp: item.timestamp,
delta: i === events.value.length - 1 ? 0 : item.timestamp - events.value[i + 1].timestamp,
data: item.data,
});
if ( results.push({
i !== events.value.length - 1 && id: item.id,
nextDate != null && ( type: 'event',
timestamp: item.timestamp,
delta: i === events.value.length - 1 ? 0 : item.timestamp - events.value[i + 1].timestamp,
data: item.data,
});
if (i !== events.value.length - 1 && nextDate != null) {
let needsSeparator = false;
if (props.groupBy === 'd') {
needsSeparator = (
date.getFullYear() !== nextDate.getFullYear() ||
date.getMonth() !== nextDate.getMonth() ||
date.getDate() !== nextDate.getDate()
);
} else if (props.groupBy === 'h') {
needsSeparator = (
date.getFullYear() !== nextDate.getFullYear() || date.getFullYear() !== nextDate.getFullYear() ||
date.getMonth() !== nextDate.getMonth() || date.getMonth() !== nextDate.getMonth() ||
date.getDate() !== nextDate.getDate() || date.getDate() !== nextDate.getDate() ||
date.getHours() !== nextDate.getHours() date.getHours() !== nextDate.getHours()
) );
) { }
if (needsSeparator) {
results.push({ results.push({
id: `date-${item.id}`, id: `date-${item.id}`,
type: 'date', type: 'date',
@ -98,8 +112,10 @@ const items = computed<TlItem<T>[]>(() => {
}); });
} }
} }
return results; }
});
return results;
});
</script> </script>
<style lang="scss" module> <style lang="scss" module>
@ -127,6 +143,22 @@ const items = computed<TlItem<T>[]>(() => {
border-radius: 50%; border-radius: 50%;
} }
} }
&.first {
.centerLine {
height: 50%;
top: auto;
bottom: 0;
}
}
&.last {
.centerLine {
height: 50%;
top: 0;
bottom: auto;
}
}
} }
.centerLine { .centerLine {

View file

@ -19,7 +19,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div> </div>
<div :class="$style.itemThumbnail" :style="{ backgroundImage: `url(${ item.thumbnail })` }" @click="onThumbnailClick(item, $event)"></div> <div :class="$style.itemThumbnail" :style="{ backgroundImage: `url(${ item.thumbnail })` }" @click="onThumbnailClick(item, $event)"></div>
<div :class="$style.itemBody"> <div :class="$style.itemBody">
<div><MkCondensedLine :minScale="2 / 3">{{ item.name }}</MkCondensedLine></div> <div><i v-if="item.isSensitive" style="color: var(--MI_THEME-warn); margin-right: 0.5em;" class="ti ti-eye-exclamation"></i><MkCondensedLine :minScale="2 / 3">{{ item.name }}</MkCondensedLine></div>
<div :class="$style.itemInfo"> <div :class="$style.itemInfo">
<span>{{ item.file.type }}</span> <span>{{ item.file.type }}</span>
<span v-if="item.compressedSize">({{ i18n.tsx._uploader.compressedToX({ x: bytes(item.compressedSize) }) }} = {{ i18n.tsx._uploader.savedXPercent({ x: Math.round((1 - item.compressedSize / item.file.size) * 100) }) }})</span> <span v-if="item.compressedSize">({{ i18n.tsx._uploader.compressedToX({ x: bytes(item.compressedSize) }) }} = {{ i18n.tsx._uploader.savedXPercent({ x: Math.round((1 - item.compressedSize / item.file.size) * 100) }) }})</span>

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
--> -->
<template> <template>
<MkPagination :pagination="pagination"> <MkPagination :paginator="paginator">
<template #empty><MkResult type="empty" :text="i18n.ts.noUsers"/></template> <template #empty><MkResult type="empty" :text="i18n.ts.noUsers"/></template>
<template #default="{ items }"> <template #default="{ items }">
@ -16,13 +16,13 @@ SPDX-License-Identifier: AGPL-3.0-only
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import type { PagingCtx } from '@/composables/use-pagination.js'; import type { Paginator } from '@/utility/paginator.js';
import MkUserInfo from '@/components/MkUserInfo.vue'; import MkUserInfo from '@/components/MkUserInfo.vue';
import MkPagination from '@/components/MkPagination.vue'; import MkPagination from '@/components/MkPagination.vue';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
pagination: PagingCtx; paginator: Paginator;
noGap?: boolean; noGap?: boolean;
extractor?: (item: any) => any; extractor?: (item: any) => any;
}>(), { }>(), {

View file

@ -10,7 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkFolder :defaultOpen="true"> <MkFolder :defaultOpen="true">
<template #label>{{ i18n.ts.recommended }}</template> <template #label>{{ i18n.ts.recommended }}</template>
<MkPagination :pagination="pinnedUsers"> <MkPagination :paginator="pinnedUsersPaginator">
<template #default="{ items }"> <template #default="{ items }">
<div :class="$style.users"> <div :class="$style.users">
<XUser v-for="item in (items as Misskey.entities.UserDetailed[])" :key="item.id" :user="item"/> <XUser v-for="item in (items as Misskey.entities.UserDetailed[])" :key="item.id" :user="item"/>
@ -22,7 +22,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkFolder :defaultOpen="true"> <MkFolder :defaultOpen="true">
<template #label>{{ i18n.ts.popularUsers }}</template> <template #label>{{ i18n.ts.popularUsers }}</template>
<MkPagination :pagination="popularUsers"> <MkPagination :paginator="popularUsersPaginator">
<template #default="{ items }"> <template #default="{ items }">
<div :class="$style.users"> <div :class="$style.users">
<XUser v-for="item in (items as Misskey.entities.UserDetailed[])" :key="item.id" :user="item"/> <XUser v-for="item in (items as Misskey.entities.UserDetailed[])" :key="item.id" :user="item"/>
@ -35,20 +35,19 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup> <script lang="ts" setup>
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import { markRaw } from 'vue';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import MkFolder from '@/components/MkFolder.vue'; import MkFolder from '@/components/MkFolder.vue';
import XUser from '@/components/MkUserSetupDialog.User.vue'; import XUser from '@/components/MkUserSetupDialog.User.vue';
import MkPagination from '@/components/MkPagination.vue'; import MkPagination from '@/components/MkPagination.vue';
import type { PagingCtx } from '@/composables/use-pagination.js'; import { Paginator } from '@/utility/paginator.js';
const pinnedUsers: PagingCtx = { const pinnedUsersPaginator = markRaw(new Paginator('pinned-users', {
endpoint: 'pinned-users',
noPaging: true, noPaging: true,
limit: 10, limit: 10,
}; }));
const popularUsers: PagingCtx = { const popularUsersPaginator = markRaw(new Paginator('users', {
endpoint: 'users',
limit: 10, limit: 10,
noPaging: true, noPaging: true,
params: { params: {
@ -56,7 +55,7 @@ const popularUsers: PagingCtx = {
origin: 'local', origin: 'local',
sort: '+follower', sort: '+follower',
}, },
}; }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -1,302 +0,0 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { computed, isRef, onMounted, ref, shallowRef, triggerRef, watch } from 'vue';
import * as Misskey from 'misskey-js';
import type { ComputedRef, DeepReadonly, Ref, ShallowRef } from 'vue';
import { misskeyApi } from '@/utility/misskey-api.js';
const MAX_ITEMS = 30;
const MAX_QUEUE_ITEMS = 100;
const FIRST_FETCH_LIMIT = 15;
const SECOND_FETCH_LIMIT = 30;
export type MisskeyEntity = {
id: string;
createdAt: string;
_shouldInsertAd_?: boolean;
[x: string]: any;
};
export type PagingCtx<E extends keyof Misskey.Endpoints = keyof Misskey.Endpoints> = {
endpoint: E;
limit?: number;
params?: Misskey.Endpoints[E]['req'] | ComputedRef<Misskey.Endpoints[E]['req']>;
/**
* APIのような
* (APIをこの関数で使うのは若干矛盾してるけど)
*/
noPaging?: boolean;
offsetMode?: boolean;
initialId?: MisskeyEntity['id'];
initialDirection?: 'newer' | 'older';
// 配列内の要素をどのような順序で並べるか
// newest: 新しいものが先頭 (default)
// oldest: 古いものが先頭
// NOTE: このようなプロパティを用意してこっち側で並びを管理せずに、Setで持っておき参照者側が好きに並び変えるような設計の方がすっきりしそうなものの、Vueのレンダリングのたびに並び替え処理が発生することになったりしそうでパフォーマンス上の懸念がある
order?: 'newest' | 'oldest';
// 一部のAPIはさらに遡れる場合でもパフォーマンス上の理由でlimit以下の結果を返す場合があり、その場合はsafe、それ以外はlimitにすることを推奨
canFetchDetection?: 'safe' | 'limit';
};
export function usePagination<Endpoint extends keyof Misskey.Endpoints, T extends { id: string; } = (Misskey.Endpoints[Endpoint]['res'] extends (infer I)[] ? I extends { id: string } ? I : { id: string } : { id: string })>(props: {
ctx: PagingCtx<Endpoint>;
autoInit?: boolean;
autoReInit?: boolean;
useShallowRef?: boolean;
}) {
const items = props.useShallowRef ? shallowRef<T[]>([]) : ref<T[]>([]);
let aheadQueue: T[] = [];
const queuedAheadItemsCount = ref(0);
const fetching = ref(true);
const fetchingOlder = ref(false);
const fetchingNewer = ref(false);
const canFetchOlder = ref(false);
const error = ref(false);
if (props.autoReInit !== false) {
watch(() => [props.ctx.endpoint, props.ctx.params], init, { deep: true });
}
function getNewestId(): string | null | undefined {
// 様々な要因により並び順は保証されないのでソートが必要
if (aheadQueue.length > 0) {
return aheadQueue.map(x => x.id).sort().at(-1);
}
return items.value.map(x => x.id).sort().at(-1);
}
function getOldestId(): string | null | undefined {
// 様々な要因により並び順は保証されないのでソートが必要
return items.value.map(x => x.id).sort().at(0);
}
async function init(): Promise<void> {
items.value = [];
aheadQueue = [];
queuedAheadItemsCount.value = 0;
fetching.value = true;
const params = props.ctx.params ? isRef(props.ctx.params) ? props.ctx.params.value : props.ctx.params : {};
await misskeyApi<T[]>(props.ctx.endpoint, {
...params,
limit: props.ctx.limit ?? FIRST_FETCH_LIMIT,
allowPartial: true,
...(props.ctx.initialDirection === 'newer' ? {
sinceId: props.ctx.initialId ?? '0',
} : props.ctx.initialId && props.ctx.initialDirection === 'older' ? {
untilId: props.ctx.initialId,
} : {}),
}).then(res => {
// 逆順で返ってくるので
if (props.ctx.initialId && props.ctx.initialDirection === 'newer') {
res.reverse();
}
for (let i = 0; i < res.length; i++) {
const item = res[i];
if (i === 3) item._shouldInsertAd_ = true;
}
pushItems(res);
if (props.ctx.canFetchDetection === 'limit') {
if (res.length < FIRST_FETCH_LIMIT) {
canFetchOlder.value = false;
} else {
canFetchOlder.value = true;
}
} else if (props.ctx.canFetchDetection === 'safe' || props.ctx.canFetchDetection == null) {
if (res.length === 0 || props.ctx.noPaging) {
canFetchOlder.value = false;
} else {
canFetchOlder.value = true;
}
}
error.value = false;
fetching.value = false;
}, err => {
error.value = true;
fetching.value = false;
});
}
function reload(): Promise<void> {
return init();
}
async function fetchOlder(): Promise<void> {
if (!canFetchOlder.value || fetching.value || fetchingOlder.value || items.value.length === 0) return;
fetchingOlder.value = true;
const params = props.ctx.params ? isRef(props.ctx.params) ? props.ctx.params.value : props.ctx.params : {};
await misskeyApi<T[]>(props.ctx.endpoint, {
...params,
limit: SECOND_FETCH_LIMIT,
...(props.ctx.offsetMode ? {
offset: items.value.length,
} : {
untilId: getOldestId(),
}),
}).then(res => {
for (let i = 0; i < res.length; i++) {
const item = res[i];
if (i === 10) item._shouldInsertAd_ = true;
}
pushItems(res);
if (props.ctx.canFetchDetection === 'limit') {
if (res.length < FIRST_FETCH_LIMIT) {
canFetchOlder.value = false;
} else {
canFetchOlder.value = true;
}
} else if (props.ctx.canFetchDetection === 'safe' || props.ctx.canFetchDetection == null) {
if (res.length === 0) {
canFetchOlder.value = false;
} else {
canFetchOlder.value = true;
}
}
}).finally(() => {
fetchingOlder.value = false;
});
}
async function fetchNewer(options: {
toQueue?: boolean;
} = {}): Promise<void> {
fetchingNewer.value = true;
const params = props.ctx.params ? isRef(props.ctx.params) ? props.ctx.params.value : props.ctx.params : {};
await misskeyApi<T[]>(props.ctx.endpoint, {
...params,
limit: SECOND_FETCH_LIMIT,
...(props.ctx.offsetMode ? {
offset: items.value.length,
} : {
sinceId: getNewestId(),
}),
}).then(res => {
if (res.length === 0) return; // これやらないと余計なre-renderが走る
if (options.toQueue) {
aheadQueue.unshift(...res.toReversed());
if (aheadQueue.length > MAX_QUEUE_ITEMS) {
aheadQueue = aheadQueue.slice(0, MAX_QUEUE_ITEMS);
}
queuedAheadItemsCount.value = aheadQueue.length;
} else {
if (props.ctx.order === 'oldest') {
pushItems(res);
} else {
unshiftItems(res.toReversed());
}
}
}).finally(() => {
fetchingNewer.value = false;
});
}
function trim(trigger = true) {
if (items.value.length >= MAX_ITEMS) canFetchOlder.value = true;
items.value = items.value.slice(0, MAX_ITEMS);
if (props.useShallowRef && trigger) triggerRef(items);
}
function unshiftItems(newItems: T[]) {
if (newItems.length === 0) return; // これやらないと余計なre-renderが走る
items.value.unshift(...newItems.filter(x => !items.value.some(y => y.id === x.id))); // ストリーミングやポーリングのタイミングによっては重複することがあるため
trim(false);
if (props.useShallowRef) triggerRef(items);
}
function pushItems(oldItems: T[]) {
if (oldItems.length === 0) return; // これやらないと余計なre-renderが走る
items.value.push(...oldItems);
if (props.useShallowRef) triggerRef(items);
}
function prepend(item: T) {
if (items.value.some(x => x.id === item.id)) return;
items.value.unshift(item);
trim(false);
if (props.useShallowRef) triggerRef(items);
}
function enqueue(item: T) {
aheadQueue.unshift(item);
if (aheadQueue.length > MAX_QUEUE_ITEMS) {
aheadQueue.pop();
}
queuedAheadItemsCount.value = aheadQueue.length;
}
function releaseQueue() {
if (aheadQueue.length === 0) return; // これやらないと余計なre-renderが走る
unshiftItems(aheadQueue);
aheadQueue = [];
queuedAheadItemsCount.value = 0;
}
function removeItem(id: string) {
// TODO: queueからも消す
const index = items.value.findIndex(x => x.id === id);
if (index !== -1) {
items.value.splice(index, 1);
if (props.useShallowRef) triggerRef(items);
}
}
function updateItem(id: string, updator: (item: T) => T) {
// TODO: queueのも更新
const index = items.value.findIndex(x => x.id === id);
if (index !== -1) {
const item = items.value[index]!;
items.value[index] = updator(item);
if (props.useShallowRef) triggerRef(items);
}
}
function updateCtx(ctx: PagingCtx<Endpoint>) {
props.ctx = ctx;
reload();
}
if (props.autoInit !== false) {
onMounted(() => {
init();
});
}
return {
items: items as DeepReadonly<ShallowRef<T[]>>,
queuedAheadItemsCount,
fetching,
fetchingOlder,
fetchingNewer,
canFetchOlder,
init,
reload,
fetchOlder,
fetchNewer,
unshiftItems,
prepend,
trim,
removeItem,
updateItem,
enqueue,
releaseQueue,
error,
updateCtx,
};
}

View file

@ -283,6 +283,9 @@ const patronsWithIcon = [{
}, { }, {
name: 'しきいし', name: 'しきいし',
icon: 'https://assets.misskey-hub.net/patrons/77dd5387db41427ba9cbdc8849e76402.jpg', icon: 'https://assets.misskey-hub.net/patrons/77dd5387db41427ba9cbdc8849e76402.jpg',
}, {
name: '井上千二十四',
icon: 'https://assets.misskey-hub.net/patrons/193afa1f039b4c339866039c3dcd74bf.jpg',
}]; }];
const patrons = [ const patrons = [
@ -395,6 +398,7 @@ const patrons = [
'ruru', 'ruru',
'みりめい', 'みりめい',
'東雲 琥珀', '東雲 琥珀',
'ほとラズ',
]; ];
const thereIsTreasure = ref($i && !claimedAchievements.includes('foundTreasure')); const thereIsTreasure = ref($i && !claimedAchievements.includes('foundTreasure'));

View file

@ -40,7 +40,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</FormSplit> </FormSplit>
</div> </div>
<MkPagination v-slot="{items}" ref="instances" :key="host + state" :pagination="pagination"> <MkPagination v-slot="{items}" ref="instances" :key="host + state" :paginator="paginator">
<div :class="$style.items"> <div :class="$style.items">
<MkA v-for="instance in items" :key="instance.id" v-tooltip.mfm="`Status: ${getStatus(instance)}`" :class="$style.item" :to="`/instance-info/${instance.host}`"> <MkA v-for="instance in items" :key="instance.id" v-tooltip.mfm="`Status: ${getStatus(instance)}`" :class="$style.item" :to="`/instance-info/${instance.host}`">
<MkInstanceCardMini :instance="instance"/> <MkInstanceCardMini :instance="instance"/>
@ -51,24 +51,22 @@ SPDX-License-Identifier: AGPL-3.0-only
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref } from 'vue'; import { computed, markRaw, ref } from 'vue';
import MkInput from '@/components/MkInput.vue'; import MkInput from '@/components/MkInput.vue';
import MkSelect from '@/components/MkSelect.vue'; import MkSelect from '@/components/MkSelect.vue';
import MkPagination from '@/components/MkPagination.vue'; import MkPagination from '@/components/MkPagination.vue';
import type { PagingCtx } from '@/composables/use-pagination.js';
import MkInstanceCardMini from '@/components/MkInstanceCardMini.vue'; import MkInstanceCardMini from '@/components/MkInstanceCardMini.vue';
import FormSplit from '@/components/form/split.vue'; import FormSplit from '@/components/form/split.vue';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import { Paginator } from '@/utility/paginator.js';
const host = ref(''); const host = ref('');
const state = ref('federating'); const state = ref('federating');
const sort = ref('+pubSub'); const sort = ref('+pubSub');
const pagination = { const paginator = markRaw(new Paginator('federation/instances', {
endpoint: 'federation/instances' as const,
limit: 10, limit: 10,
displayLimit: 50,
offsetMode: true, offsetMode: true,
params: computed(() => ({ computedParams: computed(() => ({
sort: sort.value, sort: sort.value,
host: host.value !== '' ? host.value : null, host: host.value !== '' ? host.value : null,
...( ...(
@ -81,7 +79,7 @@ const pagination = {
state.value === 'notResponding' ? { notResponding: true } : state.value === 'notResponding' ? { notResponding: true } :
{}), {}),
})), })),
} as PagingCtx; }));
function getStatus(instance) { function getStatus(instance) {
if (instance.isSuspended) return 'Suspended'; if (instance.isSuspended) return 'Suspended';

View file

@ -160,7 +160,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<option value="archived">{{ i18n.ts.archived }}</option> <option value="archived">{{ i18n.ts.archived }}</option>
</MkSelect> </MkSelect>
<MkPagination :pagination="announcementsPagination"> <MkPagination :paginator="announcementsPaginator">
<template #default="{ items }"> <template #default="{ items }">
<div class="_gaps_s"> <div class="_gaps_s">
<div v-for="announcement in items" :key="announcement.id" v-panel :class="$style.announcementItem" @click="editAnnouncement(announcement)"> <div v-for="announcement in items" :key="announcement.id" v-panel :class="$style.announcementItem" @click="editAnnouncement(announcement)">
@ -179,7 +179,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div> </div>
<div v-else-if="tab === 'drive'" class="_gaps"> <div v-else-if="tab === 'drive'" class="_gaps">
<MkFileListForAdmin :pagination="filesPagination" viewMode="grid"/> <MkFileListForAdmin :paginator="filesPaginator" viewMode="grid"/>
</div> </div>
<div v-else-if="tab === 'chart'" class="_gaps_m"> <div v-else-if="tab === 'chart'" class="_gaps_m">
@ -211,7 +211,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, defineAsyncComponent, watch, ref } from 'vue'; import { computed, defineAsyncComponent, watch, ref, markRaw } from 'vue';
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import { url } from '@@/js/config.js'; import { url } from '@@/js/config.js';
import MkChart from '@/components/MkChart.vue'; import MkChart from '@/components/MkChart.vue';
@ -235,6 +235,7 @@ import { i18n } from '@/i18n.js';
import { iAmAdmin, $i, iAmModerator } from '@/i.js'; import { iAmAdmin, $i, iAmModerator } from '@/i.js';
import MkRolePreview from '@/components/MkRolePreview.vue'; import MkRolePreview from '@/components/MkRolePreview.vue';
import MkPagination from '@/components/MkPagination.vue'; import MkPagination from '@/components/MkPagination.vue';
import { Paginator } from '@/utility/paginator.js';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
userId: string; userId: string;
@ -255,24 +256,22 @@ const silenced = ref(false);
const suspended = ref(false); const suspended = ref(false);
const isSystem = ref(false); const isSystem = ref(false);
const moderationNote = ref(''); const moderationNote = ref('');
const filesPagination = { const filesPaginator = markRaw(new Paginator('admin/drive/files', {
endpoint: 'admin/drive/files' as const,
limit: 10, limit: 10,
params: computed(() => ({ computedParams: computed(() => ({
userId: props.userId, userId: props.userId,
})), })),
}; }));
const announcementsStatus = ref<'active' | 'archived'>('active'); const announcementsStatus = ref<'active' | 'archived'>('active');
const announcementsPagination = { const announcementsPaginator = markRaw(new Paginator('admin/announcements/list', {
endpoint: 'admin/announcements/list' as const,
limit: 10, limit: 10,
params: computed(() => ({ computedParams: computed(() => ({
userId: props.userId, userId: props.userId,
status: announcementsStatus.value, status: announcementsStatus.value,
})), })),
}; }));
const expandedRoles = ref([]); const expandedRoles = ref([]);
function createFetcher() { function createFetcher() {

View file

@ -41,13 +41,13 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkInput v-model="searchUsername" style="margin: 0; flex: 1;" type="text" :spellcheck="false"> <MkInput v-model="searchUsername" style="margin: 0; flex: 1;" type="text" :spellcheck="false">
<span>{{ i18n.ts.username }}</span> <span>{{ i18n.ts.username }}</span>
</MkInput> </MkInput>
<MkInput v-model="searchHost" style="margin: 0; flex: 1;" type="text" :spellcheck="false" :disabled="pagination.params().origin === 'local'"> <MkInput v-model="searchHost" style="margin: 0; flex: 1;" type="text" :spellcheck="false" :disabled="paginator.computedParams.value.origin === 'local'">
<span>{{ i18n.ts.host }}</span> <span>{{ i18n.ts.host }}</span>
</MkInput> </MkInput>
</div> </div>
--> -->
<MkPagination v-slot="{items}" ref="reports" :pagination="pagination"> <MkPagination v-slot="{items}" :paginator="paginator">
<div class="_gaps"> <div class="_gaps">
<XAbuseReport v-for="report in items" :key="report.id" :report="report" @resolved="resolved"/> <XAbuseReport v-for="report in items" :key="report.id" :report="report" @resolved="resolved"/>
</div> </div>
@ -58,7 +58,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, useTemplateRef, ref } from 'vue'; import { computed, ref, markRaw } from 'vue';
import MkSelect from '@/components/MkSelect.vue'; import MkSelect from '@/components/MkSelect.vue';
import MkPagination from '@/components/MkPagination.vue'; import MkPagination from '@/components/MkPagination.vue';
import XAbuseReport from '@/components/MkAbuseReport.vue'; import XAbuseReport from '@/components/MkAbuseReport.vue';
@ -66,8 +66,7 @@ import { i18n } from '@/i18n.js';
import { definePage } from '@/page.js'; import { definePage } from '@/page.js';
import MkButton from '@/components/MkButton.vue'; import MkButton from '@/components/MkButton.vue';
import { store } from '@/store.js'; import { store } from '@/store.js';
import { Paginator } from '@/utility/paginator.js';
const reports = useTemplateRef('reports');
const state = ref('unresolved'); const state = ref('unresolved');
const reporterOrigin = ref('combined'); const reporterOrigin = ref('combined');
@ -75,18 +74,17 @@ const targetUserOrigin = ref('combined');
const searchUsername = ref(''); const searchUsername = ref('');
const searchHost = ref(''); const searchHost = ref('');
const pagination = { const paginator = markRaw(new Paginator('admin/abuse-user-reports', {
endpoint: 'admin/abuse-user-reports' as const,
limit: 10, limit: 10,
params: computed(() => ({ computedParams: computed(() => ({
state: state.value, state: state.value,
reporterOrigin: reporterOrigin.value, reporterOrigin: reporterOrigin.value,
targetUserOrigin: targetUserOrigin.value, targetUserOrigin: targetUserOrigin.value,
})), })),
}; }));
function resolved(reportId) { function resolved(reportId) {
reports.value?.paginator.removeItem(reportId); paginator.removeItem(reportId);
} }
const headerActions = computed(() => []); const headerActions = computed(() => []);

View file

@ -42,7 +42,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</FormSplit> </FormSplit>
</div> </div>
<MkPagination v-slot="{items}" ref="instances" :key="host + state" :pagination="pagination"> <MkPagination v-slot="{items}" :key="host + state" :paginator="paginator">
<div :class="$style.instances"> <div :class="$style.instances">
<MkA v-for="instance in items" :key="instance.id" v-tooltip.mfm="`Status: ${getStatus(instance)}`" :class="$style.instance" :to="`/instance-info/${instance.host}`"> <MkA v-for="instance in items" :key="instance.id" v-tooltip.mfm="`Status: ${getStatus(instance)}`" :class="$style.instance" :to="`/instance-info/${instance.host}`">
<MkInstanceCardMini :instance="instance"/> <MkInstanceCardMini :instance="instance"/>
@ -56,7 +56,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup> <script lang="ts" setup>
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import { computed, ref } from 'vue'; import { computed, markRaw, ref } from 'vue';
import MkInput from '@/components/MkInput.vue'; import MkInput from '@/components/MkInput.vue';
import MkSelect from '@/components/MkSelect.vue'; import MkSelect from '@/components/MkSelect.vue';
import MkPagination from '@/components/MkPagination.vue'; import MkPagination from '@/components/MkPagination.vue';
@ -64,15 +64,15 @@ import MkInstanceCardMini from '@/components/MkInstanceCardMini.vue';
import FormSplit from '@/components/form/split.vue'; import FormSplit from '@/components/form/split.vue';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import { definePage } from '@/page.js'; import { definePage } from '@/page.js';
import { Paginator } from '@/utility/paginator.js';
const host = ref(''); const host = ref('');
const state = ref('federating'); const state = ref('federating');
const sort = ref('+pubSub'); const sort = ref('+pubSub');
const pagination = { const paginator = markRaw(new Paginator('federation/instances', {
endpoint: 'federation/instances' as const,
limit: 10, limit: 10,
offsetMode: true, offsetMode: true,
params: computed(() => ({ computedParams: computed(() => ({
sort: sort.value, sort: sort.value,
host: host.value !== '' ? host.value : null, host: host.value !== '' ? host.value : null,
...( ...(
@ -85,7 +85,7 @@ const pagination = {
state.value === 'notResponding' ? { notResponding: true } : state.value === 'notResponding' ? { notResponding: true } :
{}), {}),
})), })),
}; }));
function getStatus(instance: Misskey.entities.FederationInstance) { function getStatus(instance: Misskey.entities.FederationInstance) {
switch (instance.suspensionState) { switch (instance.suspensionState) {

Some files were not shown because too many files have changed in this diff Show more