• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Message/Update/UpdateService.php
  • Класс: BitrixImV2MessageUpdateUpdateService
  • Вызов: UpdateService::updateParams
private function updateParams(): void
{
	$this->message->getParams()->get(Params::URL_ID)->unsetValue();
	$this->message->getParams()->get(Params::URL_ONLY)->unsetValue();
	$this->message->getParams()->get(Params::LARGE_FONT)->unsetValue();
	$this->message->getParams()->get(Params::DATE_TEXT)->unsetValue();
	$this->message->getParams()->get(Params::DATE_TS)->unsetValue();

	if ($this->message->isViewedByOthers())
	{
		$this->message->getParams()->get(Params::IS_EDITED)->setValue(true);
	}

	if (Text::isOnlyEmoji($this->message->getMessage()))
	{
		$this->message->getParams()->get(Params::LARGE_FONT)->setValue(true);
	}

	if ($this->urlPreview)
	{
		$results = Text::getDateConverterParams($this->message->getMessage());
		foreach ($results as $result)
		{
			$dateText = $result->getText();
			$dateTs = $result->getDate()->getTimestamp();
		}

		$link = new CIMMessageLink();
		$urlPrepare = $link->prepareInsert($this->message->getMessage());
		if ($urlPrepare['RESULT'])
		{
			if ($urlPrepare['URL_ID'])
			{
				$this->message->getParams()->get(Params::URL_ID)->setValue($urlPrepare['URL_ID']);
			}
			if ($urlPrepare['MESSAGE_IS_LINK'])
			{
				$this->message->getParams()->get(Params::URL_ONLY)->setValue(true);
			}

			$this->message->getParams()->get(Params::DATE_TEXT)->setValue($dateText);
			$this->message->getParams()->get(Params::DATE_TS)->setValue($dateTs);
		}

	}

	$this->message->getParams()->save();
	$this->message->save();
}