This commit is contained in:
Daniel Lugo 2020-02-12 15:13:38 -04:00
parent 4614ed599d
commit aafdcc37da

View file

@ -11,6 +11,7 @@ const Streams = require('../streams')
* @typedef {(reqs: SimpleReceivedRequest[]) => void} Listener * @typedef {(reqs: SimpleReceivedRequest[]) => void} Listener
*/ */
/** @type {Set<Listener>} */
const listeners = new Set() const listeners = new Set()
/** @type {SimpleReceivedRequest[]} */ /** @type {SimpleReceivedRequest[]} */
@ -30,16 +31,17 @@ const react = () => {
const pubToDn = Streams.getPubToDn() const pubToDn = Streams.getPubToDn()
for (const [id, req] of Object.entries(currentNode)) { for (const [id, req] of Object.entries(currentNode)) {
// HERE
const notAccepted = typeof pubToIncoming[req.from] === 'undefined' const notAccepted = typeof pubToIncoming[req.from] === 'undefined'
if (notAccepted) { if (notAccepted) {
if (typeof pubToAvatar[req.from] === 'undefined') { if (typeof pubToAvatar[req.from] === 'undefined') {
// eslint-disable-next-line no-empty-function // eslint-disable-next-line no-empty-function
Streams.onAvatar(() => {}, req.from) Streams.onAvatar(() => {}, req.from)()
} }
if (typeof pubToDn[req.from] === 'undefined') { if (typeof pubToDn[req.from] === 'undefined') {
// eslint-disable-next-line no-empty-function // eslint-disable-next-line no-empty-function
Streams.onDisplayName(() => {}, req.from) Streams.onDisplayName(() => {}, req.from)()
} }
finalReqs.push({ finalReqs.push({
@ -59,7 +61,6 @@ const react = () => {
} }
/** /**
*
* @param {string} addr * @param {string} addr
* @returns {(data: import('../SimpleGUN').OpenListenerData) => void} * @returns {(data: import('../SimpleGUN').OpenListenerData) => void}
*/ */