@xuda.io/account_module 1.2.1782 → 1.2.1784

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 +8 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2116,7 +2116,7 @@ export const add_contact = async function (req, job_id, headers) {
2116
2116
  'gmx.com': 'GMX Mail',
2117
2117
  };
2118
2118
 
2119
- return providers[domain.toLowerCase()] || 'Custom/Unknown';
2119
+ return providers[domain.toLowerCase()];
2120
2120
  }
2121
2121
 
2122
2122
  /////////////////
@@ -2159,14 +2159,19 @@ export const add_contact = async function (req, job_id, headers) {
2159
2159
  if (is_business) {
2160
2160
  const business_info = await ai_module.get_business_info(uid, '', contact_obj.email, account_profile_info);
2161
2161
  if (business_info.business_name !== 'Not available') {
2162
+ //&& !identifyPersonalProvider(business_info.business_domain)
2162
2163
  business_has_person = await ai_module.is_business_contact_has_person(uid, email, name, metadata.subject, metadata.summarized_body, account_profile_info);
2163
2164
  } else {
2164
2165
  account_type = 'personal';
2165
2166
  }
2166
2167
  }
2167
2168
  if (_.isEmpty(cached_contact) && account_type === 'business' && !business_has_person) {
2168
- const domain = email.includes('@') ? email.split('@')[1] : '';
2169
- cached_contact = await get_xuda_cache(uid, 'contact', domain, 'metadata');
2169
+ if (!identifyPersonalProvider(business_info.business_domain)) {
2170
+ const domain = email.includes('@') ? email.split('@')[1] : '';
2171
+ cached_contact = await get_xuda_cache(uid, 'contact', domain, 'metadata');
2172
+ } else {
2173
+ cached_contact = await get_xuda_cache(uid, 'contact', business_info.business_name, 'metadata');
2174
+ }
2170
2175
  }
2171
2176
 
2172
2177
  // const is_business = await ai_module.is_business_contact(uid, email, name, metadata.subject, metadata.summarized_body, account_profile_info);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1782",
3
+ "version": "1.2.1784",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {