@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.
- package/index.mjs +20 -18
- 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
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
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
|
-
|
|
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
|
}
|