/** @var IManageConfigValues The config */
protected $config;
/** @var Channel */
- protected $channel;
+ protected $channelRepository;
public function __construct(Channel $channel, L10n $l10n, LoggerInterface $logger, IManageConfigValues $config)
{
parent::__construct($logger);
- $this->channel = $channel;
- $this->l10n = $l10n;
- $this->config = $config;
+ $this->channelRepository = $channel;
+ $this->l10n = $l10n;
+ $this->config = $config;
}
public function createFromTableRow(array $row): TimelineEntity
*/
public function getForUser(int $uid): Timelines
{
- foreach ($this->channel->selectByUid($uid) as $channel) {
+ foreach ($this->channelRepository->selectByUid($uid) as $channel) {
$tabs[] = $channel;
}
public function isTimeline(string $selectedTab, int $uid): bool
{
- return is_numeric($selectedTab) && $uid && $this->channel->existsById($selectedTab, $uid);
+ return is_numeric($selectedTab) && $uid && $this->channelRepository->existsById($selectedTab, $uid);
}
}
use Friendica\Content\Conversation\Factory\Channel as ChannelFactory;
use Friendica\Content\Conversation\Factory\Community as CommunityFactory;
use Friendica\Content\Conversation\Factory\Network as NetworkFactory;
-use Friendica\Content\Conversation\Factory\UserDefinedChannel;
use Friendica\Content\Feature;
use Friendica\Content\Nav;
use Friendica\Content\Text\HTML;
/** @var SystemMessages */
protected $systemMessages;
/** @var ChannelFactory */
- protected $channelFactory;
+ protected $channel;
/** @var UserDefinedChannelFactory */
protected $userDefinedChannel;
/** @var CommunityFactory */
$this->conversation = $conversation;
$this->page = $page;
$this->systemMessages = $systemMessages;
- $this->channelFactory = $channelFactory;
+ $this->channel = $channelFactory;
$this->community = $community;
$this->networkFactory = $network;
$this->userDefinedChannel = $userDefinedChannel;
}
if (empty($request['mode']) || ($request['mode'] != 'raw')) {
- $tabs = $this->getTabArray($this->channelFactory->getTimelines($this->session->getLocalUserId()), 'channel');
+ $tabs = $this->getTabArray($this->channel->getTimelines($this->session->getLocalUserId()), 'channel');
$tabs = array_merge($tabs, $this->getTabArray($this->userDefinedChannel->getForUser($this->session->getLocalUserId()), 'channel'));
$tabs = array_merge($tabs, $this->getTabArray($this->community->getTimelines(true), 'channel'));
$o .= $this->conversation->statusEditor([], 0, true);
}
- if ($this->channelFactory->isTimeline($this->selectedTab) || $this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId())) {
+ if ($this->channel->isTimeline($this->selectedTab) || $this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId())) {
$items = $this->getChannelItems();
$order = 'created';
} else {
$this->selectedTab = ChannelEntity::FORYOU;
}
- if (!$this->channelFactory->isTimeline($this->selectedTab) && !$this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId()) && !$this->community->isTimeline($this->selectedTab)) {
+ if (!$this->channel->isTimeline($this->selectedTab) && !$this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId()) && !$this->community->isTimeline($this->selectedTab)) {
throw new HTTPException\BadRequestException($this->l10n->t('Channel not available.'));
}
/** @var TimelineFactory */
protected $timeline;
/** @var ChannelFactory */
- protected $channelFactory;
+ protected $channel;
/** @var UserDefinedChannelFactory */
protected $userDefinedChannel;
/** @var CommunityFactory */
$this->systemMessages = $systemMessages;
$this->conversation = $conversation;
$this->page = $page;
- $this->channelFactory = $channelFactory;
+ $this->channel = $channelFactory;
$this->community = $community;
$this->networkFactory = $network;
$this->userDefinedChannel = $userDefinedChannel;
$o = '';
- if ($this->channelFactory->isTimeline($this->selectedTab) || $this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId())) {
+ if ($this->channel->isTimeline($this->selectedTab) || $this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId())) {
$items = $this->getChannelItems();
} elseif ($this->community->isTimeline($this->selectedTab)) {
$items = $this->getCommunityItems();
$network_timelines = $this->pConfig->get($this->session->getLocalUserId(), 'system', 'network_timelines', []);
if (!empty($network_timelines)) {
- $tabs = array_merge($tabs, $this->getTabArray($this->channelFactory->getTimelines($this->session->getLocalUserId()), 'network', 'channel'));
+ $tabs = array_merge($tabs, $this->getTabArray($this->channel->getTimelines($this->session->getLocalUserId()), 'network', 'channel'));
$tabs = array_merge($tabs, $this->getTabArray($this->userDefinedChannel->getForUser($this->session->getLocalUserId()), 'network', 'channel'));
$tabs = array_merge($tabs, $this->getTabArray($this->community->getTimelines(true), 'network', 'channel'));
}
if (!$this->selectedTab) {
$this->selectedTab = self::getTimelineOrderBySession($this->session, $this->pConfig);
- } elseif (!$this->networkFactory->isTimeline($this->selectedTab) && !$this->channelFactory->isTimeline($this->selectedTab) && !$this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId()) && !$this->community->isTimeline($this->selectedTab)) {
+ } elseif (!$this->networkFactory->isTimeline($this->selectedTab) && !$this->channel->isTimeline($this->selectedTab) && !$this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId()) && !$this->community->isTimeline($this->selectedTab)) {
throw new HTTPException\BadRequestException($this->l10n->t('Network feed not available.'));
}
- if (($this->network || $this->circleId || $this->groupContactId) && ($this->channelFactory->isTimeline($this->selectedTab) || $this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId()) || $this->community->isTimeline($this->selectedTab))) {
+ if (($this->network || $this->circleId || $this->groupContactId) && ($this->channel->isTimeline($this->selectedTab) || $this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId()) || $this->community->isTimeline($this->selectedTab))) {
$this->selectedTab = NetworkEntity::RECEIVED;
}
$this->mention = false;
} elseif (in_array($this->selectedTab, [NetworkEntity::RECEIVED, NetworkEntity::STAR]) || $this->community->isTimeline($this->selectedTab)) {
$this->order = 'received';
- } elseif (($this->selectedTab == NetworkEntity::CREATED) || $this->channelFactory->isTimeline($this->selectedTab) || $this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId())) {
+ } elseif (($this->selectedTab == NetworkEntity::CREATED) || $this->channel->isTimeline($this->selectedTab) || $this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId())) {
$this->order = 'created';
} else {
$this->order = 'commented';
/** @var ICanCache */
protected $cache;
/** @var Channel */
- protected $channel;
+ protected $channelRepository;
public function __construct(Channel $channel, Mode $mode, IHandleUserSessions $session, Database $database, IManagePersonalConfigValues $pConfig, IManageConfigValues $config, ICanCache $cache, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
- $this->channel = $channel;
- $this->mode = $mode;
- $this->session = $session;
- $this->database = $database;
- $this->pConfig = $pConfig;
- $this->config = $config;
- $this->cache = $cache;
+ $this->channelRepository = $channel;
+ $this->mode = $mode;
+ $this->session = $session;
+ $this->database = $database;
+ $this->pConfig = $pConfig;
+ $this->config = $config;
+ $this->cache = $cache;
}
/**
private function getUserChannelConditions(int $id, int $uid): array
{
- $channel = $this->channel->selectById($id, $uid);
+ $channel = $this->channelRepository->selectById($id, $uid);
if (empty($channel)) {
return [];
}
$o = '';
if ($this->update || $this->force) {
- if ($this->channelFactory->isTimeline($this->selectedTab) || $this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId())) {
+ if ($this->channel->isTimeline($this->selectedTab) || $this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId())) {
$items = $this->getChannelItems();
} else {
$items = $this->getCommunityItems();
System::htmlUpdateExit($o);
}
- if ($this->channelFactory->isTimeline($this->selectedTab) || $this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId())) {
+ if ($this->channel->isTimeline($this->selectedTab) || $this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId())) {
$items = $this->getChannelItems();
} elseif ($this->community->isTimeline($this->selectedTab)) {
$items = $this->getCommunityItems();