summaryrefslogtreecommitdiff
path: root/server/hornchat.profile.tracking.js
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-08-10 10:38:44 +0200
committerMinteck <contact@minteck.org>2022-08-10 10:38:44 +0200
commitc6dbf0450566c40efc4a26f4f0717452b6ef95cd (patch)
treeb4be2d508223820d0a77d5a3e35e82684da3b6ec /server/hornchat.profile.tracking.js
downloadhornchat-c6dbf0450566c40efc4a26f4f0717452b6ef95cd.tar.gz
hornchat-c6dbf0450566c40efc4a26f4f0717452b6ef95cd.tar.bz2
hornchat-c6dbf0450566c40efc4a26f4f0717452b6ef95cd.zip
Initial commitHEADmane
Diffstat (limited to 'server/hornchat.profile.tracking.js')
-rw-r--r--server/hornchat.profile.tracking.js19
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