- Модуль: im
- Путь к файлу: ~/bitrix/modules/im/lib/V2/Message/Inform/PushService.php
- Класс: BitrixImV2MessageInformPushService
- Вызов: PushService::sendInformPushPrivateChat
public function sendInformPushPrivateChat(PrivateChat $chat, Message $message): void
{
if (!$this->isPullEnable())
{
return;
}
$fromUserId = $message->getAuthorId();
$toUserId = $chat->getCompanion()->getId();
$pushFormat = new PushFormat();
$pullMessage = [
'module_id' => 'im',
'command' => 'informMessage',
'params' => $pushFormat->formatPrivateMessage($message, $chat),
'extra' => BitrixImCommon::getPullExtra(),
];
$pullMessageTo = $pullMessage;
$pullMessageTo['params']['dialogId'] = $fromUserId;
if ($fromUserId != $toUserId)
{
BitrixPullEvent::add($toUserId, $pullMessageTo);
}
}