@xuda.io/account_module 1.2.930 → 1.2.932
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 +9 -8
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1015,19 +1015,20 @@ export const read_emails = async function (req, job_id, headers) {
|
|
|
1015
1015
|
|
|
1016
1016
|
recipient[email_address] = { name: email_name, is_sent, subject };
|
|
1017
1017
|
|
|
1018
|
-
if (is_sent) {
|
|
1019
|
-
|
|
1020
|
-
} else {
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
}
|
|
1018
|
+
// if (is_sent) {
|
|
1019
|
+
// recipient[message.envelope.to[0].address] = message.envelope.to[0].name;
|
|
1020
|
+
// } else {
|
|
1021
|
+
// const is_spam = await ai_module.is_spam_email(uid, email_address, subject);
|
|
1022
|
+
// senders[message.envelope.sender[0].address] = message.envelope.sender[0].name;
|
|
1023
|
+
// }
|
|
1024
1024
|
}
|
|
1025
1025
|
}
|
|
1026
1026
|
|
|
1027
1027
|
if (docs.length) {
|
|
1028
1028
|
await db_module.save_couch_bulk_docs('xuda_emails', docs);
|
|
1029
1029
|
|
|
1030
|
-
for await (let [email,
|
|
1030
|
+
for await (let [email, data] of Object.entries(is_sent ? recipient : senders)) {
|
|
1031
|
+
const { name, subject, is_sent } = data;
|
|
1031
1032
|
// const contact_ret = await db_module.get_couch_view_raw(
|
|
1032
1033
|
// "xuda_contacts",
|
|
1033
1034
|
// "contacts_by_email_address",
|
|
@@ -1045,7 +1046,7 @@ export const read_emails = async function (req, job_id, headers) {
|
|
|
1045
1046
|
// uid,
|
|
1046
1047
|
// });
|
|
1047
1048
|
// }
|
|
1048
|
-
await add_contact({ uid, name, email, metadata: { subject } }, job_id, headers);
|
|
1049
|
+
await add_contact({ uid, name, email, metadata: { subject, is_sent } }, job_id, headers);
|
|
1049
1050
|
}
|
|
1050
1051
|
}
|
|
1051
1052
|
};
|