From d2dd75de0fb969f3c205994539237a6ef8acb5e6 Mon Sep 17 00:00:00 2001 From: Andre Staltz Date: Thu, 10 Aug 2023 10:55:18 +0300 Subject: [PATCH] use proper shse.pubkey --- lib/hub-observer.js | 2 +- lib/plugin-hub-client.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/hub-observer.js b/lib/hub-observer.js index 7618cf4..b9ee32b 100644 --- a/lib/hub-observer.js +++ b/lib/hub-observer.js @@ -165,7 +165,7 @@ module.exports = class HubObserver { */ #notifyNewAttendant(attendantPubkey, hubPubkey, hubName) { if (attendantPubkey === hubPubkey) return - if (attendantPubkey === this.#sstack.id) return + if (attendantPubkey === this.#local.shse.pubkey) return const address = this.#getAddress(attendantPubkey) this.#local.hubClient._notifyDiscoveredAttendant({ address, diff --git a/lib/plugin-hub-client.js b/lib/plugin-hub-client.js index ad3a68e..e08a10f 100644 --- a/lib/plugin-hub-client.js +++ b/lib/plugin-hub-client.js @@ -1,7 +1,6 @@ // @ts-ignore const DuplexPair = require('pull-pair/duplex') // @ts-ignore const Notify = require('pull-notify') -const bs58 = require('bs58') const debug = require('debug')('ppppp:hub-client') const makeTunnelPlugin = require('./ms-tunnel') const { ErrorDuplex } = require('./utils') @@ -52,8 +51,7 @@ module.exports = { */ connect(origin) { // @ts-ignore - // FIXME: this comes from secret-stack - const hub = bs58.encode(Buffer.from(this.id, 'base64')) + const hub = this.shse.pubkey debug('received hubClient.connect(%s) via hub %s', origin, hub) if (hubs.has(hub) && origin) { debug('connect() will resolve because handler exists')