Skip to content
Snippets Groups Projects
Commit 712af44d authored by dakkar's avatar dakkar
Browse files

merge: don't send real-time updates of replies to blocked users #457 #573 (!566)

View MR for information: TransFem-org/Sharkey!566



Approved-by: default avatarTess K <me@thvxl.se>
Approved-by: default avatarfEmber <acomputerdog@gmail.com>
parents f936db05 f086bc23
No related branches found
No related tags found
No related merge requests found
......@@ -135,6 +135,7 @@ export interface NoteEventTypes {
};
replied: {
id: MiNote['id'];
userId: MiUser['id'];
};
}
type NoteStreamEventTypes = {
......
......@@ -831,6 +831,7 @@ export class NoteCreateService implements OnApplicationShutdown {
if (data.reply) {
this.globalEventService.publishNoteStream(data.reply.id, 'replied', {
id: note.id,
userId: user.id,
});
// 通知
if (data.reply.userHost === null) {
......
......@@ -201,6 +201,18 @@ export default class Connection {
@bindThis
private async onNoteStreamMessage(data: GlobalEvents['note']['payload']) {
// we must not send to the frontend information about notes from
// users who blocked the logged-in user, even when they're replies
// to notes the logged-in user can see
if (data.type === 'replied') {
const noteUserId = data.body.body.userId;
if (noteUserId !== null) {
if (this.userIdsWhoBlockingMe.has(noteUserId)) {
return;
}
}
}
this.sendMessageToWs('noteUpdated', {
id: data.body.id,
type: data.type,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment