@xuda.io/account_module 1.2.1918 → 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.
Files changed (2) hide show
  1. package/index.mjs +13 -3
  2. 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 = isLikelySpamEmail(email);
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');
@@ -3535,7 +3535,17 @@ export const process_accounts_emails = async function () {
3535
3535
  }
3536
3536
  };
3537
3537
 
3538
- function isLikelySpamEmail(email) {
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
+
3539
3549
  if (!email || typeof email !== 'string') return true;
3540
3550
 
3541
3551
  const lower = email.toLowerCase().trim();
@@ -3671,4 +3681,4 @@ function isLikelySpamEmail(email) {
3671
3681
 
3672
3682
  // Passed → likely legitimate
3673
3683
  return false;
3674
- }
3684
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1918",
3
+ "version": "1.2.1919",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {