• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Chat.php
  • Класс: BitrixImV2Chat
  • Вызов: Chat::sendNotificationUserDelete
protected function sendNotificationUserDelete(int $userId): void
{
	if ($userId === $this->getContext()->getUserId())
	{
		return;
	}
	$gender = $this->getContext()->getUser()->getGender();
	$userName = $this->getContext()->getUser()->getName();
	$userName = "[USER={$userId}]{$userName}[/USER]";
	$notificationMessage = Loc::getMessage('IM_CHAT_KICK_NOTIFICATION_'. $gender, ["#USER_NAME#" => $userName]);
	$notificationFields = [
		'TO_USER_ID' => $userId,
		'FROM_USER_ID' => 0,
		'NOTIFY_TYPE' => IM_NOTIFY_SYSTEM,
		'NOTIFY_MODULE' => 'im',
		'NOTIFY_TITLE' => htmlspecialcharsback(BitrixMainTextEmoji::decode($this->getTitle())),
		'NOTIFY_MESSAGE' => $notificationMessage,
	];
	CIMNotify::Add($notificationFields);
}