@xuda.io/ai_module 1.1.3872 → 1.1.3873
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 +5 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4031,12 +4031,12 @@ export const create_conversation = async function (req, job_id, headers) {
|
|
|
4031
4031
|
};
|
|
4032
4032
|
const save_ret = await db_module.save_app_couch_doc(app_id, conversation_doc);
|
|
4033
4033
|
|
|
4034
|
-
let contact_uid_chat_conversation;
|
|
4034
|
+
let contact_uid_chat_conversation, receiver_contact_id, receiver_contact_doc;
|
|
4035
4035
|
|
|
4036
4036
|
if (conversation_doc.reference_type === 'contacts') {
|
|
4037
4037
|
// reference_id is the contact id
|
|
4038
|
-
|
|
4039
|
-
|
|
4038
|
+
receiver_contact_id = reference_id;
|
|
4039
|
+
receiver_contact_doc = await account_module.get_contact_info(uid, null, receiver_contact_id);
|
|
4040
4040
|
if (conversation_type === 'chat') {
|
|
4041
4041
|
if (receiver_contact_doc?.connection_stat !== 3) {
|
|
4042
4042
|
throw new Error('chat conversation to the recipient is not available');
|
|
@@ -4068,6 +4068,7 @@ export const create_conversation = async function (req, job_id, headers) {
|
|
|
4068
4068
|
await db_module.save_app_couch_doc_native(app_id, conversation_doc);
|
|
4069
4069
|
|
|
4070
4070
|
await update_thumbnail('conversation', conversation_doc, app_id, uid, job_id, headers);
|
|
4071
|
+
|
|
4071
4072
|
if (conversation_doc.reference_type === 'contacts') {
|
|
4072
4073
|
if (contact_uid_chat_conversation) {
|
|
4073
4074
|
// write conversation to host after thumbnail update
|
|
@@ -4085,6 +4086,7 @@ export const create_conversation = async function (req, job_id, headers) {
|
|
|
4085
4086
|
|
|
4086
4087
|
await update_conversation_mood_level(conversation_obj.id, prompt, uid, contact_uid_chat_conversation, true);
|
|
4087
4088
|
} else {
|
|
4089
|
+
// other cases rather then chat
|
|
4088
4090
|
await update_conversation_mood_level(conversation_obj.id, prompt, null, receiver_contact_doc.contact_uid, conversation_doc.reference_type === 'contacts');
|
|
4089
4091
|
}
|
|
4090
4092
|
}
|