@xuda.io/ai_module 1.1.4537 → 1.1.4539
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +4 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -20,7 +20,7 @@ import { NodeVM, VMScript } from 'vm2';
|
|
|
20
20
|
puppeteer.use(StealthPlugin());
|
|
21
21
|
import process from 'process';
|
|
22
22
|
import { File } from 'node:buffer'; // Node 20+
|
|
23
|
-
const { readFile, unlink, writeFile } = fs.promises;
|
|
23
|
+
const { rm, readFile, unlink, writeFile } = fs.promises;
|
|
24
24
|
|
|
25
25
|
global._conf = (
|
|
26
26
|
await import(path.join(process.env.XUDA_HOME, process.env.XUDA_CONFIG), {
|
|
@@ -4417,6 +4417,8 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
4417
4417
|
throw new Error('The user profile must include a defined email_account_id');
|
|
4418
4418
|
}
|
|
4419
4419
|
|
|
4420
|
+
const _is_reply = Date.now() - conversation_doc.date_created_ts > 60000;
|
|
4421
|
+
|
|
4420
4422
|
const conversation_id = conversation_doc._id;
|
|
4421
4423
|
const sender_app_id = account_profile_info.app_id;
|
|
4422
4424
|
|
|
@@ -4456,7 +4458,7 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
4456
4458
|
throw new Error('error sending email');
|
|
4457
4459
|
}
|
|
4458
4460
|
for await (const attachment of email_attachments) {
|
|
4459
|
-
await
|
|
4461
|
+
await rm(attachment.path, { force: true });
|
|
4460
4462
|
}
|
|
4461
4463
|
}
|
|
4462
4464
|
|