add streaming events for renotemuting and blocking

This commit is contained in:
Chloe Kudryavtsev 2022-10-07 15:38:18 -04:00 committed by Gitea
parent 3d9df839a5
commit dd5100d124
6 changed files with 25 additions and 4 deletions

View file

@ -87,4 +87,6 @@ export default define(meta, paramDef, async (ps, user) => {
return await Users.pack(blockee.id, blocker, {
detail: true,
});
publishUserEvent(user.id, 'block', blockee);
});

View file

@ -83,4 +83,6 @@ export default define(meta, paramDef, async (ps, user) => {
return await Users.pack(blockee.id, blocker, {
detail: true,
});
publishUserEvent(user.id, 'unblock', blockee);
});

View file

@ -74,5 +74,5 @@ export default define(meta, paramDef, async (ps, user) => {
muteeId: mutee.id,
} as RenoteMuting);
// publishUserEvent(user.id, 'mute', mutee);
publishUserEvent(user.id, 'muteRenote', mutee);
});

View file

@ -69,5 +69,5 @@ export default define(meta, paramDef, async (ps, user) => {
id: exist.id,
});
// publishUserEvent(user.id, 'unmute', mutee);
publishUserEvent(user.id, 'unmuteRenote', mutee);
});

View file

@ -84,8 +84,21 @@ export default class Connection {
this.muting.delete(data.body.id);
break;
// TODO: renote mute events
// TODO: block events
case 'block':
this.blocking.add(data.body.id);
break;
case 'unblock':
this.blocking.delete(data.body.id);
break;
case 'muteRenote':
this.renoteMuting.add(data.body.id);
break;
case 'unmuteRenote':
this.renoteMuting.delete(data.body.id);
break;
case 'followChannel':
this.followingChannels.add(data.body.id);

View file

@ -44,6 +44,10 @@ export interface UserStreamTypes {
updateUserProfile: UserProfile;
mute: User;
unmute: User;
muteRenote: User;
unmuteRenote: User;
block: User;
unblock: User;
follow: Packed<'UserDetailedNotMe'>;
unfollow: Packed<'User'>;
userAdded: Packed<'User'>;