@xuda.io/account_module 1.2.934 → 1.2.935

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 +3 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1894,7 +1894,7 @@ export const unpin_contact = async function (req) {
1894
1894
 
1895
1895
  export const add_contact = async function (req, job_id, headers) {
1896
1896
  try {
1897
- const { uid, email, name, stat, contact_uid, context, source, team_req_id, metadata } = req;
1897
+ const { uid, email, name, stat, contact_uid, context, source, team_req_id, metadata = {} } = req;
1898
1898
  const contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_user_email_address', { key: [uid, email] });
1899
1899
 
1900
1900
  if (contact_ret.rows.length) {
@@ -1907,8 +1907,8 @@ export const add_contact = async function (req, job_id, headers) {
1907
1907
  throw new Error(`account ${contact_uid} not found`);
1908
1908
  }
1909
1909
  } else {
1910
- if (subject && !metadata.is_sent) {
1911
- const is_spam = await ai_module.is_spam_email(uid, email_address, subject);
1910
+ if (metadata.subject && !metadata.is_sent) {
1911
+ const is_spam = await ai_module.is_spam_email(uid, email, metadata.subject);
1912
1912
  }
1913
1913
  }
1914
1914
  const d = Date.now();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.934",
3
+ "version": "1.2.935",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {