From 3987e769358b87db8e45b809dccb41af6e30286b Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Mon, 13 Mar 2023 19:39:29 +1100 Subject: [PATCH] add ip type prop in staff socket rooms to match json --- models/forms/makepost.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/models/forms/makepost.js b/models/forms/makepost.js index a13f7787..1b3b8880 100644 --- a/models/forms/makepost.js +++ b/models/forms/makepost.js @@ -599,14 +599,14 @@ module.exports = async (req, res) => { //dont emit thread to this socket, because the room only exists when the thread is open Socketio.emitRoom(`${res.locals.board._id}-${data.thread}`, 'newPost', projectedPost); } - const { raw, cloak } = data.ip; + const { raw, cloak, type } = data.ip; //but emit it to manage pages because they need to get all posts through socket including thread - Socketio.emitRoom('globalmanage-recent-hashed', 'newPost', { ...projectedPost, ip: { cloak, raw: null } }); - Socketio.emitRoom(`${res.locals.board._id}-manage-recent-hashed`, 'newPost', { ...projectedPost, ip: { cloak, raw: null } }); + Socketio.emitRoom('globalmanage-recent-hashed', 'newPost', { ...projectedPost, ip: { cloak, raw: null, type } }); + Socketio.emitRoom(`${res.locals.board._id}-manage-recent-hashed`, 'newPost', { ...projectedPost, ip: { cloak, raw: null, type } }); if (!dontStoreRawIps) { //no need to emit to these rooms if raw IPs are not stored - Socketio.emitRoom('globalmanage-recent-raw', 'newPost', { ...projectedPost, ip: { cloak, raw } }); - Socketio.emitRoom(`${res.locals.board._id}-manage-recent-raw`, 'newPost', { ...projectedPost, ip: { cloak, raw } }); + Socketio.emitRoom('globalmanage-recent-raw', 'newPost', { ...projectedPost, ip: { cloak, raw, type } }); + Socketio.emitRoom(`${res.locals.board._id}-manage-recent-raw`, 'newPost', { ...projectedPost, ip: { cloak, raw, type } }); } //now add other pages to be built in background