1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
AcceptUserActionMessage.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
6
11
13{
14 use MessageTrait;
15
16 protected int $collabId;
17 protected int $senderId;
18
19 public function __construct(int $collabId, int $senderId)
20 {
21 $this->collabId = $collabId;
22 $this->senderId = $senderId;
23 }
24
25 public function send(array $recipientIds = [], array $parameters = []): int
26 {
27 if (!Loader::includeModule('im'))
28 {
29 return 0;
30 }
31
32 $this->addUsersToChat($this->collabId, $this->senderId);
33
34 $message = (string)Loc::getMessage(
35 'SOCIALNETWORK_COLLAB_CHAT_USER_ACCEPT' . $this->getGenderSuffix($this->senderId),
36 [
37 '#SENDER_NAME#' => $this->getName($this->senderId, $this->senderId, $this->collabId),
38 ],
39 );
40
41 $this->sendAcceptUserAnalytics();
42
43 return $this->sendMessage($message, $this->senderId, $this->collabId);
44 }
45
46 private function sendAcceptUserAnalytics(): void
47 {
48 $fields = Invitation::getFields($this->senderId);
49
50 if ($fields === null)
51 {
52 return;
53 }
54
55 $event = new Event('intranet', 'onUserFirstInitialization', [
56 'invitationFields' => $fields,
57 'userId' => $this->senderId,
58 ]);
59
60 $event->send();
61 }
62}
Определения event.php:5
Определения loader.php:13
send(array $recipientIds=[], array $parameters=[])
Определения AcceptUserActionMessage.php:25
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
addUsersToChat(int $collabId, int ... $userIds)
Определения MessageTrait.php:97
sendMessage(string $message, int $senderId, int $groupId, ?string $componentId=null)
Определения MessageTrait.php:120
getName(int $senderId, int $recipientId, int $collabId)
Определения MessageTrait.php:49
$message
Определения payment.php:8
$event
Определения prolog_after.php:141
$fields
Определения yandex_run.php:501