fix: apply notification acls to live notifications

This commit is contained in:
DecDuck
2025-05-15 14:57:16 +10:00
parent 1dba112bce
commit 1d141c117b

View File

@@ -58,8 +58,12 @@ class NotificationSystem {
}
private async pushNotification(userId: string, notification: Notification) {
for (const listener of this.listeners.get(userId) ?? []) {
await listener[1].callback(notification);
for (const [_, listener] of this.listeners.get(userId) ?? []) {
const hasSome =
notification.acls.findIndex(
(e) => listener.acls.findIndex((v) => v === e) != -1,
) != -1;
if (hasSome) await listener.callback(notification);
}
}