@xuda.io/account_module 1.2.1934 → 1.2.1935

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 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2844,6 +2844,31 @@ export const not_spam_contact = async function (req, job_id, headers) {
2844
2844
  }
2845
2845
  };
2846
2846
 
2847
+ export const generate_contact_avatar = async function (req, job_id, headers) {
2848
+ // const email_module = await import(`${module_path}/email_module/index.mjs`);
2849
+ // const ai_module = await import(`${module_path}/ai_module/index.mjs`);
2850
+
2851
+ const { contact_id, uid } = req;
2852
+ const account_profile_info = await get_active_account_profile_info(uid);
2853
+ try {
2854
+ var contact_doc = await get_contact(uid, contact_id);
2855
+ contact_doc.profile_picture_obj = null;
2856
+ contact_doc.profile_picture = null;
2857
+ contact_doc.profile_avatar_obj = null;
2858
+ contact_doc.profile_avatar = null;
2859
+
2860
+ const contact_save_ret = await save_contact(uid, contact_doc);
2861
+ await delete_xuda_cache(contact_doc);
2862
+ set_contact_profile_picture(uid, contact_doc._id, {}, job_id, headers, account_profile_info, true);
2863
+
2864
+ return contact_save_ret;
2865
+ } catch (err) {
2866
+ return {
2867
+ code: -24,
2868
+ data: err.message,
2869
+ };
2870
+ }
2871
+ };
2847
2872
  //////// PROFILES //////////////
2848
2873
 
2849
2874
  export const get_pending_share_profile_in = async function (uid, _id) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1934",
3
+ "version": "1.2.1935",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {