From 1a49ebbc08b5dfd2b2419594495d0b06d712ce83 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Sat, 9 May 2026 10:38:21 -0600 Subject: [PATCH] Fix shit --- index.js | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/index.js b/index.js index 9fe21d5..430acbf 100644 --- a/index.js +++ b/index.js @@ -570,25 +570,27 @@ xmpp.on("stanza", (stanza) => { } }) }); - fs.writeFileSync(logPath, JSON.stringify({ - evt, stanza, product_id, product_id_raw, bodyData, body, sentData: { - "type": "iem-message", - "data": { - "channel": getWFOByRoom(fromChannel), - "fromChannel": fromChannel, - "event": evt, - "body": bodyData, - "timestamp": product_id.timestamp, - "wmo": product_id.wmo, - "pil": product_id.pil, - "station": product_id.station, - "product_data": product_id, - "raw": product_id_raw, - "rawBody": body, - "image": stanza.getChild("x").attrs.twitter_media || null + if (process.env.LOG_EVENTS === "true") { + fs.writeFileSync(logPath, JSON.stringify({ + evt, stanza, product_id, product_id_raw, bodyData, body, sentData: { + "type": "iem-message", + "data": { + "channel": getWFOByRoom(fromChannel), + "fromChannel": fromChannel, + "event": evt, + "body": bodyData, + "timestamp": product_id.timestamp, + "wmo": product_id.wmo, + "pil": product_id.pil, + "station": product_id.station, + "product_data": product_id, + "raw": product_id_raw, + "rawBody": body, + "image": stanza.getChild("x").attrs.twitter_media || null + } } - } - }, getCircularReplacer(), 2), 'utf8'); + }, getCircularReplacer(), 2), 'utf8'); + } } tryGetText(); }