aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/nostr.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/nostr.js b/lib/nostr.js
index fdea9d62..2eb59ae7 100644
--- a/lib/nostr.js
+++ b/lib/nostr.js
@@ -1,6 +1,6 @@
import config from "$config";
import { Relay, RelayPool } from "nostr";
-import { broadcast } from "$lib/sockets";
+import { broadcast, emit } from "$lib/sockets";
import store from "$lib/store";
import { g, s, db } from "$lib/db";
import { nada, wait } from "$lib/utils";
@@ -40,6 +40,13 @@ export let fillPool = () => {
// coinos.send(["EVENT", ev]);
ev.user = await getUser(pubkey);
// broadcast("event", ev);
+
+ if (ev.kind === 4) {
+ let uid = await g(`user:${ev.tags[0][1]}`);
+ if (uid) ev.recipient = await g(`user:${uid}`);
+ ev.author = ev.user;
+ emit(uid, "event", ev);
+ }
}
} else if (sub.includes("profile")) {
let { pubkey } = ev;