• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/comments/task/commentreader.php
  • Класс: BitrixTasksCommentsTaskCommentReader
  • Вызов: CommentReader::read
public function read(): void
{
	$usersToSkipReading = $this->getUsersToSkipReading();
	$commentsCountByUser = [];

	foreach ($this->members as $member)
	{
		$memberId = (int) $member['USER_ID'];

		if (
			$memberId < 1
			|| array_key_exists($memberId, $commentsCountByUser)
			|| in_array($memberId, $usersToSkipReading, true)
		)
		{
			continue;
		}

		$commentsCount = CommentsTask::getNewCommentsCountForTasks([$this->taskId], $memberId);
		if (!array_key_exists($this->taskId, $commentsCount))
		{
			continue;
		}
		$commentsCount = $commentsCount[$this->taskId];

		$commentsCountByUser[$memberId] = $commentsCount;

		if ($commentsCount <= 1)
		{
			ViewedTable::set($this->taskId, $memberId);
		}
	}
}