• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/call/call.php
  • Класс: BitrixImCallCall
  • Вызов: Call::addUser
public function addUser($newUserId)
{
	$this->loadUsers();
	if($this->users[$newUserId])
	{
		return $this->users[$newUserId];
	}

	if(count($this->users) >= $this->getMaxUsers())
	{
		return false;
	}

	$this->users[$newUserId] = CallUser::create([
		'CALL_ID' => $this->id,
		'USER_ID' => $newUserId,
		'STATE' => CallUser::STATE_IDLE,
		'LAST_SEEN' => null
	]);
	$this->users[$newUserId]->save();

	if($this->associatedEntity)
	{
		$this->associatedEntity->onUserAdd($newUserId);
	}

	return $this->users[$newUserId];
}