• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/integration/forum/taskcomment.php
  • Класс: BitrixSocialnetworkIntegrationForumTaskComment
  • Вызов: TaskComment::addViewedComment
static function addViewedComment($params = [])
{
	if (!is_array($params))
	{
		return false;
	}

	$taskId = (isset($params['taskId']) ? intval($params['taskId']) : 0);
	$commentId = (isset($params['commentId']) ? intval($params['commentId']) : 0);
	if (
		!$taskId
		|| !$commentId
	)
	{
		return false;
	}

	if (!isset(self::$viewedCommentsCache[$taskId]))
	{
		self::$viewedCommentsCache[$taskId] = [];
	}

	if (in_array($commentId, self::$viewedCommentsCache[$taskId]))
	{
		return true;
	}

	self::$viewedCommentsCache[$taskId][] = $commentId;

	return true;
}