(type: string, resource: string, title: string, fromUserId: string, opts?: { dedup?: boolean; deduoWindowMs?: number })
| 1075 | } |
| 1076 | |
| 1077 | private notifyAdmins(type: string, resource: string, title: string, fromUserId: string, opts?: { dedup?: boolean; deduoWindowMs?: number }): void { |
| 1078 | try { |
| 1079 | const admins = this.opts.store.listHubUsers("active").filter(u => u.role === "admin" && u.id !== fromUserId); |
| 1080 | for (const admin of admins) { |
| 1081 | if (opts?.dedup && this.opts.store.hasRecentHubNotification(admin.id, type, resource, opts.deduoWindowMs ?? 300_000)) { |
| 1082 | continue; |
| 1083 | } |
| 1084 | this.opts.store.insertHubNotification({ id: randomUUID(), userId: admin.id, type, resource, title }); |
| 1085 | } |
| 1086 | } catch { /* best-effort */ } |
| 1087 | } |
| 1088 | |
| 1089 | private initOnlineTracking(): void { |
| 1090 | try { |
no test coverage detected