diff options
Diffstat (limited to 'server/hornchat.profile.tracking.js')
-rw-r--r-- | server/hornchat.profile.tracking.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/server/hornchat.profile.tracking.js b/server/hornchat.profile.tracking.js new file mode 100644 index 0000000..17143e5 --- /dev/null +++ b/server/hornchat.profile.tracking.js @@ -0,0 +1,19 @@ +module.exports = () => { + for (let id of Object.keys(data)) { + let connection = data[id]; + + if (connection.socket.authenticated === null) continue; + + if (typeof connection.trackedUsers === "object" && connection.trackedUsers instanceof Array) { + for (let user of connection.trackedUsers) { + let pk = pluralkit[user]; + pk['fronters'] = fronters[user].fronters; + + if (JSON.stringify(pk) !== connection.lastKnownTrackedUserInfo[user]) { + connection.lastKnownTrackedUserInfo[user] = JSON.stringify(pk); + connection.socket.send(JSON.stringify({error:null, success:true, fatal: false, manual: false, data: pk, username: user})); + } + } + } + } +}
\ No newline at end of file |