-- ------------------------------------------
-- Friendica 2022.05-dev (Siberian Iris)
--- DB_UPDATE_VERSION 1452
+-- DB_UPDATE_VERSION 1453
-- ------------------------------------------
`contact`.`archive` AS `archive`,
`contact`.`deleted` AS `deleted`,
`contact`.`blocked` AS `blocked`,
- `contact`.`request` AS `dfrn-request`,
`contact`.`notify` AS `dfrn-notify`,
`contact`.`poll` AS `dfrn-poll`,
- `contact`.`confirm` AS `dfrn-confirm`,
`fcontact`.`guid` AS `diaspora-guid`,
`fcontact`.`batch` AS `diaspora-batch`,
`fcontact`.`notify` AS `diaspora-notify`,
`apcontact`.`generator` AS `ap-generator`,
`apcontact`.`following_count` AS `ap-following_count`,
`apcontact`.`followers_count` AS `ap-followers_count`,
- `apcontact`.`statuses_count` AS `ap-statuses_count`
+ `apcontact`.`statuses_count` AS `ap-statuses_count`,
+ `gserver`.`site_name` AS `site_name`,
+ `gserver`.`platform` AS `platform`,
+ `gserver`.`version` AS `version`
FROM `contact`
LEFT JOIN `item-uri` ON `item-uri`.`id` = `contact`.`uri-id`
LEFT JOIN `apcontact` ON `apcontact`.`uri-id` = `contact`.`uri-id`
LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = contact.`uri-id`
+ LEFT JOIN `gserver` ON `gserver`.`id` = contact.`gsid`
WHERE `contact`.`uid` = 0;
--
`ucontact`.`subhub` AS `subhub`,
`ucontact`.`hub-verify` AS `hub-verify`,
`ucontact`.`reason` AS `reason`,
- `contact`.`request` AS `dfrn-request`,
`contact`.`notify` AS `dfrn-notify`,
`contact`.`poll` AS `dfrn-poll`,
- `contact`.`confirm` AS `dfrn-confirm`,
`fcontact`.`guid` AS `diaspora-guid`,
`fcontact`.`batch` AS `diaspora-batch`,
`fcontact`.`notify` AS `diaspora-notify`,
`apcontact`.`generator` AS `ap-generator`,
`apcontact`.`following_count` AS `ap-following_count`,
`apcontact`.`followers_count` AS `ap-followers_count`,
- `apcontact`.`statuses_count` AS `ap-statuses_count`
+ `apcontact`.`statuses_count` AS `ap-statuses_count`,
+ `gserver`.`site_name` AS `site_name`,
+ `gserver`.`platform` AS `platform`,
+ `gserver`.`version` AS `version`
FROM `contact` AS `ucontact`
INNER JOIN `contact` ON `contact`.`uri-id` = `ucontact`.`uri-id` AND `contact`.`uid` = 0
LEFT JOIN `item-uri` ON `item-uri`.`id` = `ucontact`.`uri-id`
LEFT JOIN `apcontact` ON `apcontact`.`uri-id` = `ucontact`.`uri-id`
- LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = `ucontact`.`uri-id` AND `fcontact`.`network` = 'dspr';
+ LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = `ucontact`.`uri-id` AND `fcontact`.`network` = 'dspr'
+ LEFT JOIN `gserver` ON `gserver`.`id` = contact.`gsid`;
--
-- VIEW pending-view
$params = ['order' => ['name']];
}
- $condition_str = "`network` IN (?, ?) AND `uid` = ? AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND ";
-
- if ($showprivate) {
- $condition_str .= '(`forum` OR `prv`)';
- } else {
- $condition_str .= '`forum`';
+ $condition = [
+ 'contact-type' => Contact::TYPE_COMMUNITY,
+ 'network' => [Protocol::DFRN, Protocol::ACTIVITYPUB],
+ 'uid' => $uid,
+ 'blocked' => false,
+ 'pending' => false,
+ 'archive' => false,
+ ];
+
+ $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);
}
use Friendica\Database\DBA;
if (!defined('DB_UPDATE_VERSION')) {
- define('DB_UPDATE_VERSION', 1452);
+ define('DB_UPDATE_VERSION', 1453);
}
return [
"archive" => ["contact", "archive"],
"deleted" => ["contact", "deleted"],
"blocked" => ["contact", "blocked"],
- "dfrn-request" => ["contact", "request"],
"dfrn-notify" => ["contact", "notify"],
"dfrn-poll" => ["contact", "poll"],
- "dfrn-confirm" => ["contact", "confirm"],
"diaspora-guid" => ["fcontact", "guid"],
"diaspora-batch" => ["fcontact", "batch"],
"diaspora-notify" => ["fcontact", "notify"],
"ap-following_count" => ["apcontact", "following_count"],
"ap-followers_count" => ["apcontact", "followers_count"],
"ap-statuses_count" => ["apcontact", "statuses_count"],
+ "site_name" => ["gserver", "site_name"],
+ "platform" => ["gserver", "platform"],
+ "version" => ["gserver", "version"],
],
"query" => "FROM `contact`
LEFT JOIN `item-uri` ON `item-uri`.`id` = `contact`.`uri-id`
LEFT JOIN `apcontact` ON `apcontact`.`uri-id` = `contact`.`uri-id`
LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = contact.`uri-id`
+ LEFT JOIN `gserver` ON `gserver`.`id` = contact.`gsid`
WHERE `contact`.`uid` = 0"
],
"account-user-view" => [
"subhub" => ["ucontact", "subhub"],
"hub-verify" => ["ucontact", "hub-verify"],
"reason" => ["ucontact", "reason"],
- "dfrn-request" => ["contact", "request"],
"dfrn-notify" => ["contact", "notify"],
"dfrn-poll" => ["contact", "poll"],
- "dfrn-confirm" => ["contact", "confirm"],
"diaspora-guid" => ["fcontact", "guid"],
"diaspora-batch" => ["fcontact", "batch"],
"diaspora-notify" => ["fcontact", "notify"],
"ap-following_count" => ["apcontact", "following_count"],
"ap-followers_count" => ["apcontact", "followers_count"],
"ap-statuses_count" => ["apcontact", "statuses_count"],
+ "site_name" => ["gserver", "site_name"],
+ "platform" => ["gserver", "platform"],
+ "version" => ["gserver", "version"],
],
"query" => "FROM `contact` AS `ucontact`
INNER JOIN `contact` ON `contact`.`uri-id` = `ucontact`.`uri-id` AND `contact`.`uid` = 0
LEFT JOIN `item-uri` ON `item-uri`.`id` = `ucontact`.`uri-id`
LEFT JOIN `apcontact` ON `apcontact`.`uri-id` = `ucontact`.`uri-id`
- LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = `ucontact`.`uri-id` AND `fcontact`.`network` = 'dspr'"
+ LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = `ucontact`.`uri-id` AND `fcontact`.`network` = 'dspr'
+ LEFT JOIN `gserver` ON `gserver`.`id` = contact.`gsid`"
],
"pending-view" => [
"fields" => [