@xuda.io/account_module 1.2.933 → 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.
- package/index.mjs +4 -1
- 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,6 +1907,9 @@ 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 (metadata.subject && !metadata.is_sent) {
|
|
1911
|
+
const is_spam = await ai_module.is_spam_email(uid, email, metadata.subject);
|
|
1912
|
+
}
|
|
1910
1913
|
}
|
|
1911
1914
|
const d = Date.now();
|
|
1912
1915
|
const doc = {
|