@xuda.io/account_module 1.2.2233 → 1.2.2235
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.
- package/index.mjs +1 -48
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2369,54 +2369,6 @@ export const get_contacts = async function (req, job_id, headers) {
|
|
|
2369
2369
|
|
|
2370
2370
|
let contact_docs = { docs: [], total_docs: contacts.total_docs };
|
|
2371
2371
|
|
|
2372
|
-
// const chat_conversation_count = async function () {
|
|
2373
|
-
// // const account_profile_info = await get_active_account_profile_info(uid);
|
|
2374
|
-
|
|
2375
|
-
// const counts_ret = await db_module.get_app_couch_view(account_profile_info.app_id, 'conversations_item_counts', {
|
|
2376
|
-
// reduce: true,
|
|
2377
|
-
// group_level: 999,
|
|
2378
|
-
|
|
2379
|
-
// startkey: ['contacts', '', ''],
|
|
2380
|
-
// endkey: ['contacts', 'zzzzzz', 'zzzzzz'],
|
|
2381
|
-
// });
|
|
2382
|
-
|
|
2383
|
-
// // return counts_ret?.rows?.[0]?.value || 0;
|
|
2384
|
-
|
|
2385
|
-
// let counts = {};
|
|
2386
|
-
// for (const val of counts_ret?.rows) {
|
|
2387
|
-
// if (!counts[val.key[1]]) {
|
|
2388
|
-
// counts[val.key[1]] = 0;
|
|
2389
|
-
// }
|
|
2390
|
-
|
|
2391
|
-
// counts[val.key[1]] += val.value;
|
|
2392
|
-
// }
|
|
2393
|
-
|
|
2394
|
-
// return counts;
|
|
2395
|
-
// };
|
|
2396
|
-
// const chat_conversation_read = async function () {
|
|
2397
|
-
// // const account_profile_info = await get_active_account_profile_info(uid);
|
|
2398
|
-
|
|
2399
|
-
// const counts_ret = await db_module.get_app_couch_view(account_profile_info.app_id, 'chat_conversation_item_read', {
|
|
2400
|
-
// reduce: true,
|
|
2401
|
-
// group_level: 999,
|
|
2402
|
-
|
|
2403
|
-
// startkey: [uid, '', ''],
|
|
2404
|
-
// endkey: [uid, 'zzzzzz', 'zzzzzz'],
|
|
2405
|
-
// });
|
|
2406
|
-
|
|
2407
|
-
// let counts = {};
|
|
2408
|
-
// for (const val of counts_ret?.rows) {
|
|
2409
|
-
// if (!counts[val.key[1]]) {
|
|
2410
|
-
// counts[val.key[1]] = 0;
|
|
2411
|
-
// }
|
|
2412
|
-
// counts[val.key[1]] += val.value;
|
|
2413
|
-
// }
|
|
2414
|
-
// return counts;
|
|
2415
|
-
// };
|
|
2416
|
-
|
|
2417
|
-
// const contact_chat_conversation_count_ret = await chat_conversation_count();
|
|
2418
|
-
// const contact_chat_conversation_read_ret = await chat_conversation_read();
|
|
2419
|
-
// debugger;
|
|
2420
2372
|
for await (let doc of contacts.docs) {
|
|
2421
2373
|
const ret_to = requests_to.docs.find((e) => {
|
|
2422
2374
|
return e.contact_uid === doc.contact_uid;
|
|
@@ -2662,6 +2614,7 @@ export const not_spam_contact = async function (req, job_id, headers) {
|
|
|
2662
2614
|
contact_doc.is_spam = false;
|
|
2663
2615
|
|
|
2664
2616
|
if (!contact_doc.contact_reference_conversation_id) {
|
|
2617
|
+
const conversation_obj = await ai_ms.create_openai_conversation();
|
|
2665
2618
|
contact_doc.contact_reference_conversation_id = conversation_obj.id;
|
|
2666
2619
|
}
|
|
2667
2620
|
|