• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Message/Reaction/ReactionService.php
  • Класс: BitrixImV2MessageReactionReactionService
  • Вызов: ReactionService::sendNotification
private function sendNotification(ReactionItem $reaction): void
{
	$authorId = $this->message->getAuthorId();
	if (
		$authorId === 0
		|| $authorId === $this->getContext()->getUserId()
		|| Chat::getInstance($reaction->getChatId())->getEntityType() === 'LIVECHAT'
		|| !Chat::getInstance($reaction->getChatId())->hasAccess($authorId)
	)
	{
		return;
	}

	$arMessageFields = [
		'MESSAGE_TYPE' => IM_MESSAGE_SYSTEM,
		'TO_USER_ID' => $this->message->getAuthorId(),
		'FROM_USER_ID' => $this->getContext()->getUserId(),
		'NOTIFY_TYPE' => IM_NOTIFY_FROM,
		'NOTIFY_MODULE' => 'im',
		'NOTIFY_EVENT' => 'like',
		'NOTIFY_TAG' => $this->getNotifyTag($reaction),
		'NOTIFY_MESSAGE' => $this->getTextNotification($reaction),
	];
	CIMNotify::Add($arMessageFields);
}