@xuda.io/account_module 1.2.1130 → 1.2.1132
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 +32 -26
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1256,29 +1256,32 @@ const get_contact_background = function (doc) {
|
|
|
1256
1256
|
const get_contact_pattern = async function (doc) {
|
|
1257
1257
|
let ret = `default-pattern.png`;
|
|
1258
1258
|
|
|
1259
|
-
if (doc.my_contact) {
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1259
|
+
// if (doc.my_contact) {
|
|
1260
|
+
// if (doc.account_type === 'business') {
|
|
1261
|
+
// ret = doc.profile_picture;
|
|
1262
|
+
// } else {
|
|
1263
|
+
// switch (doc.avatar_source) {
|
|
1264
|
+
// case 'fictional':
|
|
1265
|
+
// ret = `fictional-avatar-pattern.png`;
|
|
1266
|
+
// break;
|
|
1267
1267
|
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1268
|
+
// case 'ai profile':
|
|
1269
|
+
// ret = `fictional-avatar-pattern.png`;
|
|
1270
|
+
// break;
|
|
1271
1271
|
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1272
|
+
// case 'authentic profile':
|
|
1273
|
+
// ret = `authentic-avatar-pattern.png`;
|
|
1274
|
+
// break;
|
|
1275
1275
|
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
} else
|
|
1276
|
+
// default:
|
|
1277
|
+
// ret = `xu-pattern.png`;
|
|
1278
|
+
// break;
|
|
1279
|
+
// }
|
|
1280
|
+
// }
|
|
1281
|
+
// } else
|
|
1282
|
+
|
|
1283
|
+
if (doc?.shared_from_uid) {
|
|
1284
|
+
//&& (doc.pending || (doc.team_req_id && doc.contact_share_copy))) {
|
|
1282
1285
|
// pending or active share request
|
|
1283
1286
|
const shared_from_uid_ret = await get_account_name({ uid_query: doc.shared_from_uid });
|
|
1284
1287
|
ret = shared_from_uid_ret.data.profile_avatar;
|
|
@@ -2730,14 +2733,17 @@ export const archive_account_profile = async function (req) {
|
|
|
2730
2733
|
if (account_profile_doc.reserve) {
|
|
2731
2734
|
throw new Error('reserve');
|
|
2732
2735
|
}
|
|
2736
|
+
if (!account_profile_doc.team_req_id) {
|
|
2737
|
+
account_profile_doc.stat = 5;
|
|
2738
|
+
account_profile_doc.stat_ts = Date.now();
|
|
2739
|
+
account_profile_doc.stat_reason = 'archived by the user';
|
|
2733
2740
|
|
|
2734
|
-
|
|
2735
|
-
account_profile_doc.stat_ts = Date.now();
|
|
2736
|
-
account_profile_doc.stat_reason = 'archived by the user';
|
|
2737
|
-
|
|
2738
|
-
const account_profile_save_ret = await db_module.save_couch_doc('xuda_accounts', account_profile_doc);
|
|
2741
|
+
const account_profile_save_ret = await db_module.save_couch_doc('xuda_accounts', account_profile_doc);
|
|
2739
2742
|
|
|
2740
|
-
|
|
2743
|
+
return account_profile_save_ret;
|
|
2744
|
+
} else {
|
|
2745
|
+
change_account_profile_dependencies_status(team_req_id, 5);
|
|
2746
|
+
}
|
|
2741
2747
|
} catch (err) {
|
|
2742
2748
|
return {
|
|
2743
2749
|
code: -22,
|