mirror of
https://github.com/friendica/friendica
synced 2025-04-26 15:10:11 +00:00
Don't display Peertube groups as forums
This commit is contained in:
parent
aa1ef0516d
commit
8c34c3b8ae
4 changed files with 36 additions and 22 deletions
|
@ -57,23 +57,29 @@ class ForumManager
|
|||
$params = ['order' => ['name']];
|
||||
}
|
||||
|
||||
$condition_str = "`network` IN (?, ?) AND `uid` = ? AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND ";
|
||||
$condition = [
|
||||
'contact-type' => Contact::TYPE_COMMUNITY,
|
||||
'network' => [Protocol::DFRN, Protocol::ACTIVITYPUB],
|
||||
'uid' => $uid,
|
||||
'blocked' => false,
|
||||
'pending' => false,
|
||||
'archive' => false,
|
||||
];
|
||||
|
||||
if ($showprivate) {
|
||||
$condition_str .= '(`forum` OR `prv`)';
|
||||
} else {
|
||||
$condition_str .= '`forum`';
|
||||
$condition = DBA::mergeConditions($condition, ["`platform` != ?", 'peertube']);
|
||||
|
||||
if (!$showprivate) {
|
||||
$condition = DBA::mergeConditions($condition, ['manually-approve' => false]);
|
||||
}
|
||||
|
||||
if (!$showhidden) {
|
||||
$condition_str .= ' AND NOT `hidden`';
|
||||
$condition = DBA::mergeConditions($condition, ['hidden' => false]);
|
||||
}
|
||||
|
||||
$forumlist = [];
|
||||
|
||||
$fields = ['id', 'url', 'name', 'micro', 'thumb', 'avatar', 'network', 'uid'];
|
||||
$condition = [$condition_str, Protocol::DFRN, Protocol::ACTIVITYPUB, $uid];
|
||||
$contacts = DBA::select('contact', $fields, $condition, $params);
|
||||
$contacts = DBA::select('account-user-view', $fields, $condition, $params);
|
||||
if (!$contacts) {
|
||||
return($forumlist);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue