• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/recent.php
  • Класс: BitrixImRecent
  • Вызов: Recent::getMarkedId
static function getMarkedId(int $userId, string $itemType, string $dialogId): int
{
	$id = mb_strpos($dialogId, 'chat') === 0 ? mb_substr($dialogId, 4) : $dialogId;
	$element = BitrixImModelRecentTable::getList([
		'select' => ['MARKED_ID'],
		'filter' => [
			'=USER_ID' => $userId,
			'=ITEM_TYPE' => $itemType,
			'=ITEM_ID' => $id
		]
	])->fetch();
	if (!$element)
	{
		return 0;
	}

	return (int)($element['MARKED_ID'] ?? 0);
}