3namespace Bitrix\Im\V2\Message\Counter;
5use Bitrix\Im\Model\CounterOverflowTable;
27 $userIds = array_keys($overflowedCounters);
40 return $infoFromCache;
46 $usersWithOverflowedCounters,
47 $usersWithoutOverflowedCounters
49 self::$overflowInfoStaticCache[
$this->chatId] = $overflowInfo;
56 if (!isset(self::$overflowInfoStaticCache[$this->chatId]))
75 return self::$overflowValue;
80 CounterOverflowTable::deleteByFilter([
'=CHAT_ID' => $this->chatId,
'=USER_ID' =>
$userId]);
86 CounterOverflowTable::deleteByFilter([
'=CHAT_ID' =>
$chatId]);
97 $filter = [
'=CHAT_ID' => $chatIds];
103 CounterOverflowTable::deleteByFilter(
$filter);
112 CounterOverflowTable::deleteByFilter([
'=USER_ID' =>
$userId]);
115 foreach (self::$overflowInfoStaticCache as
$chatId => $overflowInfo)
117 if ($overflowInfo->hasOverflow(
$userId))
125 unset(self::$overflowInfoStaticCache[
$chatId]);
138 ->setSelect([
'USER_ID'])
139 ->where(
'CHAT_ID', $this->chatId)
140 ->whereIn(
'USER_ID', $userIds)
144 foreach ($raw as $row)
146 $userId = (int)$row[
'USER_ID'];
155 return array_filter($allUsers,
static fn (
int $userId) => !isset($overflowedUsers[
$userId]));
172 foreach (array_chunk(
$rows, self::PARTIAL_INSERT_ROWS,
true) as $part)
174 CounterOverflowTable::multiplyInsertWithoutDuplicate(
177 'DEADLOCK_SAFE' =>
true,
178 'UNIQUE_FIELDS' => [
'CHAT_ID',
'USER_ID'],
196 if (!isset(self::$overflowInfoStaticCache[
$chatId]))
203 unset(self::$overflowInfoStaticCache[
$chatId]);
208 $wasOverflowed = self::$overflowInfoStaticCache[
$chatId]->hasOverflow(
$userId);
210 if ($wasOverflowed !== $hasOverflowNow)
212 self::$overflowInfoStaticCache[
$chatId]->changeOverflowStatus(
$userId, $hasOverflowNow);
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static deleteByChatIds(array $chatIds, ?int $userId=null)
static getOverflowValue()
getRowToInsert(int $userId)
const PARTIAL_INSERT_ROWS
getRowsToInsert(array $userIds)
getUsersWithOverflow(array $userIds)
filterOverflowedCounters(array $counters)
static deleteAllByUserId(int $userId)
static int $overflowValue
static cleanCacheByChatId(int $chatId, ?int $userId=null, bool $hasOverflowNow=false)
static array $overflowInfoStaticCache
insertOverflowed(array $counters)
getOverflowInfoFromCache(array $userIds)
static deleteByChatIdForAll(int $chatId)
getOverflowInfo(array $userIds)
filterUsersWithoutOverflow(array $overflowedUsers, array $allUsers)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if($NS['step']==6) if( $NS[ 'step']==7) if(COption::GetOptionInt('main', 'disk_space', 0) > 0) $info