Fix shit
This commit is contained in:
parent
0752221b85
commit
1a49ebbc08
38
index.js
38
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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue