3namespace Bitrix\Im\V2\Message;
5use Bitrix\Im\Model\RecentTable;
6use Bitrix\Im\Model\RelationTable;
8use Bitrix\Main\SystemException;
28 'DIALOG_UNREAD' => [],
40 $privateChatIds[] =
$counter[
'CHAT_ID'];
66 else if (
$counter[
'CHAT_TYPE'] === Chat::IM_TYPE_COPILOT)
74 $this->countersByChatIds[$chatId] =
$count;
79 $query = RecentTable::query()
80 ->setSelect([
'CHAT_ID' =>
'ITEM_CID',
'IS_MUTED' =>
'RELATION.NOTIFY_BLOCK',
'DIALOG_ID' =>
'ITEM_ID',
'ITEM_TYPE'])
81 ->where(
'USER_ID', $this->getContext()->getUserId())
82 ->where(
'UNREAD',
true)
86 $query->where(
'IS_MUTED', $isMuted);
96 foreach ($unreadChats as $unreadChat)
104 $this->
setUnreadChat((
int)$unreadChat[
'CHAT_ID'], $unreadChat[
'IS_MUTED'] ===
'Y');
111 $this->counters[
'TYPE'][
'ALL']++;
112 $this->counters[
'TYPE'][
'DIALOG']++;
113 $this->counters[
'TYPE'][
'MESSENGER']++;
114 $this->counters[
'DIALOG_UNREAD'][] = $id;
119 $this->counters[
'TYPE'][
'ALL'] +=
$count;
120 $this->counters[
'TYPE'][
'DIALOG'] +=
$count;
121 $this->counters[
'TYPE'][
'MESSENGER'] +=
$count;
122 $this->counters[
'DIALOG'][$id] =
$count;
127 if (empty($privateChatIds))
132 $result = RelationTable::query()
133 ->setSelect([
'USER_ID',
'CHAT_ID'])
134 ->whereNot(
'USER_ID', $this->getContext()->getUserId())
135 ->whereIn(
'CHAT_ID', $privateChatIds)
143 $map[$row[
'CHAT_ID']] = $row[
'USER_ID'];
setUnreadChat(int $id, bool $isMuted)
setFromNotify(int $count)
setFromLine(int $id, int $count)
setFromMutedChat(int $id, int $count)
getCountersForEachChat(?array $chatIds=null, bool $forCurrentUser=true)
setFromChat(int $id, int $count)
getUnreadChats(?bool $isMuted=null)
setFromDialog(int $id, int $count)
countUnreadMessages(?array $chatIds=null)
getMapChatToDialog(array $privateChatIds)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
const IM_MESSAGE_OPEN_LINE