@xuda.io/account_module 1.2.1771 → 1.2.1773
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 +6 -7
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2098,7 +2098,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2098
2098
|
/////////////////
|
|
2099
2099
|
|
|
2100
2100
|
let is_spam = false;
|
|
2101
|
-
let email_type_info;
|
|
2101
|
+
// let email_type_info;
|
|
2102
2102
|
let account_type_info;
|
|
2103
2103
|
let account_type;
|
|
2104
2104
|
let cached_contact;
|
|
@@ -2121,9 +2121,9 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2121
2121
|
|
|
2122
2122
|
if (_.isEmpty(cached_contact)) {
|
|
2123
2123
|
if (metadata.subject && !metadata.is_sent) {
|
|
2124
|
-
email_type_info = await ai_module.detect_email_type(uid, name, email, account_profile_info, '', metadata?.subject);
|
|
2125
|
-
is_spam = email_type_info.email_type === 'spam' || email_type_info.email_type === 'promotional';
|
|
2126
|
-
|
|
2124
|
+
// email_type_info = await ai_module.detect_email_type(uid, name, email, account_profile_info, '', metadata?.subject);
|
|
2125
|
+
// is_spam = email_type_info.email_type === 'spam' || email_type_info.email_type === 'promotional';
|
|
2126
|
+
is_spam = await ai_module.is_spam_email(uid, email, metadata.subject, account_profile_info);
|
|
2127
2127
|
}
|
|
2128
2128
|
if (!is_spam) {
|
|
2129
2129
|
account_type_info = await ai_module.analyze_email_account_type(uid, name, email, account_profile_info, metadata?.summarized_body);
|
|
@@ -2162,7 +2162,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2162
2162
|
account_profiles: [account_profile_obj._id],
|
|
2163
2163
|
account_type: cached_contact?.account_type || account_type,
|
|
2164
2164
|
account_type_info: cached_contact?.account_type_info || account_type_info,
|
|
2165
|
-
email_type_info: cached_contact?.email_type_info || email_type_info,
|
|
2165
|
+
// email_type_info: cached_contact?.email_type_info || email_type_info,
|
|
2166
2166
|
};
|
|
2167
2167
|
if (!_.isEmpty(cached_contact?.business_info)) {
|
|
2168
2168
|
contact_obj.business_info = _.cloneDeep(cached_contact.business_info);
|
|
@@ -2509,8 +2509,7 @@ export const get_contacts = async function (req, job_id, headers) {
|
|
|
2509
2509
|
contact_docs.docs.push(doc);
|
|
2510
2510
|
|
|
2511
2511
|
if (contact_id) {
|
|
2512
|
-
|
|
2513
|
-
if (!doc.profile_avatar && (!doc.profile_avatar_stat || doc.profile_avatar_stat === 1 || (doc.profile_avatar_stat === 2 && (!doc.profile_avatar_stat_ts || Date.now() - doc.profile_avatar_stat_ts > 1000 * 60 * 5)))) {
|
|
2512
|
+
if (!doc.profile_avatar && !doc.is_spam && (!doc.profile_avatar_stat || doc.profile_avatar_stat === 1 || (doc.profile_avatar_stat === 2 && (!doc.profile_avatar_stat_ts || Date.now() - doc.profile_avatar_stat_ts > 1000 * 60 * 5)))) {
|
|
2514
2513
|
set_contact_profile_picture(uid, doc._id, {}, job_id, headers, account_profile_info);
|
|
2515
2514
|
}
|
|
2516
2515
|
}
|