• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Message/Param/PushService.php
  • Класс: BitrixImV2MessageParamPushService
  • Вызов: PushService::sendPull
public function sendPull(Message $message, ?array $extraParams = null): void
{
	if (!$this->isPullEnable())
	{
		return;
	}

	$chat = $message->getChat();
	$params = $message->getParams();

	$pullParams = $this->getPullFormatParams($message);
	$users = $chat->getRelations()->getUserIds();

	if ($chat->getType() === IM_MESSAGE_PRIVATE)
	{
		$pullParams['params']['toUserId'] = $chat->getCompanion()->getId();
		$pullParams['params']['fromUserId'] = $message->getAuthorId();
	}
	else
	{
		$pullParams['params']['senderId'] = $message->getAuthorId();

		if ($chat->getEntityType() === 'LINES')
		{
			$users = $this->getRecipients($chat);
		}
	}

	$messageParams = $params->toPullFormat($extraParams);
	$pullParams['params']['params'] = $messageParams;

	BitrixPullEvent::add($users, $pullParams);

	if ($chat->getType() === IM_MESSAGE_OPEN || $chat->getType() === IM_MESSAGE_OPEN_LINE)
	{
		CPullWatch::AddToStack('IM_PUBLIC_' . $chat->getId(), $pullParams);
	}
}