@xuda.io/account_module 1.2.1516 → 1.2.1518

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 +3 -24
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1470,11 +1470,6 @@ export const update_contact = async function (req) {
1470
1470
  const account_profile_info = await get_active_account_profile_info(uid);
1471
1471
 
1472
1472
  var contact_ret;
1473
- // if (email) {
1474
- // contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_user_email_address', { key: [account_profile_info.uid, email] });
1475
- // } else if (contact_uid) {
1476
- // contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_contact_uid', { key: [account_profile_info.uid, contact_uid] });
1477
- // }
1478
1473
 
1479
1474
  let opt = {
1480
1475
  selector: {
@@ -1757,8 +1752,6 @@ export const get_user_card = async function (uid, uid_query) {
1757
1752
 
1758
1753
  let user_contact_obj;
1759
1754
 
1760
- // const contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_contact_uid', { key: [uid, uid_query] });
1761
-
1762
1755
  const opt = {
1763
1756
  selector: {
1764
1757
  docType: 'contact',
@@ -1967,11 +1960,6 @@ export const add_contact = async function (req, job_id, headers) {
1967
1960
  const { account_profile_obj } = account_profile_info;
1968
1961
 
1969
1962
  const ai_module = await import(`${module_path}/ai_module/index.mjs`);
1970
- // const contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_user_email_address', { key: [account_profile_info.uid, email] });
1971
-
1972
- // if (contact_ret.rows.length) {
1973
- // throw new Error('contact already exist active or deleted');
1974
- // }
1975
1963
 
1976
1964
  //////////////////
1977
1965
  const opt = {
@@ -2012,18 +2000,6 @@ export const add_contact = async function (req, job_id, headers) {
2012
2000
 
2013
2001
  const is_business = await ai_module.is_business_contact(uid, email, name, metadata.subject, metadata.summarized_body, account_profile_info);
2014
2002
  account_type = is_business ? 'business' : 'personal';
2015
- // const existing_contacts_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_email_address', { key: email });
2016
- // for (const contact of existing_contacts_ret.rows) {
2017
- // if (contact.value.profile_avatar) {
2018
- // profile_avatar = contact.value.profile_avatar;
2019
- // profile_avatar_obj == contact.value.profile_avatar_obj;
2020
- // }
2021
- // }
2022
-
2023
- // if (!is_spam) {
2024
- // profile_picture_obj = await ai_module.get_profile_picture(uid, account_type, name, { email, context, metadata }, account_profile_info, job_id, headers);
2025
- // profile_picture = profile_picture_obj.url;
2026
- // }
2027
2003
  }
2028
2004
 
2029
2005
  const d = Date.now();
@@ -2614,6 +2590,9 @@ export const get_account_profile_info = async function (uid, contact_profile_doc
2614
2590
  if (!doc.profile_avatar) {
2615
2591
  doc.profile_avatar = account_info_ret.data.profile_avatar;
2616
2592
  }
2593
+ if (!doc.profile_picture) {
2594
+ doc.profile_picture = account_info_ret.data.profile_picture;
2595
+ }
2617
2596
 
2618
2597
  const get_pattern = async function (doc) {
2619
2598
  let ret = `default-pattern.png`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1516",
3
+ "version": "1.2.1518",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {