@xuda.io/account_module 1.2.1429 → 1.2.1430

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 +25 -22
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2013,10 +2013,11 @@ export const add_contact = async function (req, job_id, headers) {
2013
2013
  // profile_avatar_obj == contact.value.profile_avatar_obj;
2014
2014
  // }
2015
2015
  // }
2016
- if (!is_spam) {
2017
- profile_picture_obj = await ai_module.get_profile_picture(uid, account_type, name, { email, context, metadata }, account_profile_info, job_id, headers);
2018
- profile_picture = profile_picture_obj.url;
2019
- }
2016
+
2017
+ // if (!is_spam) {
2018
+ // profile_picture_obj = await ai_module.get_profile_picture(uid, account_type, name, { email, context, metadata }, account_profile_info, job_id, headers);
2019
+ // profile_picture = profile_picture_obj.url;
2020
+ // }
2020
2021
  }
2021
2022
  const d = Date.now();
2022
2023
  const doc = {
@@ -2036,28 +2037,30 @@ export const add_contact = async function (req, job_id, headers) {
2036
2037
  team_req_id,
2037
2038
  metadata,
2038
2039
  is_spam,
2039
- profile_picture,
2040
- profile_picture_obj,
2041
- profile_avatar,
2042
- profile_avatar_obj,
2040
+ // profile_picture,
2041
+ // profile_picture_obj,
2042
+ // profile_avatar,
2043
+ // profile_avatar_obj,
2043
2044
  account_profiles: [account_profile_obj._id],
2044
2045
  account_type,
2045
2046
  };
2046
2047
  const save_ret = await save_contact(uid, doc);
2047
-
2048
- if (!account_info.profile_avatar) {
2049
- const ai_module = await import(`${module_path}/ai_module/index.mjs`);
2050
- if (account_info_ret?.data?.profile_picture) {
2051
- ai_module.get_profile_avatar({ url: account_obj.profile_picture, uid, account_obj: { _id: contact_uid, account_info: account_info_ret.data }, account_profile_info }, job_id, headers);
2052
- } else {
2053
- if (!doc.profile_avatar) {
2054
- // create factual avatar
2055
- if (!is_spam) {
2056
- ai_module.update_thumbnail('contact', doc, account_profile_info.app_id, uid, job_id, headers, null, [email, doc._id, 'contact', account_profile_info.app_id], account_profile_info);
2057
- }
2058
- }
2059
- }
2060
- }
2048
+ if (!is_spam) {
2049
+ await set_contact_profile_picture(uid, doc._id, metadata, job_id, headers);
2050
+ }
2051
+ // if (!account_info.profile_avatar) {
2052
+ // const ai_module = await import(`${module_path}/ai_module/index.mjs`);
2053
+ // if (account_info_ret?.data?.profile_picture) {
2054
+ // ai_module.get_profile_avatar({ url: account_obj.profile_picture, uid, account_obj: { _id: contact_uid, account_info: account_info_ret.data }, account_profile_info }, job_id, headers);
2055
+ // } else {
2056
+ // if (!doc.profile_avatar) {
2057
+ // // create factual avatar
2058
+ // if (!is_spam) {
2059
+ // ai_module.update_thumbnail('contact', doc, account_profile_info.app_id, uid, job_id, headers, null, [email, doc._id, 'contact', account_profile_info.app_id], account_profile_info);
2060
+ // }
2061
+ // }
2062
+ // }
2063
+ // }
2061
2064
  return save_ret;
2062
2065
  } catch (err) {
2063
2066
  return { code: -1, data: err.message };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1429",
3
+ "version": "1.2.1430",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {