@xuda.io/account_module 1.2.325 → 1.2.327
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 +23 -0
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1558,3 +1558,26 @@ export const get_user_name = async function (uid) {
|
|
|
1558
1558
|
return 'unknown';
|
|
1559
1559
|
}
|
|
1560
1560
|
};
|
|
1561
|
+
|
|
1562
|
+
export const update_contacts_with_account_changes = async function (uid, changes = []) {
|
|
1563
|
+
try {
|
|
1564
|
+
const ret = await db_module.get_couch_doc('xuda_accounts', uid);
|
|
1565
|
+
var account_obj = ret.data;
|
|
1566
|
+
account_obj.ts = Date.now();
|
|
1567
|
+
|
|
1568
|
+
// update all uid contacts with the new avatar
|
|
1569
|
+
const opt = {
|
|
1570
|
+
selector: { contact_uid: db_doc._id, docType: 'contact' },
|
|
1571
|
+
};
|
|
1572
|
+
debugger;
|
|
1573
|
+
var contacts = await db_module.find_couch_query('xuda_contacts', opt);
|
|
1574
|
+
for (let doc of contacts.docs) {
|
|
1575
|
+
doc.profile_avatar = db_doc.account_info.profile_avatar;
|
|
1576
|
+
console.log(doc);
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
return username;
|
|
1580
|
+
} catch (err) {
|
|
1581
|
+
return 'unknown';
|
|
1582
|
+
}
|
|
1583
|
+
};
|