• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Link/Calendar/CalendarService.php
  • Класс: BitrixImV2LinkCalendarCalendarService
  • Вызов: CalendarService::getMessageText
protected function getMessageText(CalendarItem $calendar): string
{
	$genderModifier = ($this->getContext()->getUser()->getGender() === 'F') ? '_F' : '';

	if ($calendar->getMessageId() !== null)
	{
		$text = (new Message($calendar->getMessageId()))->getQuotedMessage() . "n";
		$text .= Loc::getMessage(
			'IM_CHAT_CALENDAR_REGISTER_FROM_MESSAGE_NOTIFICATION' . $genderModifier,
			[
				'#LINK#' => $calendar->getEntity()->getUrl(),
				'#USER_ID#' => $this->getContext()->getUserId(),
				'#MESSAGE_ID#' => $calendar->getMessageId(),
				'#DIALOG_ID#' => Chat::getInstance($calendar->getChatId())->getDialogContextId(),
			]
		);

		return $text;
	}
	return Loc::getMessage(
		'IM_CHAT_CALENDAR_REGISTER_FROM_CHAT_NOTIFICATION' . $genderModifier,
		[
			'#LINK#' => $calendar->getEntity()->getUrl(),
			'#USER_ID#' => $this->getContext()->getUserId(),
			'#EVENT_TITLE#' => $calendar->getEntity()->getTitle(),
		]
	);
}