@xuda.io/account_module 1.2.513 → 1.2.515

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 +7 -7
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1257,13 +1257,13 @@ const get_contact_border = function (doc) {
1257
1257
  return ret;
1258
1258
  };
1259
1259
 
1260
- export const get_contact_info = async function (contact_doc, _id) {
1260
+ export const get_contact_info = async function (uid, contact_doc, _id) {
1261
1261
  const ai_module = await import(`${module_path}/ai_module/index.mjs`);
1262
1262
  let doc = contact_doc;
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 (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 {
@@ -1292,9 +1291,10 @@ export const get_contact_info = async function (contact_doc, _id) {
1292
1291
  doc.icon_pattern = get_contact_pattern(doc);
1293
1292
  }
1294
1293
 
1295
- // const chats_ret = await ai_module.get_ai_chats({ uid, reference_id: doc._id });
1296
- // for await (let doc of chats_ret.data.docs) {
1297
- // }
1294
+ const chats_ret = await ai_module.get_ai_chats({ uid, reference_id: doc._id });
1295
+ for await (let doc of chats_ret.data.docs) {
1296
+ doc.notifications = 0;
1297
+ }
1298
1298
 
1299
1299
  doc.border = get_contact_border(doc);
1300
1300
  if (!doc.name) {
@@ -1363,7 +1363,7 @@ export const get_contacts = async function (req) {
1363
1363
  const contacts = await db_module.find_couch_query('xuda_contacts', opt);
1364
1364
 
1365
1365
  for await (let doc of contacts.docs) {
1366
- doc = await get_contact_info(doc);
1366
+ doc = await get_contact_info(uid, doc);
1367
1367
  }
1368
1368
 
1369
1369
  let requests_to = { docs: [] };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.513",
3
+ "version": "1.2.515",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {