New user account type "Channel Relay"

This commit is contained in:
Michael 2024-01-06 17:27:42 +00:00
parent 16b12e1545
commit 811a9f01bc
12 changed files with 434 additions and 261 deletions

View file

@ -432,11 +432,15 @@ class Timeline extends BaseModule
$conditions = [];
$languages = $languages ?: User::getWantedLanguages($uid);
foreach ($languages as $language) {
$conditions[] = "JSON_EXTRACT(JSON_KEYS(language), '$[0]') = ?";
$condition[] = $language;
if ($language == 'un') {
$conditions[] = "`language` IS NULL";
} else {
$conditions[] = "JSON_EXTRACT(JSON_KEYS(language), '$[0]') = ?";
$condition[] = $language;
}
}
if (!empty($conditions)) {
$condition[0] .= " AND (`language` IS NULL OR " . implode(' OR ', $conditions) . ")";
$condition[0] .= " AND (" . implode(' OR ', $conditions) . ")";
}
return $condition;
}

View file

@ -316,6 +316,8 @@ class Account extends BaseSettings
$page_flags = User::PAGE_FLAGS_SOAPBOX;
} elseif ($account_type == User::ACCOUNT_TYPE_COMMUNITY && !in_array($page_flags, [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP])) {
$page_flags = User::PAGE_FLAGS_COMMUNITY;
} elseif ($account_type == User::ACCOUNT_TYPE_RELAY && $page_flags != User::PAGE_FLAGS_SOAPBOX) {
$page_flags = User::PAGE_FLAGS_SOAPBOX;
}
$fields = [
@ -433,6 +435,7 @@ class Account extends BaseSettings
'$type_organisation' => User::ACCOUNT_TYPE_ORGANISATION,
'$type_news' => User::ACCOUNT_TYPE_NEWS,
'$type_community' => User::ACCOUNT_TYPE_COMMUNITY,
'$type_relay' => User::ACCOUNT_TYPE_RELAY,
'$account_person' => [
'account-type',
DI::l10n()->t('Personal Page'),
@ -461,6 +464,13 @@ class Account extends BaseSettings
DI::l10n()->t('Account for community discussions.'),
$user['account-type'] == User::ACCOUNT_TYPE_COMMUNITY
],
'$account_relay' => [
'account-type',
DI::l10n()->t('Channel Relay'),
User::ACCOUNT_TYPE_RELAY,
DI::l10n()->t('Account for a service that automatically shares content based on user defined channels.'),
$user['account-type'] == User::ACCOUNT_TYPE_RELAY
],
'$page_normal' => [
'page-flags',
DI::l10n()->t('Normal Account Page'),