Database now stores hashes of recently used IP's for all users. They are retained for seven days AFTER their LAST use.

This commit is contained in:
rainbow napkin 2024-12-23 15:17:07 -05:00
parent 6b0a73e1c8
commit 6e785dc211
6 changed files with 112 additions and 12 deletions

View file

@ -52,12 +52,7 @@ module.exports = class{
//if everything looks good, admit the connection to the channel
socket.join(socket.chan);
//Make sure the client receives important client-info before userlist
//await this.sendClientMetadata(userDB, socket);
await userObj.sendClientMetadata();
await userObj.sendSiteEmotes();
await userObj.sendChanEmotes(chanDB);
await userObj.sendPersonalEmotes(userDB);
await userObj.handleConnection(userDB, chanDB, socket)
//Send out the userlist
this.broadcastUserList(socket.chan);

View file

@ -33,6 +33,19 @@ module.exports = class{
this.sockets = [socket.id];
}
async handleConnection(userDB, chanDB, socket){
//send metadata to client
await this.sendClientMetadata();
//Send out emotes
await this.sendSiteEmotes();
await this.sendChanEmotes(chanDB);
await this.sendPersonalEmotes(userDB);
//Tattoo hashed IP address to user account for seven days
await userDB.tattooIPRecord(socket.handshake.address);
}
socketCrawl(cb){
//Crawl through user's sockets (lol)
this.sockets.forEach((sockid) => {