mute-renotes #189

Merged
toast merged 6 commits from mute-renotes into main 2022-10-11 10:42:40 +00:00
Owner

Adds a button next to the button to mute users to mute their renotes.
Renotes are still visible in the profile of the user, and you still get notifications for posts of your own that the user renotes.
However, your timelines etc will no longer show their renotes.
This includes event streaming, and a fix to block event streaming (it's a tiny patch so I fixed it up while fixing up the mute-renote streaming - both are tested).

No changelog entry because the bulk of the patch already includes one, suggest ff-merge due to multiple authors.

Adds a button next to the button to mute users to mute their renotes. Renotes are still visible in the profile of the user, and you still get notifications for posts of your own that the user renotes. However, your timelines etc will no longer show their renotes. This includes event streaming, and a fix to block event streaming (it's a tiny patch so I fixed it up while fixing up the mute-renote streaming - both are tested). No changelog entry because the bulk of the patch already includes one, suggest ff-merge due to multiple authors.
toast added 5 commits 2022-10-09 13:21:52 +00:00
Changelog: Added
import publishUserEvent in mute renote APIs
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
36625f141f
Johann150 reviewed 2022-10-10 07:12:19 +00:00
@ -0,0 +2,4 @@
import { User } from '@/models/entities/user.js';
import { RenoteMutings } from '@/models/index.js';
export function generateMutedUserRenotesQueryForNotes(q: SelectQueryBuilder<any>, me: { id: User['id'] }): void {
Owner

I'm all for descriptive naming, but maybe this is overdoing it a bit? I think a bit shorter like generateMutedRenotesQuery would also be fine since renote implies that its from a user and for notes.

I'm all for descriptive naming, but maybe this is overdoing it a bit? I think a bit shorter like `generateMutedRenotesQuery` would also be fine since renote implies that its from a user and for notes.
toast marked this conversation as resolved
@ -0,0 +46,4 @@
export default define(meta, paramDef, async (ps, user) => {
const muter = user;
// 自分自身
Owner

Missed a Japanese comment here.

-	// 自分自身
+	// Check if the mutee is yourself
Missed a Japanese comment here. ```diff - // 自分自身 + // Check if the mutee is yourself ```
toast marked this conversation as resolved
toast added 1 commit 2022-10-10 08:20:02 +00:00
fixup: muted-renotes review round 1
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/pr/test Pipeline failed
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
451d739f4d
Owner

Seems to work on my local dev setup.

Like @Johann150 mentioned in IRC, if there's a way to avoid doing a select to check if an item to be deleted exists before performing the delete, that would be better performance-wise. Otherwise, this looks good to me.

Seems to work on my local dev setup. Like @Johann150 mentioned in IRC, if there's a way to avoid doing a select to check if an item to be deleted exists before performing the delete, that would be better performance-wise. Otherwise, this looks good to me.
Owner

I think the single query would be a task for another refactor, this is just copying code from the status quo.

I think the single query would be a task for another refactor, this is just copying code from the status quo.
norm approved these changes 2022-10-10 21:14:41 +00:00
toast merged commit 6d58d5ed3b into main 2022-10-11 10:42:40 +00:00
toast deleted branch mute-renotes 2022-10-11 10:42:40 +00:00
Sign in to join this conversation.
No reviewers
No labels
feature
fix
upkeep
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: FoundKeyGang/FoundKey#189
No description provided.