@xuda.io/account_module 1.2.1610 → 1.2.1612

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 +6 -5
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2023,6 +2023,7 @@ export const add_contact = async function (req, job_id, headers) {
2023
2023
  }
2024
2024
 
2025
2025
  const save_ret = await save_contact(uid, contact_obj);
2026
+ save_xuda_cache(uid, 'contact', contact_obj.email, null, contact_obj);
2026
2027
  if (!is_spam) {
2027
2028
  set_contact_profile_picture(uid, contact_obj._id, metadata, job_id, headers);
2028
2029
  }
@@ -2141,8 +2142,8 @@ const set_contact_profile_picture = async function (uid, contact_id, metadata, j
2141
2142
 
2142
2143
  if (!cache) {
2143
2144
  file_ret = await ai_module.get_profile_picture(uid, contact_obj.account_type, contact_obj.name, { email: contact_obj.email, metadata }, account_profile_info, job_id, headers);
2144
- save_picture_cache(uid, 'profile_picture', contact_obj.name, file_ret.data, { account_type: contact_obj.account_type, type: 'contact' });
2145
- save_picture_cache(uid, 'profile_picture', contact_obj.email, file_ret.data, { account_type: contact_obj.account_type, type: 'contact' });
2145
+ save_xuda_cache(uid, 'profile_picture', contact_obj.name, file_ret.data, { account_type: contact_obj.account_type, type: 'contact' });
2146
+ save_xuda_cache(uid, 'profile_picture', contact_obj.email, file_ret.data, { account_type: contact_obj.account_type, type: 'contact' });
2146
2147
  }
2147
2148
  if (file_ret.code < 0) {
2148
2149
  throw new Error(file_ret.data);
@@ -2178,8 +2179,8 @@ const set_contact_profile_picture = async function (uid, contact_id, metadata, j
2178
2179
  job_id,
2179
2180
  headers,
2180
2181
  );
2181
- save_picture_cache(uid, 'profile_avatar', contact_obj.name, file_ret.data, { account_type: contact_obj.account_type, type: 'contact' });
2182
- save_picture_cache(uid, 'profile_avatar', contact_obj.email, file_ret.data, { account_type: contact_obj.account_type, type: 'contact' });
2182
+ save_xuda_cache(uid, 'profile_avatar', contact_obj.name, file_ret.data, { account_type: contact_obj.account_type, type: 'contact' });
2183
+ save_xuda_cache(uid, 'profile_avatar', contact_obj.email, file_ret.data, { account_type: contact_obj.account_type, type: 'contact' });
2183
2184
  }
2184
2185
  if (file_ret.code < 0) {
2185
2186
  throw new Error(file_ret.data);
@@ -3019,7 +3020,7 @@ export const find_contact_query = async function (uid, opt) {
3019
3020
  return ret;
3020
3021
  };
3021
3022
 
3022
- export const save_picture_cache = async function (uid, docType, name, file, metadata = {}) {
3023
+ export const save_xuda_cache = async function (uid, docType, name, file, metadata = {}) {
3023
3024
  let doc = {
3024
3025
  _id: await _common.xuda_get_uuid('cache'),
3025
3026
  name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1610",
3
+ "version": "1.2.1612",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {