Merge remote-branch 'misskey/develop'

This commit is contained in:
NoriDev 2023-10-12 15:46:40 +09:00
commit 517e26dc0f
6 changed files with 64 additions and 55 deletions

View file

@ -16,6 +16,9 @@
### General
- Enhance: ローカルタイムライン、ソーシャルタイムラインで返信を含むかどうか設定可能に
### Client
- Fix: 絵文字ピッカーで横に長いカスタム絵文字が見切れる問題を修正
### Server
- Fix: フォローしているユーザーからの自分の投稿への返信がタイムラインに含まれない問題を修正
- Fix: users/notesでセンシティブチャンネルの投稿が含まれる場合がある問題を修正

View file

@ -2230,3 +2230,11 @@ _moderationLogTypes:
createAd: "建立廣告"
deleteAd: "刪除廣告"
updateAd: "更新廣告"
_fileViewer:
title: "檔案詳細資訊"
type: "檔案類型 "
size: "檔案大小"
url: "URL"
uploadedAt: "加入日期"
attachedNotes: "含有附件的貼文"
thisPageCanBeSeenFromTheAuthor: "本頁面僅限上傳了這個檔案的使用者可以檢視。"

View file

@ -1,7 +1,7 @@
{
"name": "cherrypick",
"version": "4.3.3",
"basedMisskeyVersion": "2023.10.0",
"basedMisskeyVersion": "2023.10.1",
"codename": "nasubi",
"repository": {
"type": "git",

View file

@ -96,15 +96,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
if (ps.withFiles) {
noteIds = await this.redisTimelineService.get('localTimelineWithFiles', untilId, sinceId);
} else if (ps.withReplies) {
} else {
const [nonReplyNoteIds, replyNoteIds] = await this.redisTimelineService.getMulti([
'localTimeline',
'localTimelineWithReplies',
], untilId, sinceId);
noteIds = Array.from(new Set([...nonReplyNoteIds, ...replyNoteIds]));
noteIds.sort((a, b) => a > b ? -1 : 1);
} else {
noteIds = await this.redisTimelineService.get('localTimeline', untilId, sinceId);
}
noteIds = noteIds.slice(0, ps.limit);
@ -132,6 +130,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
if (me && (note.userId === me.id)) {
return true;
}
if (!ps.withReplies && note.replyId && (me == null || note.replyUserId !== me.id)) return false;
if (me && isUserRelated(note, userIdsWhoBlockingMe)) return false;
if (me && isUserRelated(note, userIdsWhoMeMuting)) return false;
if (note.renoteId) {

View file

@ -19,7 +19,7 @@ function genHost() {
}
function waitForPushToTl() {
return sleep(300);
return sleep(500);
}
let app: INestApplicationContext;
@ -41,7 +41,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true);
assert.strictEqual(res.body.find((note: any) => note.id === aliceNote.id).text, 'hi');
@ -57,7 +57,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false);
@ -73,7 +73,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
assert.strictEqual(res.body.find((note: any) => note.id === bobNote.id).text, 'hi');
@ -90,7 +90,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false);
@ -107,7 +107,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false);
@ -124,7 +124,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false);
@ -141,7 +141,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false);
@ -159,7 +159,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), true);
@ -178,7 +178,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), true);
@ -194,7 +194,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote1.id), true);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote2.id), true);
@ -210,7 +210,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
@ -224,7 +224,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true);
@ -240,7 +240,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false);
@ -291,7 +291,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
});
@ -307,7 +307,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false);
@ -325,7 +325,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false);
@ -340,7 +340,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
});
@ -354,7 +354,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
});
@ -375,7 +375,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', { withFiles: true }, alice);
const res = await api('/notes/timeline', { limit: 100, withFiles: true }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote1.id), false);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote2.id), true);
@ -393,7 +393,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
});
@ -405,7 +405,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true);
assert.strictEqual(res.body.find((note: any) => note.id === aliceNote.id).text, 'hi');
@ -420,7 +420,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
assert.strictEqual(res.body.find((note: any) => note.id === bobNote.id).text, 'hi');
@ -433,7 +433,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
});
@ -447,7 +447,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
});
@ -460,7 +460,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true);
assert.strictEqual(res.body.find((note: any) => note.id === aliceNote.id).text, 'ok');
@ -475,7 +475,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
assert.strictEqual(res.body.find((note: any) => note.id === bobNote.id).text, 'ok');
@ -491,7 +491,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/timeline', {}, alice);
const res = await api('/notes/timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
});
@ -506,7 +506,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/local-timeline', {}, alice);
const res = await api('/notes/local-timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false);
@ -520,7 +520,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/local-timeline', {}, alice);
const res = await api('/notes/local-timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), true);
@ -534,7 +534,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/local-timeline', {}, alice);
const res = await api('/notes/local-timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
});
@ -546,7 +546,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/local-timeline', {}, alice);
const res = await api('/notes/local-timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
});
@ -562,7 +562,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/local-timeline', {}, alice);
const res = await api('/notes/local-timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false);
@ -578,7 +578,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/local-timeline', {}, alice);
const res = await api('/notes/local-timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false);
@ -595,7 +595,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/local-timeline', {}, alice);
const res = await api('/notes/local-timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false);
@ -613,13 +613,12 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/local-timeline', {}, alice);
const res = await api('/notes/local-timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false);
});
/*
test.concurrent('withReplies: false でフォローしているユーザーからの自分への返信が含まれる', async () => {
const [alice, bob] = await Promise.all([signup(), signup()]);
@ -630,12 +629,11 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/local-timeline', {}, alice);
const res = await api('/notes/local-timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
});
*/
test.concurrent('[withReplies: true] 他人の他人への返信が含まれる', async () => {
const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]);
@ -645,7 +643,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/local-timeline', { withReplies: true }, alice);
const res = await api('/notes/local-timeline', { limit: 100, withReplies: true }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
});
@ -659,7 +657,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/local-timeline', { withFiles: true }, alice);
const res = await api('/notes/local-timeline', { limit: 100, withFiles: true }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote1.id), false);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote2.id), true);
@ -674,7 +672,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/hybrid-timeline', {}, alice);
const res = await api('/notes/hybrid-timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
});
@ -686,7 +684,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/hybrid-timeline', {}, alice);
const res = await api('/notes/hybrid-timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
});
@ -700,7 +698,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/hybrid-timeline', {}, alice);
const res = await api('/notes/hybrid-timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
});
@ -715,7 +713,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/hybrid-timeline', {}, alice);
const res = await api('/notes/hybrid-timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
@ -742,7 +740,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/local-timeline', {}, alice);
const res = await api('/notes/local-timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
});
@ -756,7 +754,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/hybrid-timeline', {}, alice);
const res = await api('/notes/hybrid-timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
});
@ -770,7 +768,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/hybrid-timeline', {}, alice);
const res = await api('/notes/hybrid-timeline', { limit: 100 }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
});
@ -783,10 +781,9 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/hybrid-timeline', { withReplies: true }, alice);
const res = await api('/notes/hybrid-timeline', { limit: 100, withReplies: true }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), true);
});
test.concurrent('[withFiles: true] ファイル付きノートのみ含まれる', async () => {
@ -798,7 +795,7 @@ describe('Timelines', () => {
await waitForPushToTl();
const res = await api('/notes/hybrid-timeline', { withFiles: true }, alice);
const res = await api('/notes/hybrid-timeline', { limit: 100, withFiles: true }, alice);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote1.id), false);
assert.strictEqual(res.body.some((note: any) => note.id === bobNote2.id), true);

View file

@ -616,6 +616,8 @@ defineExpose({
height: 1.25em;
vertical-align: -.25em;
pointer-events: none;
width: 100%;
object-fit: contain;
}
}
}