diff --git a/src/matrixeventprocessor.ts b/src/matrixeventprocessor.ts index a17c99c54a0d99952cba22d928065d13cd3a021a..455910c691253d7ff2f12ae8711e0f2d439188db 100644 --- a/src/matrixeventprocessor.ts +++ b/src/matrixeventprocessor.ts @@ -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; }