@xuda.io/account_module 1.2.1652 → 1.2.1653
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 +3 -5
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2141,7 +2141,6 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2141
2141
|
};
|
|
2142
2142
|
|
|
2143
2143
|
const set_contact_profile_picture = async function (uid, contact_id, metadata, job_id, headers) {
|
|
2144
|
-
|
|
2145
2144
|
const ai_module = await import(`${module_path}/ai_module/index.mjs`);
|
|
2146
2145
|
const account_profile_info = await get_active_account_profile_info(uid);
|
|
2147
2146
|
|
|
@@ -2234,7 +2233,7 @@ const update_account_profile_picture_status = async function (uid, stat, error)
|
|
|
2234
2233
|
let doc = await db_module.get_couch_doc_native('xuda_accounts', uid);
|
|
2235
2234
|
doc.account_info.profile_avatar_stat = stat;
|
|
2236
2235
|
doc.account_info.profile_avatar_error = error;
|
|
2237
|
-
doc.account_info.profile_avatar_stat_ts=Date.now()
|
|
2236
|
+
doc.account_info.profile_avatar_stat_ts = Date.now();
|
|
2238
2237
|
const save_ret = await db_module.save_couch_doc_native('xuda_accounts', doc);
|
|
2239
2238
|
} catch (err) {
|
|
2240
2239
|
console.error(err);
|
|
@@ -2247,7 +2246,7 @@ const update_contact_profile_picture_status = async function (uid, contact_id, s
|
|
|
2247
2246
|
let doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, contact_id);
|
|
2248
2247
|
doc.profile_avatar_stat = stat;
|
|
2249
2248
|
doc.profile_avatar_error = error;
|
|
2250
|
-
doc.profile_avatar_stat_ts=Date.now()
|
|
2249
|
+
doc.profile_avatar_stat_ts = Date.now();
|
|
2251
2250
|
|
|
2252
2251
|
const save_ret = await db_module.save_app_couch_doc_native(account_profile_info.app_id, doc);
|
|
2253
2252
|
} catch (err) {
|
|
@@ -2378,8 +2377,7 @@ export const get_contacts = async function (req, job_id, headers) {
|
|
|
2378
2377
|
contact_docs.docs.push(doc);
|
|
2379
2378
|
|
|
2380
2379
|
if (contact_id) {
|
|
2381
|
-
|
|
2382
|
-
if (!doc.profile_avatar && (!doc.profile_avatar_stat || doc.profile_avatar_stat === 1 || (doc.profile_avatar_stat === 2 && (!doc.profile_avatar_stat_ts || Date.now()-doc.profile_avatar_stat_ts>1000*60*5))) {
|
|
2380
|
+
if (!doc.profile_avatar && (!doc.profile_avatar_stat || doc.profile_avatar_stat === 1 || (doc.profile_avatar_stat === 2 && (!doc.profile_avatar_stat_ts || Date.now() - doc.profile_avatar_stat_ts > 1000 * 60 * 5)))) {
|
|
2383
2381
|
set_contact_profile_picture(uid, doc._id, {}, job_id, headers);
|
|
2384
2382
|
}
|
|
2385
2383
|
}
|