@xuda.io/account_module 1.2.1621 → 1.2.1623
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 -4
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1958,6 +1958,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
1958
1958
|
let is_spam = false;
|
|
1959
1959
|
debugger;
|
|
1960
1960
|
let account_type;
|
|
1961
|
+
let cached_contact;
|
|
1961
1962
|
if (contact_uid) {
|
|
1962
1963
|
let { code: account_code, data: account_obj } = await db_module.get_couch_doc('xuda_accounts', contact_uid);
|
|
1963
1964
|
// account_info = account_obj.account_info;
|
|
@@ -1969,9 +1970,8 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
1969
1970
|
set_account_profile_picture(uid, contact_uid, metadata, job_id, headers);
|
|
1970
1971
|
} else {
|
|
1971
1972
|
// contact without use account
|
|
1972
|
-
|
|
1973
|
-
if (
|
|
1974
|
-
} else {
|
|
1973
|
+
cached_contact = await get_xuda_cache(uid, 'contact', email, 'metadata');
|
|
1974
|
+
if (_.isEmpty(cached_contact)) {
|
|
1975
1975
|
if (metadata.subject && !metadata.is_sent) {
|
|
1976
1976
|
is_spam = await ai_module.is_spam_email(uid, email, metadata.subject, account_profile_info);
|
|
1977
1977
|
}
|
|
@@ -1985,7 +1985,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
1985
1985
|
const contact_obj = {
|
|
1986
1986
|
_id: await _common.xuda_get_uuid('contact'),
|
|
1987
1987
|
email,
|
|
1988
|
-
name,
|
|
1988
|
+
name: cached_contact.name || name,
|
|
1989
1989
|
stat: stat || 3,
|
|
1990
1990
|
date_created: Date.now(metadata.email_data),
|
|
1991
1991
|
ts: d,
|