@xuda.io/ai_module 1.1.4630 → 1.1.4632
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 +11 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1730,10 +1730,10 @@ export const get_chat_conversation = async function (req) {
|
|
|
1730
1730
|
conversation_doc = await db_module.get_app_couch_doc_native(reference_doc.shared_from_app_id, reference_doc.share_item_id);
|
|
1731
1731
|
conversation_doc.reference_doc = reference_doc;
|
|
1732
1732
|
}
|
|
1733
|
-
let
|
|
1733
|
+
let conversation_items = await db_module.find_app_couch_query(account_profile_info.app_id, {
|
|
1734
1734
|
selector: {
|
|
1735
1735
|
docType: 'chat_conversation_item',
|
|
1736
|
-
conversation_id
|
|
1736
|
+
conversation_id,
|
|
1737
1737
|
stat: 3,
|
|
1738
1738
|
},
|
|
1739
1739
|
limit,
|
|
@@ -1741,7 +1741,15 @@ export const get_chat_conversation = async function (req) {
|
|
|
1741
1741
|
sort: ['date_created_ts'],
|
|
1742
1742
|
});
|
|
1743
1743
|
|
|
1744
|
-
|
|
1744
|
+
for (let conversation_item_doc of conversation_items.docs || []) {
|
|
1745
|
+
if (!conversation_item_doc.read) {
|
|
1746
|
+
conversation_item_doc.read = {};
|
|
1747
|
+
}
|
|
1748
|
+
conversation_item_doc.read[uid] = Date.now();
|
|
1749
|
+
await db_module.save_app_couch_doc(account_profile_info.app_id, conversation_item_doc);
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
return { code: 15, data: { conversation_items, ...conversation_doc } };
|
|
1745
1753
|
} catch (err) {
|
|
1746
1754
|
return { code: -15, data: err.message };
|
|
1747
1755
|
}
|