@xuda.io/account_module 1.2.514 → 1.2.516
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
|
@@ -1263,7 +1263,7 @@ export const get_contact_info = async function (uid, contact_doc, _id) {
|
|
|
1263
1263
|
if (_id) {
|
|
1264
1264
|
doc = await db_module.get_couch_doc_native('xuda_contacts', _id);
|
|
1265
1265
|
}
|
|
1266
|
-
|
|
1266
|
+
doc.notifications = 0;
|
|
1267
1267
|
if (doc.contact_uid) {
|
|
1268
1268
|
const account_info_ret = await get_account_name({ uid_query: doc.contact_uid });
|
|
1269
1269
|
if (account_info_ret.code < 0) {
|
|
@@ -1278,7 +1278,6 @@ export const get_contact_info = async function (uid, contact_doc, _id) {
|
|
|
1278
1278
|
|
|
1279
1279
|
doc.telephone = account_info_ret.data.phone;
|
|
1280
1280
|
|
|
1281
|
-
// doc.notifications = 45;
|
|
1282
1281
|
// doc.online = true;
|
|
1283
1282
|
if (doc.team_req_id) {
|
|
1284
1283
|
try {
|
|
@@ -1293,7 +1292,10 @@ export const get_contact_info = async function (uid, contact_doc, _id) {
|
|
|
1293
1292
|
}
|
|
1294
1293
|
|
|
1295
1294
|
const chats_ret = await ai_module.get_ai_chats({ uid, reference_id: doc._id });
|
|
1296
|
-
for
|
|
1295
|
+
for (let doc of chats_ret.data.docs) {
|
|
1296
|
+
for (let msg of doc.messages) {
|
|
1297
|
+
if (!msg.read) doc.notifications++;
|
|
1298
|
+
}
|
|
1297
1299
|
}
|
|
1298
1300
|
|
|
1299
1301
|
doc.border = get_contact_border(doc);
|