core: 优化钩子逻辑

This commit is contained in:
undefined committed 2020-09-06 11:31:49 +08:00
1 parent 03dc8903e2
commit f2f0212947
27 files changed
+205 -124

No files matched your search

+2 -2
View File
@@ -22,7 +22,7 @@ export async function send(
if (from !== to) {
// ENHANCE domainId?
const udoc = await user.getById('system', to);
bus.publish(`user_message-${to}`, { mdoc, udoc });
bus.boardcast('user/message', to, mdoc, udoc);
}
return mdoc;
}
@@ -69,7 +69,7 @@ function ensureIndexes() {
]);
}
global.Hydro.postInit.push(ensureIndexes);
bus.once('app/started', ensureIndexes);
global.Hydro.model.message = {
FLAG_UNREAD,
FLAG_ALERT,