Zoom::getRichMessageFields

  1. Bitrix24 API (v. 23.675.0)
  2. im
  3. Zoom
  4. getRichMessageFields
  • Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/call/integration/zoom.php
  • Класс: BitrixImCallIntegrationZoom
  • Вызов: Zoom::getRichMessageFields
public function getRichMessageFields($dialogId, string $link, int $userId): array
{
	$chatId = Dialog::getChatId($dialogId);
	$attach = new CIMMessageParamAttach(null, CIMMessageParamAttach::CHAT);

	$messageFields = [
		'SYSTEM' => 'Y',
		'URL_PREVIEW' => 'N',
		'MESSAGE' => '[B]'.Loc::getMessage('IM_ZOOM_MESSAGE_CONFERENCE_CREATED').'[/B]',
	];

	//chat
	if (Common::isChatId($dialogId))
	{
		$chatData = BitrixImChat::getById($chatId);
		$richChatData = [
			'NAME' => $chatData['NAME'],
			'CHAT_ID' => $chatId
		];
		$attach->AddChat($richChatData);
		$attach->AddDelimiter(['SIZE' => 300, 'COLOR' => '#c6c6c6']);

		$messageFields['FROM_USER_ID'] = 0;
		$messageFields['DIALOG_ID'] = $dialogId;
		$messageFields['MESSAGE_TYPE'] = IM_MESSAGE_CHAT;
	}
	else //dialog
	{
		$messageFields['FROM_USER_ID'] = $userId;
		$messageFields['TO_USER_ID'] = $dialogId;
		$messageFields['TO_CHAT_ID'] = $chatId;
		$messageFields['MESSAGE_TYPE'] = IM_MESSAGE_PRIVATE;
	}

	$attach->AddMessage(Loc::getMessage('IM_ZOOM_MESSAGE_JOIN_LINK'));
	$attach->AddLink(['LINK' => $link]);
	$messageFields['ATTACH'] = $attach;

	return $messageFields;
}

Добавить комментарий