aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-02-16 22:43:43 -0800
committerAdam Soltys <[email protected]>2023-02-16 22:43:43 -0800
commitd01995b438fc2bde316f9cc7020c01d71cd9d288 (patch)
treea6d5cf9cec203b6c77cdf5f2b4baef2202baca60 /routes
parent8b9497ec3349a584c90d2ac782c634f7f328c19f (diff)
downloadcoinos-server-d01995b438fc2bde316f9cc7020c01d71cd9d288.tar.gz
coinos-server-d01995b438fc2bde316f9cc7020c01d71cd9d288.zip
emit messages
Diffstat (limited to 'routes')
-rw-r--r--routes/nostr.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/routes/nostr.js b/routes/nostr.js
index 47ceaa25..8d6f6c34 100644
--- a/routes/nostr.js
+++ b/routes/nostr.js
@@ -70,9 +70,13 @@ export default {
messages = await Promise.all(
messages.map(async id => {
let m = await g(`ev:${id}`);
- let k = m.pubkey === pubkey ? m.tags[0][1] : m.pubkey;
- let uid = await g(`user:${k}`);
- m.user = await g(`user:${uid}`);
+
+ let aid = await g(`user:${m.pubkey}`);
+ m.author = await g(`user:${aid}`);
+
+ let rid = await g(`user:${m.tags[0][1]}`);
+ m.recipient = await g(`user:${rid}`);
+
return m;
})
);