• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/classes/general/im_notify.php
  • Класс: CIMNotify
  • Вызов: CIMNotify::SetLastId
static function SetLastId($chatId, $userId, $lastId = null)
{
	/*global $DB;

	if (intval($chatId) <= 0 || intval($userId) <= 0)
		return false;

	$ssqlLastId = "";
	if (!is_null($lastId))
	{
		$ssqlLastId = "LAST_ID = (case when LAST_ID < ".intval($lastId)." then ".intval($lastId)." else LAST_ID end),";
	}

	$counter = CIMNotify::GetRealCounter($chatId);

	$status = "STATUS = ".IM_STATUS_READ.", ";
	if ($counter > 0)
	{
		$status = "STATUS = (case when STATUS = ".IM_STATUS_READ." then ".IM_STATUS_UNREAD." else STATUS end), ";
	}

	$DB->Query("UPDATE b_im_relation SET ".$ssqlLastId." ".$status." COUNTER = ".$counter." WHERE CHAT_ID = ".intval($chatId));

	//if (!is_null($lastId))
	//{
	//	CIMNotify::SetLastSendId($chatId, $lastId);
	//}

	BitrixImCounter::clearCache($userId);*/

	return true;
}