- Модуль: im
- Путь к файлу: ~/bitrix/modules/im/lib/V2/Chat.php
- Класс: Bitrix\Im\V2\Chat
- Вызов: Chat::getAvatar
public function getAvatar(int $size = 200, bool $addBlankPicture = false): string
{
$url = $addBlankPicture? '/bitrix/js/im/images/blank.gif': '';
if ((int)$this->getAvatarId() > 0 && $size > 0)
{
$arFileTmp = \CFile::ResizeImageGet(
$this->getAvatarId(),
['width' => $size, 'height' => $size],
BX_RESIZE_IMAGE_EXACT,
false,
false,
true
);
if (!empty($arFileTmp['src']))
{
$url = $arFileTmp['src'];
}
}
return $url;
}