use Friendica\App;
use Friendica\Content\Conversation\Collection\Timelines;
use Friendica\Content\Text\BBCode;
+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\Timeline as TimelineFactory;
+use Friendica\Content\Conversation\Repository;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
private $app;
/** @var SystemMessages */
private $systemMessages;
+ /** @var ChannelFactory */
+ protected $channel;
+ /** @var Repository\UserDefinedChannel */
+ protected $userDefinedChannel;
+ /** @var CommunityFactory */
+ protected $community;
+ /** @var NetworkFactory */
+ protected $network;
/** @var TimelineFactory */
protected $timeline;
- public function __construct(TimelineFactory $timeline, SystemMessages $systemMessages, App $app, IManagePersonalConfigValues $pConfig, IManageConfigValues $config, IHandleUserSessions $session, App\Page $page, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
+ public function __construct(Repository\UserDefinedChannel $userDefinedChannel, NetworkFactory $network, CommunityFactory $community, ChannelFactory $channel, TimelineFactory $timeline, SystemMessages $systemMessages, App $app, IManagePersonalConfigValues $pConfig, IManageConfigValues $config, IHandleUserSessions $session, App\Page $page, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{
parent::__construct($session, $page, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
- $this->config = $config;
- $this->pConfig = $pConfig;
- $this->app = $app;
- $this->systemMessages = $systemMessages;
- $this->timeline = $timeline;
+ $this->config = $config;
+ $this->pConfig = $pConfig;
+ $this->app = $app;
+ $this->systemMessages = $systemMessages;
+ $this->timeline = $timeline;
+ $this->channel = $channel;
+ $this->community = $community;
+ $this->network = $network;
+ $this->userDefinedChannel = $userDefinedChannel;
}
protected function post(array $request = [])
$timelines[] = [
'label' => $timeline->label,
'description' => $timeline->description,
- 'enable' => ["enable{$timeline->code}", '', in_array($timeline->code, $enabled_timelines)],
- 'bookmark' => ["bookmark{$timeline->code}", '', in_array($timeline->code, $bookmarked_timelines)],
+ 'enable' => ["enable[{$timeline->code}]", '', in_array($timeline->code, $enabled_timelines)],
+ 'bookmark' => ["bookmark[{$timeline->code}]", '', in_array($timeline->code, $bookmarked_timelines)],
];
}
{
$timelines = [];
- foreach ($this->timeline->getNetworkFeeds('') as $channel) {
+ foreach ($this->network->getTimelines('') as $channel) {
$timelines[] = $channel;
}
return new Timelines($timelines);
}
- foreach ($this->timeline->getChannelsForUser($uid) as $channel) {
+ foreach ($this->channel->getTimelines($uid) as $channel) {
$timelines[] = $channel;
}
- foreach ($this->timeline->getCommunities(true) as $community) {
+ foreach ($this->userDefinedChannel->selectByUid($uid) as $channel) {
+ $timelines[] = $channel;
+ }
+
+ foreach ($this->community->getTimelines(true) as $community) {
$timelines[] = $community;
}