From a188639ff0a68c4527730fda6000574ff97f908b Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Thu, 30 Jan 2020 08:32:13 -0400 Subject: [PATCH] refresh avatar/display names --- services/gunDB/contact-api/events/onReceivedReqs.js | 9 +++++++++ services/gunDB/contact-api/events/onSentReqs.js | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/services/gunDB/contact-api/events/onReceivedReqs.js b/services/gunDB/contact-api/events/onReceivedReqs.js index 659a8300..7f7b1f8f 100644 --- a/services/gunDB/contact-api/events/onReceivedReqs.js +++ b/services/gunDB/contact-api/events/onReceivedReqs.js @@ -43,6 +43,15 @@ const react = () => { const notAccepted = typeof pubToIncoming[req.from] === 'undefined' if (notAccepted) { + if (typeof pubToAvatar[req.from] === 'undefined') { + // eslint-disable-next-line no-empty-function + Streams.onAvatar(() => {}, req.from) + } + if (typeof pubToDn[req.from] === 'undefined') { + // eslint-disable-next-line no-empty-function + Streams.onDisplayName(() => {}, req.from) + } + finalReqs.push({ id, requestorAvatar: pubToAvatar[req.from] || null, diff --git a/services/gunDB/contact-api/events/onSentReqs.js b/services/gunDB/contact-api/events/onSentReqs.js index cba5b1b2..947fa12b 100644 --- a/services/gunDB/contact-api/events/onSentReqs.js +++ b/services/gunDB/contact-api/events/onSentReqs.js @@ -55,6 +55,15 @@ const react = () => { continue } + if (typeof pubToAvatar[recipientPub] === 'undefined') { + // eslint-disable-next-line no-empty-function + Streams.onAvatar(() => {}, recipientPub) + } + if (typeof pubToDN[recipientPub] === 'undefined') { + // eslint-disable-next-line no-empty-function + Streams.onDisplayName(() => {}, recipientPub) + } + finalSentReqs.push({ id: sentReqID, recipientAvatar: pubToAvatar[recipientPub] || null,