@xuda.io/account_module 1.2.807 → 1.2.809

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 +24 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1653,6 +1653,30 @@ export const archive_contact = async function (req) {
1653
1653
  }
1654
1654
  };
1655
1655
 
1656
+ export const delete_contact = async function (req) {
1657
+ const { contact_id } = req;
1658
+ try {
1659
+ var contact_doc = await db_module.get_couch_doc_native('xuda_contacts', contact_id);
1660
+
1661
+ // validate share
1662
+
1663
+ contact_doc.stat = 4;
1664
+ contact_doc.stat_ts = Date.now();
1665
+ contact_doc.stat_reason = 'deleted by the user';
1666
+
1667
+ const contact_save_ret = await db_module.save_couch_doc('xuda_contacts', contact_doc);
1668
+
1669
+ // delete chats
1670
+
1671
+ return contact_save_ret;
1672
+ } catch (err) {
1673
+ return {
1674
+ code: -22,
1675
+ data: err.message,
1676
+ };
1677
+ }
1678
+ };
1679
+
1656
1680
  export const unarchive_contact = async function (req) {
1657
1681
  const { contact_id } = req;
1658
1682
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.807",
3
+ "version": "1.2.809",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {