Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 172d1b47 rédigé par salixor's avatar salixor
Parcourir les fichiers

Fix another Promise (not caught because of missing type)

parent dcd19f95
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -495,7 +495,7 @@ export class MatrixEventProcessor {
displayname: string,
avatar_url: string|undefined }) {
let displayName = sender;
let avatarUrl;
let avatarUrl: string | undefined = undefined;
// Are they a discord user.
if (this.bridge.isNamespacedUser(sender)) {
......@@ -517,22 +517,21 @@ export class MatrixEventProcessor {
// Let it fall through.
}
if (profile) {
if (profile.displayname &&
profile.displayname.length >= MIN_NAME_LENGTH &&
profile.displayname.length <= MAX_NAME_LENGTH) {
displayName = profile.displayname;
}
if (profile?.displayname &&
profile.displayname.length >= MIN_NAME_LENGTH &&
profile.displayname.length <= MAX_NAME_LENGTH) {
displayName = profile.displayname;
}
if (profile.avatar_url) {
avatarUrl = this.bridge.botClient.mxcToHttpThumbnail(
profile.avatar_url,
DISCORD_AVATAR_WIDTH,
DISCORD_AVATAR_HEIGHT,
"scale",
);
}
if (profile?.avatar_url) {
avatarUrl = await this.bridge.botClient.mxcToHttpThumbnail(
profile.avatar_url,
DISCORD_AVATAR_WIDTH,
DISCORD_AVATAR_HEIGHT,
"scale",
);
}
embed.setAuthor(
displayName.substring(0, MAX_NAME_LENGTH),
avatarUrl,
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter