3declare(strict_types=1);
5namespace Bitrix\Im\V2\Analytics;
7use Bitrix\Im\V2\Analytics\Event\MessageEvent;
9use Bitrix\Im\V2\Chat\FavoriteChat;
10use Bitrix\Im\V2\Message;
24 parent::__construct(
$message->getChat());
30 $this->
async(
function () {
31 if ($this->message->getMessageId() ===
null)
36 if ($this->message->isForward() || $this->message->isSystem())
42 ->createMessageEvent(self::SEND_MESSAGE)
43 ?->setType((
new MessageContent($this->message))->getComponentName())
53 $this->
async(
function () use ($reaction) {
55 ->createMessageEvent(self::ADD_REACTION)
64 $this->
async(
function () use ($targetChat) {
67 ->createMessageEvent(self::SHARE_MESSAGE)
68 ?->setType((
new MessageContent($this->message))->getComponentName())
73 $event?->setSection(
'notes');
82 $this->
async(
function () use ($messageType) {
84 ->createMessageEvent(self::DELETE_MESSAGE)
85 ?->setType($messageType)
93 $files = $this->message->getFiles();
94 $fileCount =
$files->count();
101 ->createMessageEvent(self::ATTACH_FILE)
103 ?->setFileP3($fileCount)
117 return (
new MessageEvent($eventName, $this->chat, $this->userId));
isChatTypeAllowed(Chat $chat)
addAddReaction(string $reaction)
createMessageEvent(string $eventName,)
addShareMessage(Chat $targetChat)
__construct(Message $message)
addDeleteMessage(string $messageType)