From 7d5a9b5a8f82fc4b6c2849dfb5b7f27a2b54a912 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 2 Nov 2022 19:58:00 -0700 Subject: set with_id --- lib/sendInternal.js | 5 +++-- lib/sockets.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/sendInternal.js b/lib/sendInternal.js index 3090e94a..640587b5 100644 --- a/lib/sendInternal.js +++ b/lib/sendInternal.js @@ -139,7 +139,8 @@ export default async ( hash: `#${v4().substr(0, 6)} Payment from ${user.username}`, memo, network: "COINOS", - received: true + received: true, + with_id: user.id }; if (invoice) { @@ -194,7 +195,7 @@ export default async ( hash: `#${v4().substr(0, 6)} ${ username ? `Payment to ${username}` : "Internal Transfer" }`, - network: "COINOS" + network: "COINOS", }; if (!username) { diff --git a/lib/sockets.js b/lib/sockets.js index 87cf7116..fb007a17 100644 --- a/lib/sockets.js +++ b/lib/sockets.js @@ -85,7 +85,7 @@ app.register(async function(app) { switch (type) { case "heartbeat": ws.beats = 0; - if (ws.user) emit(ws.user.username, "id", ws.id); + ws.send(JSON.stringify({ type: "id", data: ws.id })); break; case "login": -- cgit v1.2.3