mirror of
https://github.com/BillyOutlast/drop.git
synced 2026-02-04 00:31:17 +01:00
fix: apply notification acls to live notifications
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user