@xuda.io/account_module 1.2.1895 → 1.2.1897

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 +16 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2752,6 +2752,8 @@ export const unpin_contact = async function (req) {
2752
2752
 
2753
2753
  export const not_spam_contact = async function (req, job_id, headers) {
2754
2754
  const email_module = await import(`${module_path}/email_module/index.mjs`);
2755
+ const ai_module = await import(`${module_path}/ai_module/index.mjs`);
2756
+
2755
2757
  const { contact_id, uid } = req;
2756
2758
  const account_profile_info = await get_active_account_profile_info(uid);
2757
2759
  try {
@@ -2782,6 +2784,20 @@ export const not_spam_contact = async function (req, job_id, headers) {
2782
2784
  // await process_email(email.email_account_id, profile, uid, email._id, job_id, headers, null, true);
2783
2785
  }
2784
2786
 
2787
+ const conversations = await db_module.find_app_couch_query(account_profile_info.app_id, {
2788
+ selector: {
2789
+ docType: 'chat_conversation',
2790
+ stat: 3,
2791
+ process_stat: 'partial',
2792
+ },
2793
+ });
2794
+
2795
+ for await (let email of emails.docs) {
2796
+ await ai_module.process_pending_email(req, job_id, headers);
2797
+
2798
+ // await process_email(email.email_account_id, profile, uid, email._id, job_id, headers, null, true);
2799
+ }
2800
+
2785
2801
  // update_conversation_mood_level
2786
2802
  // attachment_handler
2787
2803
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1895",
3
+ "version": "1.2.1897",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {