@xuda.io/account_module 1.2.1512 → 1.2.1514

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 +19 -16
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2196,22 +2196,25 @@ const set_contact_profile_picture = async function (uid, contact_id, metadata, j
2196
2196
  }
2197
2197
 
2198
2198
  if (!contact_obj.profile_avatar) {
2199
- const file_ret = await ai_module.get_profile_avatar(
2200
- contact_obj.profile_picture,
2201
- uid,
2202
- '',
2203
- account_profile_info,
2204
- contact_obj.account_type,
2205
- 'contact',
2206
- contact_id,
2207
- { bio: contact_obj.bio, country: contact_obj.country, mainCategory: contact_obj.mainCategory, subCategory: contact_obj.subCategory },
2208
- contact_obj.business_size,
2209
- contact_obj.name,
2210
- contact_obj.email,
2211
- job_id,
2212
- headers,
2213
- );
2214
-
2199
+ const cache = await get_picture_cache(uid, 'profile_avatar', contact_obj.email, contact_obj.name);
2200
+ let file_ret = { code: 1, data: cache };
2201
+ if (!cache) {
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
+ }
2215
2218
  if (file_ret.code < 0) {
2216
2219
  throw new Error(file_ret.data);
2217
2220
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1512",
3
+ "version": "1.2.1514",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {