|
|
|
@ -2504,21 +2504,6 @@
|
|
|
|
|
return this.id;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getInitials(name) {
|
|
|
|
|
if (!name) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const cleaned = name.replace(/[^A-Za-z\s]+/g, '').replace(/\s+/g, ' ');
|
|
|
|
|
const parts = cleaned.split(' ');
|
|
|
|
|
const initials = parts.map(part => part.trim()[0]);
|
|
|
|
|
if (!initials.length) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return initials.slice(0, 2).join('');
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
isPrivate() {
|
|
|
|
|
return this.get('type') === 'private';
|
|
|
|
|
},
|
|
|
|
@ -2537,18 +2522,9 @@
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
getAvatar() {
|
|
|
|
|
const title = this.get('name');
|
|
|
|
|
const url = this.getAvatarPath();
|
|
|
|
|
|
|
|
|
|
if (url) {
|
|
|
|
|
return { url };
|
|
|
|
|
} else if (this.isPrivate()) {
|
|
|
|
|
const symbol = this.isValid() ? '#' : '!';
|
|
|
|
|
return {
|
|
|
|
|
content: this.getInitials(title) || symbol,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
return { url: null };
|
|
|
|
|
return url ? { url } : { url: null };
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getNotificationIcon() {
|
|
|
|
|