Merge remote-tracking branch 'misskey-original/develop' into develop

# Conflicts:
#	CHANGELOG.md
#	packages/backend/src/server/api/endpoints/channels/timeline.ts
This commit is contained in:
mattyatea 2023-10-11 06:22:57 +09:00
commit 2e7c034b99
22 changed files with 24 additions and 67 deletions

View File

@ -14,8 +14,8 @@
## 2023.10.0 ## 2023.10.0
### NOTE ### NOTE
- muted_noteテーブルは使われなくなったため手動で削除を行ってください。
- 2023.9.2で導入されたノート編集機能はクオリティの高い実装が困難であることが判明したため撤回されました - 2023.9.2で導入されたノート編集機能はクオリティの高い実装が困難であることが判明したため撤回されました
- アップデートを行うと、タイムラインが一時的にリセットされます
### Changes ### Changes
- API: users/notes, notes/local-timeline で fileType 指定はできなくなりました - API: users/notes, notes/local-timeline で fileType 指定はできなくなりました

View File

@ -995,9 +995,6 @@ _theme:
infoFg: "তথ্যের পাঠ্য" infoFg: "তথ্যের পাঠ্য"
infoWarnBg: "ওয়ার্নিং এর পটভূমি" infoWarnBg: "ওয়ার্নিং এর পটভূমি"
infoWarnFg: "ওয়ার্নিং এর পাঠ্য" infoWarnFg: "ওয়ার্নিং এর পাঠ্য"
cwBg: "CW বাটনের পটভূমি"
cwFg: "CW বাটনের পাঠ্য"
cwHoverBg: "CW বাটনের পটভূমি (হভার)"
toastBg: "বিজ্ঞপ্তির পটভূমি" toastBg: "বিজ্ঞপ্তির পটভূমি"
toastFg: "বিজ্ঞপ্তির পাঠ্য" toastFg: "বিজ্ঞপ্তির পাঠ্য"
buttonBg: "বাটনের পটভূমি" buttonBg: "বাটনের পটভূমি"

View File

@ -1622,9 +1622,6 @@ _theme:
infoFg: "Text informací" infoFg: "Text informací"
infoWarnBg: "Pozadí varování" infoWarnBg: "Pozadí varování"
infoWarnFg: "Text varování" infoWarnFg: "Text varování"
cwBg: "Pozadí CW tlačítka"
cwFg: "Text CW tlačítka"
cwHoverBg: "Pozadí CW tlačítka (Hover)"
toastBg: "Pozadí oznámení" toastBg: "Pozadí oznámení"
toastFg: "Text oznámení" toastFg: "Text oznámení"
buttonBg: "Pozadí tlačítka" buttonBg: "Pozadí tlačítka"

View File

@ -1685,9 +1685,6 @@ _theme:
infoFg: "Text von Informationen" infoFg: "Text von Informationen"
infoWarnBg: "Hintergrund von Warnungen" infoWarnBg: "Hintergrund von Warnungen"
infoWarnFg: "Text von Warnungen" infoWarnFg: "Text von Warnungen"
cwBg: "Hintergrund des Inhaltswarnungsknopfs"
cwFg: "Text des Inhaltswarnungsknopfs"
cwHoverBg: "Hintergrund des Inhaltswarnungsknopfs (Mouseover)"
toastBg: "Hintergrund von Benachrichtigungen" toastBg: "Hintergrund von Benachrichtigungen"
toastFg: "Text von Benachrichtigungen" toastFg: "Text von Benachrichtigungen"
buttonBg: "Hintergrund von Schaltflächen" buttonBg: "Hintergrund von Schaltflächen"

View File

@ -1693,9 +1693,6 @@ _theme:
infoFg: "Information text" infoFg: "Information text"
infoWarnBg: "Warning background" infoWarnBg: "Warning background"
infoWarnFg: "Warning text" infoWarnFg: "Warning text"
cwBg: "CW button background"
cwFg: "CW button text"
cwHoverBg: "CW button background (Hover)"
toastBg: "Notification background" toastBg: "Notification background"
toastFg: "Notification text" toastFg: "Notification text"
buttonBg: "Button background" buttonBg: "Button background"

View File

@ -1666,9 +1666,6 @@ _theme:
infoFg: "Texto de información" infoFg: "Texto de información"
infoWarnBg: "Fondo de advertencias" infoWarnBg: "Fondo de advertencias"
infoWarnFg: "Texto de advertencias" infoWarnFg: "Texto de advertencias"
cwBg: "Fondo del botón CW"
cwFg: "Texto del botón CW"
cwHoverBg: "Fondo del botón CW (hover)"
toastBg: "Fondo de notificaciones" toastBg: "Fondo de notificaciones"
toastFg: "Texto de notificaciones" toastFg: "Texto de notificaciones"
buttonBg: "Fondo de botón" buttonBg: "Fondo de botón"

View File

@ -1358,9 +1358,6 @@ _theme:
infoFg: "Texte d'information" infoFg: "Texte d'information"
infoWarnBg: "Arrière-plan des avertissements" infoWarnBg: "Arrière-plan des avertissements"
infoWarnFg: "Texte davertissement" infoWarnFg: "Texte davertissement"
cwBg: "Arrière-plan du CW"
cwFg: "Texte du bouton CW"
cwHoverBg: "Arrière-plan du bouton CW (survolé)"
toastBg: "Arrière-plan de la bulle de notification" toastBg: "Arrière-plan de la bulle de notification"
toastFg: "Texte de la bulle de notification" toastFg: "Texte de la bulle de notification"
buttonBg: "Arrière-plan du bouton" buttonBg: "Arrière-plan du bouton"

View File

@ -1627,9 +1627,6 @@ _theme:
infoFg: "Teks informasi" infoFg: "Teks informasi"
infoWarnBg: "Latar belakang peringatan" infoWarnBg: "Latar belakang peringatan"
infoWarnFg: "Teks peringatan" infoWarnFg: "Teks peringatan"
cwBg: "Latar belakang tombol Sembunyikan Konten"
cwFg: "Teks tombol Sembunyikan Konten"
cwHoverBg: "Latar belakang tombol Sembunyikan Konten (Mengambang)"
toastBg: "Latar belakang notifikasi" toastBg: "Latar belakang notifikasi"
toastFg: "Teks notifikasi" toastFg: "Teks notifikasi"
buttonBg: "Latar belakang tombol" buttonBg: "Latar belakang tombol"

View File

@ -1685,9 +1685,6 @@ _theme:
infoFg: "Testo di informazioni" infoFg: "Testo di informazioni"
infoWarnBg: "Sfondo degli avvisi" infoWarnBg: "Sfondo degli avvisi"
infoWarnFg: "Testo di avviso" infoWarnFg: "Testo di avviso"
cwBg: "Sfondo del CW"
cwFg: "Testo del pulsante CW"
cwHoverBg: "Sfondo del pulsante CW (sorvolato)"
toastBg: "Sfondo di notifica a comparsa" toastBg: "Sfondo di notifica a comparsa"
toastFg: "Testo di notifica a comparsa" toastFg: "Testo di notifica a comparsa"
buttonBg: "Sfondo del pulsante" buttonBg: "Sfondo del pulsante"

View File

@ -1649,9 +1649,6 @@ _theme:
infoFg: "情報の文字" infoFg: "情報の文字"
infoWarnBg: "警告の背景" infoWarnBg: "警告の背景"
infoWarnFg: "警告の文字" infoWarnFg: "警告の文字"
cwBg: "CW ボタンの背景"
cwFg: "CW ボタンの文字"
cwHoverBg: "CW ボタンの背景 (ホバー)"
toastBg: "通知トーストの背景" toastBg: "通知トーストの背景"
toastFg: "通知トーストの文字" toastFg: "通知トーストの文字"
buttonBg: "ボタンの背景" buttonBg: "ボタンの背景"

