1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
ExcludeUserActionMessage.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
5namespace Bitrix\Socialnetwork\Collab\Integration\IM\Message;
6
7use Bitrix\Main\Loader;
8use Bitrix\Main\Localization\Loc;
9
11{
12 use MessageTrait;
13
14 protected int $collabId;
15 protected int $senderId;
16
17 public function __construct(int $collabId, int $senderId)
18 {
19 $this->collabId = $collabId;
20 $this->senderId = $senderId;
21 }
22
23 public function send(array $recipientIds = [], array $parameters = []): int
24 {
25 if (!Loader::includeModule('im'))
26 {
27 return 0;
28 }
29
30 if (empty($recipientIds))
31 {
32 return 0;
33 }
34
35 $recipientNames = [];
36 foreach ($recipientIds as $recipientId)
37 {
38 $recipientNames[] = $this->getName($this->senderId, $recipientId, $this->collabId);
39 }
40
41 $this->deleteUsersFromChat($this->collabId, ...$recipientIds);
42
43 $userNames = implode(', ', $recipientNames);
44 $senderName = $this->getName($this->senderId, $this->senderId, $this->collabId);
45
46 $message = (string)Loc::getMessage(
47 'SOCIALNETWORK_COLLAB_CHAT_USER_EXCLUDE' . $this->getGenderSuffix($this->senderId),
48 [
49 '#SENDER_NAME#' => $senderName,
50 '#RECIPIENT#' => $userNames,
51 ],
52 );
53
54 return $this->sendMessage($message, $this->senderId, $this->collabId);
55 }
56}
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
deleteUsersFromChat(int $collabId, int ... $userIds)
Определения MessageTrait.php:110
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