From b3c7c4d94e26625a43f1b574002b061ae81477ce Mon Sep 17 00:00:00 2001 From: Natsumi Date: Wed, 14 Apr 2021 10:40:55 +1200 Subject: [PATCH] Revert "Revert temp fix for reporting as active when online" This reverts commit 4cdf9e0fb2e9d33ba5389c70604eb9e4e7e1c43c. --- html/src/app.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/html/src/app.js b/html/src/app.js index 7b5e3ea7..a7a3e1f0 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -3290,6 +3290,7 @@ speechSynthesis.getVoices(); userId: content.userId } }); + $app.APILastOnline.set(content.userId, Date.now()); break; case 'friend-active': @@ -3735,6 +3736,8 @@ speechSynthesis.getVoices(); $app.data.debug = false; + $app.data.APILastOnline = new Map(); + $app.data.sharedFeed = { gameLog: { wrist: [], @@ -5220,6 +5223,15 @@ speechSynthesis.getVoices(); }); } } else { + if (ctx.state === 'online' && state === 'active') { + await new Promise(resolve => setTimeout(resolve, 50000)); + if (this.APILastOnline.has(id)) { + var date = this.APILastOnline.get(id); + if (date > Date.now() - 60000) { + return; + } + } + } if (ctx.state === 'online') { if (ctx.isVIP) { removeFromArray(this.friendsGroup0_, ctx);