@xuda.io/account_module 1.2.901 → 1.2.903

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 +19 -5
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1793,7 +1793,7 @@ export const unfriend_contact = async function (req) {
1793
1793
  };
1794
1794
 
1795
1795
  export const pin_contact = async function (req) {
1796
- const { contact_id } = req;
1796
+ const { uid, contact_id } = req;
1797
1797
  try {
1798
1798
  const contact_ret = await db_module.get_couch_doc('xuda_contacts', contact_id);
1799
1799
  if (contact_ret.code < 0) {
@@ -1804,15 +1804,15 @@ export const pin_contact = async function (req) {
1804
1804
 
1805
1805
  const contact_save_ret = await db_module.save_couch_doc('xuda_contacts', contact_doc);
1806
1806
 
1807
- global[`_controller_module_ch`].sendToQueue(
1807
+ global[`_ai_module_ch`].sendToQueue(
1808
1808
  'ws_dashboard_module',
1809
1809
  Buffer.from(
1810
1810
  JSON.stringify({
1811
1811
  method: 'emit_message_to_dashboard',
1812
1812
  data: {
1813
- service: 'ai_agent_error',
1814
- to: [doc.studio_meta.createdByUid],
1815
- data: errors,
1813
+ service: 'contact_pinned',
1814
+ to: [uid],
1815
+ data: contact_id,
1816
1816
  },
1817
1817
  }),
1818
1818
  ),
@@ -1839,6 +1839,20 @@ export const unpin_contact = async function (req) {
1839
1839
 
1840
1840
  const contact_save_ret = await db_module.save_couch_doc('xuda_contacts', contact_doc);
1841
1841
 
1842
+ global[`_ai_module_ch`].sendToQueue(
1843
+ 'ws_dashboard_module',
1844
+ Buffer.from(
1845
+ JSON.stringify({
1846
+ method: 'emit_message_to_dashboard',
1847
+ data: {
1848
+ service: 'contact_pinned',
1849
+ to: [uid],
1850
+ data: contact_id,
1851
+ },
1852
+ }),
1853
+ ),
1854
+ );
1855
+
1842
1856
  return contact_save_ret;
1843
1857
  } catch (err) {
1844
1858
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.901",
3
+ "version": "1.2.903",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {