fix(backend): thread mute did not suppress RN/Quote
This commit is contained in:
parent
d60c307c4e
commit
61f517a3d1
|
@ -656,13 +656,20 @@ export class NoteCreateService implements OnApplicationShutdown {
|
||||||
if (this.isRenote(data)) {
|
if (this.isRenote(data)) {
|
||||||
const type = this.isQuote(data) ? 'quote' : 'renote';
|
const type = this.isQuote(data) ? 'quote' : 'renote';
|
||||||
|
|
||||||
// Notify
|
|
||||||
if (data.renote.userHost === null) {
|
if (data.renote.userHost === null) {
|
||||||
|
const isThreadMuted = await this.noteThreadMutingsRepository.exists({
|
||||||
|
where: {
|
||||||
|
userId: data.renote.userId,
|
||||||
|
threadId: data.renote.threadId ?? data.renote.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!isThreadMuted) {
|
||||||
|
// Notify
|
||||||
nm.push(data.renote.userId, type);
|
nm.push(data.renote.userId, type);
|
||||||
}
|
|
||||||
|
|
||||||
// Publish event
|
// Publish event
|
||||||
if ((user.id !== data.renote.userId) && data.renote.userHost === null) {
|
if (user.id !== data.renote.userId) {
|
||||||
this.globalEventService.publishMainStream(data.renote.userId, 'renote', noteObj);
|
this.globalEventService.publishMainStream(data.renote.userId, 'renote', noteObj);
|
||||||
|
|
||||||
const webhooks = (await this.webhookService.getActiveWebhooks()).filter(x => x.userId === data.renote!.userId && x.on.includes('renote'));
|
const webhooks = (await this.webhookService.getActiveWebhooks()).filter(x => x.userId === data.renote!.userId && x.on.includes('renote'));
|
||||||
|
@ -673,6 +680,8 @@ export class NoteCreateService implements OnApplicationShutdown {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
nm.notify();
|
nm.notify();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue