@xuda.io/account_module 1.2.1620 → 1.2.1621

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.
Files changed (2) hide show
  1. package/index.mjs +9 -6
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1969,13 +1969,16 @@ export const add_contact = async function (req, job_id, headers) {
1969
1969
  set_account_profile_picture(uid, contact_uid, metadata, job_id, headers);
1970
1970
  } else {
1971
1971
  // contact without use account
1972
- const cached_contact = await get_xuda_cache(uid, 'contact', email);
1973
- if (metadata.subject && !metadata.is_sent) {
1974
- is_spam = await ai_module.is_spam_email(uid, email, metadata.subject, account_profile_info);
1975
- }
1972
+ const cached_contact = await get_xuda_cache(uid, 'contact', email, 'metadata');
1973
+ if (!_.isEmpty(cached_contact)) {
1974
+ } else {
1975
+ if (metadata.subject && !metadata.is_sent) {
1976
+ is_spam = await ai_module.is_spam_email(uid, email, metadata.subject, account_profile_info);
1977
+ }
1976
1978
 
1977
- const is_business = await ai_module.is_business_contact(uid, email, name, metadata.subject, metadata.summarized_body, account_profile_info);
1978
- account_type = is_business ? 'business' : 'personal';
1979
+ const is_business = await ai_module.is_business_contact(uid, email, name, metadata.subject, metadata.summarized_body, account_profile_info);
1980
+ account_type = is_business ? 'business' : 'personal';
1981
+ }
1979
1982
  }
1980
1983
 
1981
1984
  const d = Date.now();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1620",
3
+ "version": "1.2.1621",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {