@xuda.io/account_module 1.2.1850 → 1.2.1852
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 +11 -11
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2043,7 +2043,7 @@ const set_account_profile_picture = async function (uid, account_uid, metadata,
|
|
|
2043
2043
|
|
|
2044
2044
|
const { bio, country, mainCategory, subCategory } = account_info;
|
|
2045
2045
|
|
|
2046
|
-
const file_ret = await ai_module.get_profile_avatar(account_info.profile_picture, uid, '', account_profile_info, account_info.account_type, 'account', account_uid, { bio, country, mainCategory, subCategory }, business_size, name, account_info.email, job_id, headers);
|
|
2046
|
+
const file_ret = await ai_module.get_profile_avatar(account_info.profile_picture, uid, '', account_profile_info, account_info.account_type, 'account', account_uid, { bio, country, mainCategory, subCategory, is_user: true }, business_size, name, account_info.email, job_id, headers);
|
|
2047
2047
|
if (file_ret.code < 0) {
|
|
2048
2048
|
throw new Error(file_ret.data);
|
|
2049
2049
|
}
|
|
@@ -2228,9 +2228,9 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2228
2228
|
const save_ret = await save_contact(uid, contact_obj);
|
|
2229
2229
|
save_xuda_cache(uid, 'contact', contact_obj.email, null, contact_obj);
|
|
2230
2230
|
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2231
|
+
if (!contact_obj.is_spam && contact_obj.name) {
|
|
2232
|
+
set_contact_profile_picture(uid, contact_obj._id, metadata, job_id, headers, account_profile_info, false);
|
|
2233
|
+
}
|
|
2234
2234
|
|
|
2235
2235
|
return save_ret;
|
|
2236
2236
|
} catch (err) {
|
|
@@ -2238,7 +2238,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2238
2238
|
}
|
|
2239
2239
|
};
|
|
2240
2240
|
|
|
2241
|
-
const set_contact_profile_picture = async function (uid, contact_id, metadata, job_id, headers, account_profile_info) {
|
|
2241
|
+
const set_contact_profile_picture = async function (uid, contact_id, metadata, job_id, headers, account_profile_info, create_avatar) {
|
|
2242
2242
|
const ai_module = await import(`${module_path}/ai_module/index.mjs`);
|
|
2243
2243
|
// const account_profile_info = await get_active_account_profile_info(uid);
|
|
2244
2244
|
let contact_obj;
|
|
@@ -2536,11 +2536,11 @@ export const get_contacts = async function (req, job_id, headers) {
|
|
|
2536
2536
|
|
|
2537
2537
|
contact_docs.docs.push(doc);
|
|
2538
2538
|
|
|
2539
|
-
if (contact_id) {
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
}
|
|
2539
|
+
// if (contact_id) {
|
|
2540
|
+
// if (!doc.profile_avatar && !doc.is_spam && (!doc.profile_avatar_stat || doc.profile_avatar_stat === 1 || (doc.profile_avatar_stat === 2 && (!doc.profile_avatar_stat_ts || Date.now() - doc.profile_avatar_stat_ts > 1000 * 60 * 5)))) {
|
|
2541
|
+
// set_contact_profile_picture(uid, doc._id, {}, job_id, headers, account_profile_info);
|
|
2542
|
+
// }
|
|
2543
|
+
// }
|
|
2544
2544
|
}
|
|
2545
2545
|
|
|
2546
2546
|
if (!contact_id && with_requests) {
|
|
@@ -2741,7 +2741,7 @@ export const not_spam_contact = async function (req, job_id, headers) {
|
|
|
2741
2741
|
|
|
2742
2742
|
const contact_save_ret = await save_contact(uid, contact_doc);
|
|
2743
2743
|
await delete_xuda_cache(contact_doc);
|
|
2744
|
-
set_contact_profile_picture(uid, contact_doc._id, {}, job_id, headers, account_profile_info);
|
|
2744
|
+
set_contact_profile_picture(uid, contact_doc._id, {}, job_id, headers, account_profile_info, false);
|
|
2745
2745
|
|
|
2746
2746
|
return contact_save_ret;
|
|
2747
2747
|
} catch (err) {
|