@xuda.io/account_module 1.2.1917 → 1.2.1919
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 +14 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2153,7 +2153,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2153
2153
|
|
|
2154
2154
|
set_account_profile_picture(uid, contact_uid, metadata, job_id, headers, account_profile_info);
|
|
2155
2155
|
} else {
|
|
2156
|
-
is_spam =
|
|
2156
|
+
is_spam = awaitisLikelySpamEmail(email);
|
|
2157
2157
|
|
|
2158
2158
|
// contact without use account
|
|
2159
2159
|
cached_contact = await get_xuda_cache(uid, 'contact', email, 'metadata');
|
|
@@ -2766,6 +2766,7 @@ export const not_spam_contact = async function (req, job_id, headers) {
|
|
|
2766
2766
|
docType: 'spam_whitelist',
|
|
2767
2767
|
email: contact_doc.email,
|
|
2768
2768
|
date_created_ts: Date.now(),
|
|
2769
|
+
stat: 3,
|
|
2769
2770
|
});
|
|
2770
2771
|
|
|
2771
2772
|
const contact_save_ret = await save_contact(uid, contact_doc);
|
|
@@ -3534,7 +3535,17 @@ export const process_accounts_emails = async function () {
|
|
|
3534
3535
|
}
|
|
3535
3536
|
};
|
|
3536
3537
|
|
|
3537
|
-
function
|
|
3538
|
+
const isLikelySpamEmail = async function (email) {
|
|
3539
|
+
const spam_whitelists = await db_module.find_couch_query('xuda_accounts', {
|
|
3540
|
+
selector: {
|
|
3541
|
+
docType: 'spam_whitelist',
|
|
3542
|
+
email,
|
|
3543
|
+
stat: 3,
|
|
3544
|
+
},
|
|
3545
|
+
limit: 1,
|
|
3546
|
+
});
|
|
3547
|
+
if (spam_whitelists.docs.length) return false;
|
|
3548
|
+
|
|
3538
3549
|
if (!email || typeof email !== 'string') return true;
|
|
3539
3550
|
|
|
3540
3551
|
const lower = email.toLowerCase().trim();
|
|
@@ -3670,4 +3681,4 @@ function isLikelySpamEmail(email) {
|
|
|
3670
3681
|
|
|
3671
3682
|
// Passed → likely legitimate
|
|
3672
3683
|
return false;
|
|
3673
|
-
}
|
|
3684
|
+
};
|