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

Try an additional change

parent ecc76cf0
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -524,22 +524,23 @@ export class MatrixEventProcessor {
}
if (profile?.avatar_url) {
avatarUrl = await this.bridge.botClient.mxcToHttpThumbnail(
profile.avatar_url,
32,
32,
"scale",
);
log.info(avatarUrl);
avatarUrl = avatarUrl.replace(this.bridge.botClient.homeserverUrl, "");
log.info(avatarUrl);
log.info(this.bridge.botClient.accessToken);
// eslint-disable-next-line @typescript-eslint/naming-convention
const res = await this.bridge.botClient.doRequest("GET", avatarUrl, { allow_remote: true }, null, undefined, true, undefined, true);
// avatarUrl = await this.bridge.botClient.mxcToHttpThumbnail(
// profile.avatar_url,
// 32,
// 32,
// "scale",
// );
// log.info(avatarUrl);
// avatarUrl = avatarUrl.replace(this.bridge.botClient.homeserverUrl, "");
// log.info(avatarUrl);
// log.info(this.bridge.botClient.accessToken);
// // eslint-disable-next-line @typescript-eslint/naming-convention
// const res = await this.bridge.botClient.doRequest("GET", avatarUrl, { allow_remote: true }, null, undefined, true, undefined, true);
const res = await this.bridge.botClient.downloadContent(profile.avatar_url, true);
log.info(res)
log.info(res.body)
const contentType = res.headers["content-type"];
const data = res.body;
log.info(res.data)
const contentType = res.contentType;
const data = res.data;
const base64 = `data:${contentType};base64,${data.toString('base64')}`;
avatarUrl = base64;
}
......
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