• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Controller/Chat/Message.php
  • Класс: BitrixImV2ControllerChatMessage
  • Вызов: Message::informAction
public function informAction(
	BitrixImV2Message $message
): ?array
{
	$chat = $message->getChat();
	if (!($chat instanceof ChatPrivateChat))
	{
		$this->addError(new ChatChatError(ChatChatError::WRONG_TYPE));

		return null;
	}

	$message->markAsImportant(true);

	$result = (new PushFormat())->validateDataForInform($message, $chat);
	if (!$result->isSuccess())
	{
		$this->addErrors($result->getErrors());

		return null;
	}

	$pushService = new BitrixImV2MessageInformPushService();
	$pushService->sendInformPushPrivateChat($chat, $message);

	return ['result' => true];
}