3namespace Bitrix\Im\V2\Relation;
6use Bitrix\Main\Application;
10 private const MAX_DELETIONS_PER_HIT = 20;
12 private static self $instance;
14 private array $toDelete = [];
15 private int $deletionCount = 0;
16 private bool $isScheduled =
false;
18 private function __construct()
24 self::$instance ??=
new static();
26 return self::$instance;
31 return $this->deletionCount < self::MAX_DELETIONS_PER_HIT;
41 if (isset($this->toDelete[$chatId][
$userId]))
46 $this->deletionCount++;
53 private function schedule(): void
55 if ($this->isScheduled)
60 $this->isScheduled =
true;
64 private function delete(): void
66 $this->isScheduled =
false;
68 foreach ($this->toDelete as $chatId => $userIds)
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
markForDeletion(int $chatId, int $userId)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)