View File

@ -1663,9 +1663,6 @@ _theme:
infoFg: "정보창 텍스트" infoFg: "정보창 텍스트"
infoWarnBg: "경고창 배경" infoWarnBg: "경고창 배경"
infoWarnFg: "경고창 텍스트" infoWarnFg: "경고창 텍스트"
cwBg: "CW 버튼 배경"
cwFg: "CW 버튼 텍스트"
cwHoverBg: "CW 버튼 배경 (호버)"
toastBg: "알림창 배경" toastBg: "알림창 배경"
toastFg: "알림창 텍스트" toastFg: "알림창 텍스트"
buttonBg: "버튼 배경" buttonBg: "버튼 배경"

View File

@ -1043,9 +1043,6 @@ _theme:
infoFg: "Tekst informacji" infoFg: "Tekst informacji"
infoWarnBg: "Tło ostrzeżenia" infoWarnBg: "Tło ostrzeżenia"
infoWarnFg: "Tekst ostrzeżenia" infoWarnFg: "Tekst ostrzeżenia"
cwBg: "Tło CW"
cwFg: "Tekst CW"
cwHoverBg: "Tło CW (po najechaniu)"
toastBg: "Tło powiadomień" toastBg: "Tło powiadomień"
toastFg: "Tekst powiadomień" toastFg: "Tekst powiadomień"
buttonBg: "Tło przycisku" buttonBg: "Tło przycisku"

View File

@ -1551,9 +1551,6 @@ _theme:
infoFg: "Текст сообщения" infoFg: "Текст сообщения"
infoWarnBg: "Фон предупреждения" infoWarnBg: "Фон предупреждения"
infoWarnFg: "Текст предупреждения" infoWarnFg: "Текст предупреждения"
cwBg: "Фон предупреждения о содержимом"
cwFg: "Текст предупреждения о содержимом"
cwHoverBg: "Фон предупреждения о содержимом (под указателем)"
toastBg: "Фон оповещения" toastBg: "Фон оповещения"
toastFg: "Текст оповещения" toastFg: "Текст оповещения"
buttonBg: "Фон кнопки" buttonBg: "Фон кнопки"

View File

@ -1102,9 +1102,6 @@ _theme:
infoFg: "Informačný text" infoFg: "Informačný text"
infoWarnBg: "Pozadie varovania" infoWarnBg: "Pozadie varovania"
infoWarnFg: "Text varovania" infoWarnFg: "Text varovania"
cwBg: "CW pozadie tlačidla"
cwFg: "CW text tlačidla"
cwHoverBg: "CW pozadie tlačidla (pod kurzorom)"
toastBg: "Pozadie upozornenia" toastBg: "Pozadie upozornenia"
toastFg: "Text upozornenia" toastFg: "Text upozornenia"
buttonBg: "Pozadie tlačidla" buttonBg: "Pozadie tlačidla"

View File

@ -1663,9 +1663,6 @@ _theme:
infoFg: "ข้อความข้อมูล" infoFg: "ข้อความข้อมูล"
infoWarnBg: "คำเตือนพื้นหลัง" infoWarnBg: "คำเตือนพื้นหลัง"
infoWarnFg: "คำเตือนข้อความ" infoWarnFg: "คำเตือนข้อความ"
cwBg: "ปุ่ม CW พื้นหลัง"
cwFg: "ปุ่ม CW ข้อความ"
cwHoverBg: "ปุ่ม CW พื้นหลัง (โฮเวอร์)"
toastBg: "ประวัติการแจ้งเตือน" toastBg: "ประวัติการแจ้งเตือน"
toastFg: "ข้อความแจ้งเตือน" toastFg: "ข้อความแจ้งเตือน"
buttonBg: "ปุ่มพื้นหลัง" buttonBg: "ปุ่มพื้นหลัง"

