This commit is contained in:
Christopher Cookman 2026-05-09 10:38:21 -06:00
parent 0752221b85
commit 1a49ebbc08

View file

@ -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();
}