@xuda.io/account_module 1.2.1513 → 1.2.1515

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 +20 -18
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2199,22 +2199,25 @@ const set_contact_profile_picture = async function (uid, contact_id, metadata, j
2199
2199
  const cache = await get_picture_cache(uid, 'profile_avatar', contact_obj.email, contact_obj.name);
2200
2200
  let file_ret = { code: 1, data: cache };
2201
2201
 
2202
- file_ret = await ai_module.get_profile_avatar(
2203
- contact_obj.profile_picture,
2204
- uid,
2205
- '',
2206
- account_profile_info,
2207
- contact_obj.account_type,
2208
- 'contact',
2209
- contact_id,
2210
- { bio: contact_obj.bio, country: contact_obj.country, mainCategory: contact_obj.mainCategory, subCategory: contact_obj.subCategory },
2211
- contact_obj.business_size,
2212
- contact_obj.name,
2213
- contact_obj.email,
2214
- job_id,
2215
- headers,
2216
- );
2217
-
2202
+ if (!cache) {
2203
+ file_ret = await ai_module.get_profile_avatar(
2204
+ contact_obj.profile_picture,
2205
+ uid,
2206
+ '',
2207
+ account_profile_info,
2208
+ contact_obj.account_type,
2209
+ 'contact',
2210
+ contact_id,
2211
+ { bio: contact_obj.bio, country: contact_obj.country, mainCategory: contact_obj.mainCategory, subCategory: contact_obj.subCategory },
2212
+ contact_obj.business_size,
2213
+ contact_obj.name,
2214
+ contact_obj.email,
2215
+ job_id,
2216
+ headers,
2217
+ );
2218
+ save_picture_cache(uid, 'profile_avatar', contact_obj.name, file_ret.data, { account_type: contact_obj.account_type, type: 'contact' });
2219
+ save_picture_cache(uid, 'profile_avatar', contact_obj.email, file_ret.data, { account_type: contact_obj.account_type, type: 'contact' });
2220
+ }
2218
2221
  if (file_ret.code < 0) {
2219
2222
  throw new Error(file_ret.data);
2220
2223
  }
@@ -2223,8 +2226,7 @@ const set_contact_profile_picture = async function (uid, contact_id, metadata, j
2223
2226
  contact_obj = contact_obj3;
2224
2227
  contact_obj.profile_avatar_obj = file_ret.data;
2225
2228
  contact_obj.profile_avatar = contact_obj.profile_avatar_obj.file_url;
2226
- save_picture_cache(uid, 'profile_avatar', contact_obj.name, contact_obj.profile_avatar_obj, { account_type: contact_obj.account_type, type: 'contact' });
2227
- save_picture_cache(uid, 'profile_avatar', contact_obj.email, contact_obj.profile_avatar_obj, { account_type: contact_obj.account_type, type: 'contact' });
2229
+
2228
2230
  const contact_save_ret = await db_module.save_app_couch_doc(account_profile_info.app_id, contact_obj);
2229
2231
  await update_contact_profile_picture_status(uid, contact_id, 3);
2230
2232
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1513",
3
+ "version": "1.2.1515",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {