• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/MessageCollection.php
  • Класс: BitrixImV2MessageCollection
  • Вызов: MessageCollection::fillViewedByOthers
public function fillViewedByOthers(): self
{
	if ($this->isViewedByOthersFilled)
	{
		return $this;
	}

	$statuses = (new ViewedService())->getMessageStatuses($this->getIds());

	foreach ($this as $message)
	{
		$status = $statuses[$message->getId()] ?? IM_MESSAGE_STATUS_RECEIVED;
		$message->setViewedByOthers($status === IM_MESSAGE_STATUS_DELIVERED);
	}

	$this->isViewedByOthersFilled = true;

	return $this;
}