use Friendica\BaseModule;
use Friendica\Content\Conversation\Collection\Timelines;
use Friendica\Content\Conversation\Entity\Channel as ChannelEntity;
+use Friendica\Content\Conversation\Entity\Community;
use Friendica\Content\Conversation\Entity\UserDefinedChannel as UserDefinedChannelEntity;
use Friendica\Content\Conversation\Repository\UserDefinedChannel;
use Friendica\Core\Cache\Capability\ICanCache;
/** @var bool */
protected $update;
/** @var bool */
+ protected $ping;
+ /** @var bool */
protected $raw;
/** @var string */
protected $order;
if (!empty($channel->fullTextSearch)) {
if (!empty($channel->includeTags)) {
- $additional = self:: addIncludeTags($channel->includeTags);
+ $additional = $this->addIncludeTags($channel->includeTags);
} else {
$additional = '';
}
}
if (!empty($channel->mediaType)) {
- $additional .= self::addMediaTerms($channel->mediaType);
+ $additional .= $this->addMediaTerms($channel->mediaType);
}
- $additional .= self::addLanguageSearchTerms($uid, $channel->languages);
+ $additional .= $this->addLanguageSearchTerms($uid, $channel->languages);
if ($additional) {
$searchterms = '+(' . trim($channel->fullTextSearch) . ')' . $additional;
{
$items = $this->selectItems();
- if ($this->selectedTab == 'local') {
+ if ($this->selectedTab == Community::LOCAL) {
$maxpostperauthor = (int)$this->config->get('system', 'max_author_posts_community_page');
$key = 'author-id';
- } elseif ($this->selectedTab == 'global') {
+ } elseif ($this->selectedTab == Community::GLOBAL) {
$maxpostperauthor = (int)$this->config->get('system', 'max_server_posts_community_page');
$key = 'author-gsid';
} else {
{
$this->order = 'received';
- if ($this->selectedTab == 'local') {
+ if ($this->selectedTab == Community::LOCAL) {
$condition = ["`wall` AND `origin` AND `private` = ?", Item::PUBLIC];
} elseif ($this->selectedTab == 'global') {
$condition = ["`uid` = ? AND `private` = ?", 0, Item::PUBLIC];
}
$items = [];
- $result = Post::selectThreadForUser($this->session->getLocalUserId() ?: 0, ['uri-id', 'received', 'author-id', 'author-gsid'], $condition, $params);
+ if ($this->selectedTab == Community::LOCAL) {
+ $result = Post::selectOriginThread(['uri-id', 'received', 'author-id', 'author-gsid'], $condition, $params);
+ } else {
+ $result = Post::selectThreadForUser($this->session->getLocalUserId() ?: 0, ['uri-id', 'received', 'author-id', 'author-gsid'], $condition, $params);
+ }
while ($item = $this->database->fetch($result)) {
$item['comments'] = 0;
*/
protected function setItemsSeenByCondition(array $condition)
{
- if (empty($condition)) {
+ if (empty($condition) || $this->ping) {
return;
}