@xuda.io/account_module 1.2.1793 → 1.2.1794

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