View File

@ -1290,9 +1290,6 @@ _theme:
infoFg: "Текст інформації" infoFg: "Текст інформації"
infoWarnBg: "Фон попередження" infoWarnBg: "Фон попередження"
infoWarnFg: "Текст попередження" infoWarnFg: "Текст попередження"
cwBg: "Фон чутливого змісту"
cwFg: "Текст чутливого змісту"
cwHoverBg: "Фон чутливого змісту (при наведенні)"
toastBg: "Фон повідомлення" toastBg: "Фон повідомлення"
toastFg: "Текст повідомлення" toastFg: "Текст повідомлення"
buttonBg: "Фон кнопки" buttonBg: "Фон кнопки"

View File

@ -1467,9 +1467,6 @@ _theme:
infoFg: "Chữ thông tin" infoFg: "Chữ thông tin"
infoWarnBg: "Nền cảnh báo" infoWarnBg: "Nền cảnh báo"
infoWarnFg: "Chữ cảnh báo" infoWarnFg: "Chữ cảnh báo"
cwBg: "Nền nút nội dung ẩn"
cwFg: "Chữ nút nội dung ẩn"
cwHoverBg: "Nền nút nội dung ẩn (Chạm)"
toastBg: "Nền thông báo" toastBg: "Nền thông báo"
toastFg: "Chữ thông báo" toastFg: "Chữ thông báo"
buttonBg: "Nền nút" buttonBg: "Nền nút"

View File

@ -1673,9 +1673,6 @@ _theme:
infoFg: "信息文本" infoFg: "信息文本"
infoWarnBg: "警告背景" infoWarnBg: "警告背景"
infoWarnFg: "警告文本" infoWarnFg: "警告文本"
cwBg: "隐藏内容按钮背景"
cwFg: "隐藏内容按钮文本"
cwHoverBg: "隐藏内容按钮背景(悬停)"
toastBg: "Toast 通知背景" toastBg: "Toast 通知背景"
toastFg: "Toast 通知文本" toastFg: "Toast 通知文本"
buttonBg: "按钮背景" buttonBg: "按钮背景"

View File

@ -1685,9 +1685,6 @@ _theme:
infoFg: "資訊內容" infoFg: "資訊內容"
infoWarnBg: "警告背景" infoWarnBg: "警告背景"
infoWarnFg: "警告文字" infoWarnFg: "警告文字"
cwBg: "隱藏內容按鈕背景"
cwFg: "隱藏內容按鈕文字"
cwHoverBg: "隱藏內容按鈕背景(懸浮)"
toastBg: "通知背景" toastBg: "通知背景"
toastFg: "通知文本" toastFg: "通知文本"
buttonBg: "按鈕背景" buttonBg: "按鈕背景"

View File

@ -94,7 +94,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
] = me ? await Promise.all([ ] = me ? await Promise.all([
this.cacheService.userMutingsCache.fetch(me.id), this.cacheService.userMutingsCache.fetch(me.id),
]) : [new Set<string>()]; ]) : [new Set<string>()];
console.log(userIdsWhoMeMuting)
let noteIds = await this.redisTimelineService.get(`channelTimeline:${channel.id}`, untilId, sinceId); let noteIds = await this.redisTimelineService.get(`channelTimeline:${channel.id}`, untilId, sinceId);
noteIds = noteIds.slice(0, ps.limit); noteIds = noteIds.slice(0, ps.limit);

View File

@ -77,6 +77,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const untilId = ps.untilId ?? (ps.untilDate ? this.idService.genId(new Date(ps.untilDate!)) : null); const untilId = ps.untilId ?? (ps.untilDate ? this.idService.genId(new Date(ps.untilDate!)) : null);
const sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.genId(new Date(ps.sinceDate!)) : null); const sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.genId(new Date(ps.sinceDate!)) : null);
const isRangeSpecified = untilId != null && sinceId != null; const isRangeSpecified = untilId != null && sinceId != null;
const isSelf = me && (me.id === ps.userId);
if (isRangeSpecified || sinceId == null) { if (isRangeSpecified || sinceId == null) {
const [ const [
@ -100,7 +101,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
noteIds = noteIds.slice(0, ps.limit); noteIds = noteIds.slice(0, ps.limit);
if (noteIds.length > 0) { if (noteIds.length > 0) {
const isFollowing = me ? me.id === ps.userId || Object.hasOwn(await this.cacheService.userFollowingsCache.fetch(me.id), ps.userId) : false; const isFollowing = me && Object.hasOwn(await this.cacheService.userFollowingsCache.fetch(me.id), ps.userId);
const query = this.notesRepository.createQueryBuilder('note') const query = this.notesRepository.createQueryBuilder('note')
.where('note.id IN (:...noteIds)', { noteIds: noteIds }) .where('note.id IN (:...noteIds)', { noteIds: noteIds })
@ -122,8 +123,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
} }
} }
if (note.channel?.isSensitive && !isSelf) return false;
if (note.visibility === 'specified' && (!me || (me.id !== note.userId && !note.visibleUserIds.some(v => v === me.id)))) return false; if (note.visibility === 'specified' && (!me || (me.id !== note.userId && !note.visibleUserIds.some(v => v === me.id)))) return false;
if (note.visibility === 'followers' && !isFollowing) return false; if (note.visibility === 'followers' && !isFollowing && !isSelf) return false;
return true; return true;
}); });

View File

@ -10,15 +10,18 @@ SPDX-License-Identifier: AGPL-3.0-only
<div :class="$style.root"> <div :class="$style.root">
<MkLoading v-if="fetching"/> <MkLoading v-if="fetching"/>
<div v-if="!fetching && files.length > 0" :class="$style.stream"> <div v-if="!fetching && files.length > 0" :class="$style.stream">
<MkA <template v-for="file in files" :key="file.note.id + file.file.id">
v-for="file in files" <div v-if="file.file.isSensitive && !showingFiles.includes(file.file.id)" :class="$style.sensitive" @click="showingFiles.push(file.file.id)">
:key="file.note.id + file.file.id" <div>
:class="$style.img" <div><i class="ti ti-eye-exclamation"></i> {{ i18n.ts.sensitive }}</div>
:to="notePage(file.note)" <div>{{ i18n.ts.clickToShow }}</div>
> </div>
<!-- TODO: 画像以外のファイルに対応 --> </div>
<ImgWithBlurhash :hash="file.file.blurhash" :src="thumbnail(file.file)" :title="file.file.name"/> <MkA v-else :class="$style.img" :to="notePage(file.note)">
</MkA> <!-- TODO: 画像以外のファイルに対応 -->
<ImgWithBlurhash :hash="file.file.blurhash" :src="thumbnail(file.file)" :title="file.file.name"/>
</MkA>
</template>
</div> </div>
<p v-if="!fetching && files.length == 0" :class="$style.empty">{{ i18n.ts.nothing }}</p> <p v-if="!fetching && files.length == 0" :class="$style.empty">{{ i18n.ts.nothing }}</p>
</div> </div>
@ -45,6 +48,7 @@ let files = $ref<{
note: Misskey.entities.Note; note: Misskey.entities.Note;
file: Misskey.entities.DriveFile; file: Misskey.entities.DriveFile;
}[]>([]); }[]>([]);
let showingFiles = $ref<string[]>([]);
function thumbnail(image: Misskey.entities.DriveFile): string { function thumbnail(image: Misskey.entities.DriveFile): string {
return defaultStore.state.disableShowingAnimatedImages return defaultStore.state.disableShowingAnimatedImages
@ -96,4 +100,9 @@ onMounted(() => {
padding: 16px; padding: 16px;
text-align: center; text-align: center;
} }
.sensitive {
display: grid;
place-items: center;
}
</style> </style>