mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-29 01:13:02 +00:00
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/566 Approved-by: Tess K <me@thvxl.se> Approved-by: fEmber <acomputerdog@gmail.com>
This commit is contained in:
commit
712af44de4
3 changed files with 14 additions and 0 deletions
|
@ -135,6 +135,7 @@ export interface NoteEventTypes {
|
||||||
};
|
};
|
||||||
replied: {
|
replied: {
|
||||||
id: MiNote['id'];
|
id: MiNote['id'];
|
||||||
|
userId: MiUser['id'];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
type NoteStreamEventTypes = {
|
type NoteStreamEventTypes = {
|
||||||
|
|
|
@ -831,6 +831,7 @@ export class NoteCreateService implements OnApplicationShutdown {
|
||||||
if (data.reply) {
|
if (data.reply) {
|
||||||
this.globalEventService.publishNoteStream(data.reply.id, 'replied', {
|
this.globalEventService.publishNoteStream(data.reply.id, 'replied', {
|
||||||
id: note.id,
|
id: note.id,
|
||||||
|
userId: user.id,
|
||||||
});
|
});
|
||||||
// 通知
|
// 通知
|
||||||
if (data.reply.userHost === null) {
|
if (data.reply.userHost === null) {
|
||||||
|
|
|
@ -201,6 +201,18 @@ export default class Connection {
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
private async onNoteStreamMessage(data: GlobalEvents['note']['payload']) {
|
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', {
|
this.sendMessageToWs('noteUpdated', {
|
||||||
id: data.body.id,
|
id: data.body.id,
|
||||||
type: data.type,
|
type: data.type,
|
||||||
|
|
Loading…
Reference in a new issue