29 parent::__construct(
$chats);
36 Chat::fillSelfRelations($this->chats);
40 foreach ($this->chats as $chat)
42 $restData = $chat->toRestFormat([
'CHAT_SHORT_FORMAT' =>
true]);
52 'counter' => $chat->getUserCounter(),
53 'dateCreate' => $chat->getDateCreate()?->format(
'c'),
54 'lastMessageId' => $chat->getLastMessageId(),
55 'lastId' => $chat->getLastId(),
56 'managerList' => $chat->getManagerList(
false),
57 'markedId' => $chat->getMarkedId(),
59 'public' => $chat->getPublicOption() ??
'',
60 'unreadId' => $chat->getUnreadId(),
61 'userCounter' => $chat->getUserCount(),
78 foreach ($nonCachedData as $chatData)
80 $chatId = (int)$chatData[
'ID'];
81 $chat = $this->chats[$chatId] ??
null;
88 ->setMessageCount((
int)$chatData[
'MESSAGE_COUNT'])
89 ->setUserCount((
int)$chatData[
'USER_COUNT'])
90 ->setLastMessageId((
int)$chatData[
'LAST_MESSAGE_ID'])
91 ->setMarkedId($markedIds[$chatId] ?? 0)
93 ->markFilledNonCachedData(
true)
105 return ChatTable::query()
106 ->setSelect(array_merge(ChatFactory::NON_CACHED_FIELDS, [
'ID']))
116 return $readService->getCounterService()->getForEachChat(
$chatIds);
121 if (!empty($this->recent))
132 foreach ($this->recent as $recentItem)
134 $markedIds[$recentItem->getChatId()] = $recentItem->getMarkedId();
144 ? [$this->getContext()->getUserId()]
148 foreach ($this->chats as $chat)
152 $userIds[] = (int)$chat->getDialogId();
164 CopilotPopupItem::getInstanceByChatIds($this->
getChatIds()),
static getMessageCount($chatId, $userId=null)
static getMarkedIdByChatIds(int $userId, array $chatIds)
toRestFormat(array $option=[])
getPopupData(array $excludedList=[])
fillCounters(array $chatIds)
getSelfAdditionalParams(Chat $chat)
__construct(array $chats, RecentSync $recent)
fillNonCachedData(array $chatIds)
fillMarkedIds(array $chatIds)
fillData(array $nonCachedData, array $counters, array $markedIds)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)