@xuda.io/account_module 1.2.1756 → 1.2.1758

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 +63 -62
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1142,75 +1142,76 @@ const get_contact_pattern = async function (doc) {
1142
1142
 
1143
1143
  if (doc.account_type === 'business') {
1144
1144
  if (doc?.account_type_info?.is_real_person && doc?.person_info?.person_full_name !== 'Not available') {
1145
+ ret = doc.profile_picture;
1145
1146
  }
1146
- }
1147
-
1148
- // if (doc.my_contact) {
1149
- // if (doc.account_type === 'business') {
1150
- // ret = doc.profile_picture;
1151
- // } else {
1152
- // switch (doc.avatar_source) {
1153
- // case 'fictional':
1154
- // ret = `fictional-avatar-pattern.png`;
1155
- // break;
1156
-
1157
- // case 'ai profile':
1158
- // ret = `fictional-avatar-pattern.png`;
1159
- // break;
1160
-
1161
- // case 'authentic profile':
1162
- // ret = `authentic-avatar-pattern.png`;
1163
- // break;
1147
+ } else {
1148
+ // if (doc.my_contact) {
1149
+ // if (doc.account_type === 'business') {
1150
+ // ret = doc.profile_picture;
1151
+ // } else {
1152
+ // switch (doc.avatar_source) {
1153
+ // case 'fictional':
1154
+ // ret = `fictional-avatar-pattern.png`;
1155
+ // break;
1156
+
1157
+ // case 'ai profile':
1158
+ // ret = `fictional-avatar-pattern.png`;
1159
+ // break;
1160
+
1161
+ // case 'authentic profile':
1162
+ // ret = `authentic-avatar-pattern.png`;
1163
+ // break;
1164
+
1165
+ // default:
1166
+ // ret = `xu-pattern.png`;
1167
+ // break;
1168
+ // }
1169
+ // }
1170
+ // } else
1164
1171
 
1165
- // default:
1166
- // ret = `xu-pattern.png`;
1167
- // break;
1168
- // }
1169
- // }
1170
- // } else
1171
-
1172
- if (doc?.shared_from_uid) {
1173
- //&& (doc.pending || (doc.team_req_id && doc.contact_share_copy))) {
1174
- // pending or active share request
1175
- const shared_from_uid_ret = await get_account_name({ uid_query: doc.shared_from_uid });
1176
- ret = shared_from_uid_ret.data.profile_avatar;
1177
- }
1178
- // else if (doc?.reference_doc?.shared_from_uid) {
1179
- // //active share
1180
- // const shared_from_uid_ret = await get_account_name({ uid_query: doc.reference_doc.shared_from_uid });
1181
- // ret = shared_from_uid_ret.data.profile_avatar;
1182
- // }
1183
- else if (doc.contact_uid) {
1184
- switch (doc.avatar_source) {
1185
- case 'fictional':
1186
- ret = `fictional-avatar-pattern.png`;
1187
- break;
1172
+ if (doc?.shared_from_uid) {
1173
+ //&& (doc.pending || (doc.team_req_id && doc.contact_share_copy))) {
1174
+ // pending or active share request
1175
+ const shared_from_uid_ret = await get_account_name({ uid_query: doc.shared_from_uid });
1176
+ ret = shared_from_uid_ret.data.profile_avatar;
1177
+ }
1178
+ // else if (doc?.reference_doc?.shared_from_uid) {
1179
+ // //active share
1180
+ // const shared_from_uid_ret = await get_account_name({ uid_query: doc.reference_doc.shared_from_uid });
1181
+ // ret = shared_from_uid_ret.data.profile_avatar;
1182
+ // }
1183
+ else if (doc.contact_uid) {
1184
+ switch (doc.avatar_source) {
1185
+ case 'fictional':
1186
+ ret = `fictional-avatar-pattern.png`;
1187
+ break;
1188
1188
 
1189
- case 'ai profile':
1190
- ret = `fictional-avatar-pattern.png`;
1191
- break;
1189
+ case 'ai profile':
1190
+ ret = `fictional-avatar-pattern.png`;
1191
+ break;
1192
1192
 
1193
- case 'authentic profile':
1194
- ret = `authentic-avatar-pattern.png`;
1195
- break;
1193
+ case 'authentic profile':
1194
+ ret = `authentic-avatar-pattern.png`;
1195
+ break;
1196
1196
 
1197
- default:
1198
- ret = `xu-pattern.png`;
1199
- break;
1200
- }
1201
- } else {
1202
- switch (doc.source) {
1203
- case 'read emails': {
1204
- ret = `email-pattern.png`;
1205
- break;
1206
- }
1207
- case 'web': {
1208
- ret = `web-pattern.png`;
1209
- break;
1197
+ default:
1198
+ ret = `xu-pattern.png`;
1199
+ break;
1210
1200
  }
1201
+ } else {
1202
+ switch (doc.source) {
1203
+ case 'read emails': {
1204
+ ret = `email-pattern.png`;
1205
+ break;
1206
+ }
1207
+ case 'web': {
1208
+ ret = `web-pattern.png`;
1209
+ break;
1210
+ }
1211
1211
 
1212
- default:
1213
- break;
1212
+ default:
1213
+ break;
1214
+ }
1214
1215
  }
1215
1216
  }
1216
1217
  return ret;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1756",
3
+ "version": "1.2.1758",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {