Use channels for non public content

This commit is contained in:
Michael 2023-09-17 19:28:38 +00:00
parent a1f6e6e871
commit b00c2070d7
9 changed files with 67 additions and 58 deletions

View file

@ -340,13 +340,8 @@ class Profile extends BaseModule
];
}
if (in_array($contact['network'], Protocol::FEDERATED)) {
$channel_settings_label = $this->t('Channel Settings');
$channel_frequency = Contact\User::getChannelFrequency($contact['id'], $this->session->getLocalUserId());
} else {
$channel_settings_label = null;
$channel_frequency = null;
}
$channel_settings_label = $this->t('Channel Settings');
$channel_frequency = Contact\User::getChannelFrequency($contact['id'], $this->session->getLocalUserId());
$poll_interval = null;
if ((($contact['network'] == Protocol::FEED) && !$this->config->get('system', 'adjust_poll_frequency')) || ($contact['network'] == Protocol::MAIL)) {

View file

@ -306,6 +306,8 @@ class Timeline extends BaseModule
$condition = $this->addLanguageCondition($uid, $condition);
}
$condition = DBA::mergeConditions($condition, ["(NOT `restricted` OR EXISTS(SELECT `id` FROM `post-user` WHERE `uid` = ? AND `uri-id` = `post-engagement`.`uri-id`))", $uid]);
$condition = DBA::mergeConditions($condition, ["NOT EXISTS(SELECT `cid` FROM `user-contact` WHERE `uid` = ? AND `cid` = `post-engagement`.`owner-id` AND (`ignored` OR `blocked` OR `collapsed` OR `is-blocked` OR `channel-frequency` = ?))", $uid, Contact\User::FREQUENCY_NEVER]);
if (($this->selectedTab != TimelineEntity::WHATSHOT) && !is_null($this->accountType)) {
@ -381,7 +383,7 @@ class Timeline extends BaseModule
return $comments;
}
$condition = ["`contact-type` != ? AND `comments` > ?", Contact::TYPE_COMMUNITY, 0];
$condition = ["`contact-type` != ? AND `comments` > ? AND NOT `restricted`", Contact::TYPE_COMMUNITY, 0];
$condition = $this->addLanguageCondition($uid, $condition);
$limit = $this->database->count('post-engagement', $condition) / $divider;
@ -405,7 +407,7 @@ class Timeline extends BaseModule
return $activities;
}
$condition = ["`contact-type` != ? AND `activities` > ?", Contact::TYPE_COMMUNITY, 0];
$condition = ["`contact-type` != ? AND `activities` > ? AND NOT `restricted`", Contact::TYPE_COMMUNITY, 0];
$condition = $this->addLanguageCondition($uid, $condition);
$limit = $this->database->count('post-engagement', $condition) / $divider;