MCPcopy Create free account
hub / github.com/MemTensor/MemOS / notifyAdmins

Method notifyAdmins

packages/memos-core/src/hub/server.ts:1077–1087  ·  view source on GitHub ↗
(type: string, resource: string, title: string, fromUserId: string, opts?: { dedup?: boolean; deduoWindowMs?: number })

Source from the content-addressed store, hash-verified

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 {

Callers 2

handleMethod · 0.95
checkOfflineUsersMethod · 0.95

Calls 4

filterMethod · 0.80
listHubUsersMethod · 0.45
insertHubNotificationMethod · 0.45

Tested by

no test coverage detected