Skip to content

Commit

Permalink
Release: 0.5.2 (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
kozakura913 authored Aug 14, 2024
2 parents 647a5fb + 6278b1c commit 5356825
Show file tree
Hide file tree
Showing 18 changed files with 186 additions and 21 deletions.
25 changes: 24 additions & 1 deletion CHANGELOG_yojo.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,29 @@

### Misc


## 0.5.2
Cherrypick 4.10.0-rc.3

### Release Date
2024-08-15

### General
-

### Client
- Enhance:メンションや引用、返信の通知も削除できるように [#314](https://github.com/yojo-art/cherrypick/pull/314)
- Fix:デッキモードで通知カラムがあるとリロードするたびに毎回通知を消すか聞かれる問題を修正 [#314](https://github.com/yojo-art/cherrypick/pull/314)
- Fix:通知を全削除できない問題を修正 [#314](https://github.com/yojo-art/cherrypick/pull/314)
- Fix:通知ポップアップにも通知削除ボタンが表示される [#314](https://github.com/yojo-art/cherrypick/pull/314)
- Fix: MFMでURLの表示文字列を変更した時にリモートクリップURLが書き換えられない [#324](https://github.com/yojo-art/cherrypick/pull/324)
- Enhance: リモートクリップのURLプレビューをリモートURLで生成 [#324](https://github.com/yojo-art/cherrypick/pull/324)

### Server
- Fix:withCats(ネコミミ付きのみのstreaming)がフィルタされていない問題を修正 [#323](https://github.com/yojo-art/cherrypick/pull/323)

### Misc

## 0.5.1
Cherrypick 4.10.0-rc.3

Expand All @@ -43,7 +66,7 @@ Cherrypick 4.10.0-rc.3
-

### Server
- Fix: APリクエストannounceNoteを受け取れない問題を修正
- Fix: APリクエストannounceNoteを受け取れない問題を修正 [#310](https://github.com/yojo-art/cherrypick/pull/310)

### Misc

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cherrypick",
"version": "4.10.0-rc.3-yojo0.5.1",
"version": "4.10.0-rc.3-yojo0.5.2",
"basedMisskeyVersion": "2024.7.0",
"codename": "nasubi",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class GlobalTimelineChannel extends Channel {
public static requireCredential = false as const;
private withRenotes: boolean;
private withFiles: boolean;
private withCats: boolean;

constructor(
private metaService: MetaService,
Expand All @@ -39,6 +40,7 @@ class GlobalTimelineChannel extends Channel {

this.withRenotes = !!(params.withRenotes ?? true);
this.withFiles = !!(params.withFiles ?? false);
this.withCats = !!(params.withCats ?? false);

// Subscribe events
this.subscriber.on('notesStream', this.onNote);
Expand All @@ -47,6 +49,7 @@ class GlobalTimelineChannel extends Channel {
@bindThis
private async onNote(note: Packed<'Note'>) {
if (this.withFiles && (note.fileIds == null || note.fileIds.length === 0)) return;
if (this.withCats && (note.user.isCat == null || note.user.isCat === false)) return;

if (note.visibility !== 'public') return;
if (note.channelId != null) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class HomeTimelineChannel extends Channel {
public static kind = 'read:account';
private withRenotes: boolean;
private withFiles: boolean;
private withCats: boolean;

constructor(
private noteEntityService: NoteEntityService,
Expand All @@ -33,6 +34,7 @@ class HomeTimelineChannel extends Channel {
public async init(params: JsonObject) {
this.withRenotes = !!(params.withRenotes ?? true);
this.withFiles = !!(params.withFiles ?? false);
this.withCats = !!(params.withCats ?? false);

this.subscriber.on('notesStream', this.onNote);
}
Expand All @@ -42,6 +44,7 @@ class HomeTimelineChannel extends Channel {
const isMe = this.user!.id === note.userId;

if (this.withFiles && (note.fileIds == null || note.fileIds.length === 0)) return;
if (this.withCats && (note.user.isCat == null || note.user.isCat === false)) return;

if (note.channelId) {
if (!this.followingChannels.has(note.channelId)) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class HybridTimelineChannel extends Channel {
private withRenotes: boolean;
private withReplies: boolean;
private withFiles: boolean;
private withCats: boolean;

constructor(
private metaService: MetaService,
Expand All @@ -42,6 +43,7 @@ class HybridTimelineChannel extends Channel {
this.withRenotes = !!(params.withRenotes ?? true);
this.withReplies = !!(params.withReplies ?? false);
this.withFiles = !!(params.withFiles ?? false);
this.withCats = !!(params.withCats ?? false);

// Subscribe events
this.subscriber.on('notesStream', this.onNote);
Expand All @@ -52,6 +54,7 @@ class HybridTimelineChannel extends Channel {
const isMe = this.user!.id === note.userId;

if (this.withFiles && (note.fileIds == null || note.fileIds.length === 0)) return;
if (this.withCats && (note.user.isCat == null || note.user.isCat === false)) return;

// チャンネルの投稿ではなく、自分自身の投稿 または
// チャンネルの投稿ではなく、その投稿のユーザーをフォローしている または
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class LocalTimelineChannel extends Channel {
private withRenotes: boolean;
private withReplies: boolean;
private withFiles: boolean;
private withCats: boolean;

constructor(
private metaService: MetaService,
Expand All @@ -41,6 +42,7 @@ class LocalTimelineChannel extends Channel {
this.withRenotes = !!(params.withRenotes ?? true);
this.withReplies = !!(params.withReplies ?? false);
this.withFiles = !!(params.withFiles ?? false);
this.withCats = !!(params.withCats ?? false);

// Subscribe events
this.subscriber.on('notesStream', this.onNote);
Expand All @@ -49,6 +51,7 @@ class LocalTimelineChannel extends Channel {
@bindThis
private async onNote(note: Packed<'Note'>) {
if (this.withFiles && (note.fileIds == null || note.fileIds.length === 0)) return;
if (this.withCats && (note.user.isCat == null || note.user.isCat === false)) return;

if (note.user.host !== null) return;
if (note.visibility !== 'public') return;
Expand Down
111 changes: 111 additions & 0 deletions packages/backend/test/e2e/streaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,33 @@ describe('Streaming', () => {
assert.strictEqual(fired, true);
});

test('withCats: true のときノートが流れる', async () => {
await api('i/update', {
isCat: true,
}, kyoko);
const fired = await waitFire(
ayano, 'homeTimeline', // ayano:home
() => api('notes/create', { text: 'meow' }, kyoko), // cat kyoko note
msg => msg.type === 'note' && msg.body.userId === kyoko.id, // wait kyoko
{ withCats: true },
);

assert.strictEqual(fired, true);
await api('i/update', {
isCat: false,
}, kyoko);
});

test('withCats: true のときノートが流れない', async () => {
const fired = await waitFire(
ayano, 'homeTimeline', // ayano:home
() => api('notes/create', { text: 'test' }, kyoko), // kyoko note
msg => msg.type === 'note' && msg.body.userId === kyoko.id, // wait kyoko
{ withCats: true },
);

assert.strictEqual(fired, false);
});
test('withReplies: true のとき自分のfollowers投稿に対するリプライが流れる', async () => {
const erinNote = await post(erin, { text: 'hi', visibility: 'followers' });
const fired = await waitFire(
Expand Down Expand Up @@ -401,6 +428,34 @@ describe('Streaming', () => {

assert.strictEqual(fired, false);
});

test('withCats: true のときノートが流れる', async () => {
await api('i/update', {
isCat: true,
}, kyoko);
const fired = await waitFire(
ayano, 'homeTimeline', // ayano:home
() => api('notes/create', { text: 'meow' }, kyoko), // cat kyoko note
msg => msg.type === 'note' && msg.body.userId === kyoko.id, // wait kyoko
{ withCats: true },
);

assert.strictEqual(fired, true);
await api('i/update', {
isCat: false,
}, kyoko);
});

test('withCats: true のときノートが流れない', async () => {
const fired = await waitFire(
ayano, 'homeTimeline', // ayano:home
() => api('notes/create', { text: 'test' }, kyoko), // kyoko note
msg => msg.type === 'note' && msg.body.userId === kyoko.id, // wait kyoko
{ withCats: true },
);

assert.strictEqual(fired, false);
});
});

describe('Hybrid Timeline', () => {
Expand Down Expand Up @@ -537,6 +592,34 @@ describe('Streaming', () => {

assert.strictEqual(fired, false);
});

test('withCats: true のときノートが流れる', async () => {
await api('i/update', {
isCat: true,
}, kyoko);
const fired = await waitFire(
ayano, 'homeTimeline', // ayano:home
() => api('notes/create', { text: 'meow' }, kyoko), // cat kyoko note
msg => msg.type === 'note' && msg.body.userId === kyoko.id, // wait kyoko
{ withCats: true },
);

assert.strictEqual(fired, true);
await api('i/update', {
isCat: false,
}, kyoko);
});

test('withCats: true のときノートが流れない', async () => {
const fired = await waitFire(
ayano, 'homeTimeline', // ayano:home
() => api('notes/create', { text: 'test' }, kyoko), // kyoko note
msg => msg.type === 'note' && msg.body.userId === kyoko.id, // wait kyoko
{ withCats: true },
);

assert.strictEqual(fired, false);
});
});

describe('Global Timeline', () => {
Expand Down Expand Up @@ -581,6 +664,34 @@ describe('Streaming', () => {

assert.strictEqual(fired, true);
});

test('withCats: true のときノートが流れる', async () => {
await api('i/update', {
isCat: true,
}, kyoko);
const fired = await waitFire(
ayano, 'homeTimeline', // ayano:home
() => api('notes/create', { text: 'meow' }, kyoko), // cat kyoko note
msg => msg.type === 'note' && msg.body.userId === kyoko.id, // wait kyoko
{ withCats: true },
);

assert.strictEqual(fired, true);
await api('i/update', {
isCat: false,
}, kyoko);
});

test('withCats: true のときノートが流れない', async () => {
const fired = await waitFire(
ayano, 'homeTimeline', // ayano:home
() => api('notes/create', { text: 'test' }, kyoko), // kyoko note
msg => msg.type === 'note' && msg.body.userId === kyoko.id, // wait kyoko
{ withCats: true },
);

assert.strictEqual(fired, false);
});
});

describe('UserList Timeline', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cherrypick-js/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "module",
"name": "cherrypick-js",
"version": "4.10.0-rc.3-yojo0.5.1",
"version": "4.10.0-rc.3-yojo0.5.2",
"basedMisskeyVersion": "2024.7.0",
"description": "CherryPick SDK for JavaScript",
"license": "MIT",
Expand Down
13 changes: 10 additions & 3 deletions packages/frontend/src/components/MkLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ SPDX-License-Identifier: AGPL-3.0-only

<template>
<component
:is="self ? 'MkA' : 'a'" ref="el" style="word-break: break-all;" class="_link" :[attr]="self ? url.substring(local.length) : url" :rel="rel ?? 'nofollow noopener'" :target="target"
:is="self ? 'MkA' : 'a'" ref="el" style="word-break: break-all;" class="_link" :[attr]="self ? url_string.substring(local.length) : url_string" :rel="rel ?? 'nofollow noopener'" :target="target"
:behavior="props.navigationBehavior"
:title="url"
:title="url_string"
@click.stop
>
<slot></slot>
Expand All @@ -27,10 +27,17 @@ const props = withDefaults(defineProps<{
url: string;
rel?: null | string;
navigationBehavior?: MkABehavior;
host?: null | string;
}>(), {
});

const self = props.url.startsWith(local);
let self = props.url.startsWith(local);
let requestUrl = new URL(props.url);
if (props.host === requestUrl.host && requestUrl.pathname.startsWith('/clips/')) {
requestUrl = new URL(local + requestUrl.pathname + '@' + props.host);
self = true;
}
const url_string = requestUrl.toString();
const attr = self ? 'to' : 'href';
const target = self ? null : '_blank';

Expand Down
3 changes: 2 additions & 1 deletion packages/frontend/src/components/MkNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div v-if="appearNote.channel" :class="$style.colorBar" :style="{ background: appearNote.channel.color }"></div>
<MkAvatar v-if="!defaultStore.state.hideAvatarsInNote" :class="[$style.avatar, { [$style.avatarReplyTo]: appearNote.reply, [$style.showEl]: !appearNote.reply && (showEl && ['hideHeaderOnly', 'hideHeaderFloatBtn', 'hide'].includes(<string>defaultStore.state.displayHeaderNavBarWhenScroll)) && mainRouter.currentRoute.value.name === 'index', [$style.showElTab]: !appearNote.reply && (showEl && ['hideHeaderOnly', 'hideHeaderFloatBtn', 'hide'].includes(<string>defaultStore.state.displayHeaderNavBarWhenScroll)) && mainRouter.currentRoute.value.name !== 'index' }]" :user="appearNote.user" :link="!mock" :preview="!mock" noteClick/>
<div :class="$style.main">
<MkNoteHeader :note="appearNote" :mini="true"/>
<MkNoteHeader :note="appearNote" :mini="true" :notificationId="notificationId"/>
</div>
</div>
<div style="container-type: inline-size;">
Expand Down Expand Up @@ -263,6 +263,7 @@ const props = withDefaults(defineProps<{
mock?: boolean;
withHardMute?: boolean;
notification?: boolean;
notificationId?: string;
}>(), {
mock: false,
});
Expand Down
11 changes: 10 additions & 1 deletion packages/frontend/src/components/MkNoteHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkA v-else :class="$style.time" :to="notePage(note)">
<MkTime :time="note.createdAt" :mode="defaultStore.state.enableAbsoluteTime ? 'absolute' : 'relative'" colored/>
</MkA>
<button v-if="notificationId" class="_button" style="margin-left: auto;" @click.stop="notificationDelete()">
<i class="ti ti-bell-x"></i>
</button>
</div>
<div :style="$style.info"><MkInstanceTicker v-if="showTicker" :instance="note.user.instance" @click.stop="showOnRemote"/></div>
</div>
Expand All @@ -57,9 +60,11 @@ import { userPage } from '@/filters/user.js';
import { defaultStore } from '@/store.js';
import { useRouter } from '@/router/supplier.js';
import MkInstanceTicker from '@/components/MkInstanceTicker.vue';
import { misskeyApi } from '@/scripts/misskey-api.js';

const props = defineProps<{
note: Misskey.entities.Note;
notificationId?: string;
}>();

const mock = inject<boolean>('mock', false);
Expand All @@ -69,9 +74,13 @@ const router = useRouter();

function showOnRemote() {
if (props.note.user.instance === undefined) router.push(notePage(props.note));
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
else window.open(props.note.url ?? props.note.uri, '_blank', 'noopener');
}

const notificationDelete = () => {
misskeyApi('notifications/delete', { notificationId: props.notificationId });
};
</script>

<style lang="scss" module>
Expand Down
Loading

0 comments on commit 5356825

Please sign in to comment.