diff --git a/services/gunDB/contact-api/streams/index.js b/services/gunDB/contact-api/streams/index.js index 248da93d..85c7834d 100644 --- a/services/gunDB/contact-api/streams/index.js +++ b/services/gunDB/contact-api/streams/index.js @@ -134,17 +134,15 @@ const onIncoming = cb => { return } - Object.entries(uti).forEach(async ([pub, feed]) => { - if (typeof feed !== 'string') { + Object.entries(uti).forEach(async ([pub, encFeed]) => { + if (typeof encFeed !== 'string') { return } + const ourSecret = await SEA.secret(await Utils.pubToEpub(pub), user._.sea) + + const feed = await SEA.decrypt(encFeed, ourSecret) if (pubFeedPairsWithIncomingListeners.add(pub + '--' + feed)) { - const ourSecret = await SEA.secret( - await Utils.pubToEpub(pub), - user._.sea - ) - require('../../Mediator') .getGun() .user(pub)