Rename mastodon to fediverse

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
Carl Schwan 2022-11-21 16:44:55 +01:00
parent d847eacfbd
commit d1209d8302
16 changed files with 49 additions and 52 deletions

View file

@ -621,7 +621,7 @@ class UsersController extends AUserData {
$permittedFields[] = IAccountManager::PROPERTY_ADDRESS;
$permittedFields[] = IAccountManager::PROPERTY_WEBSITE;
$permittedFields[] = IAccountManager::PROPERTY_TWITTER;
$permittedFields[] = IAccountManager::PROPERTY_MASTODON;
$permittedFields[] = IAccountManager::PROPERTY_FEDIVERSE;
$permittedFields[] = IAccountManager::PROPERTY_ORGANISATION;
$permittedFields[] = IAccountManager::PROPERTY_ROLE;
$permittedFields[] = IAccountManager::PROPERTY_HEADLINE;
@ -783,7 +783,7 @@ class UsersController extends AUserData {
$permittedFields[] = IAccountManager::PROPERTY_ADDRESS;
$permittedFields[] = IAccountManager::PROPERTY_WEBSITE;
$permittedFields[] = IAccountManager::PROPERTY_TWITTER;
$permittedFields[] = IAccountManager::PROPERTY_MASTODON;
$permittedFields[] = IAccountManager::PROPERTY_FEDIVERSE;
$permittedFields[] = IAccountManager::PROPERTY_ORGANISATION;
$permittedFields[] = IAccountManager::PROPERTY_ROLE;
$permittedFields[] = IAccountManager::PROPERTY_HEADLINE;
@ -793,7 +793,7 @@ class UsersController extends AUserData {
$permittedFields[] = IAccountManager::PROPERTY_ADDRESS . self::SCOPE_SUFFIX;
$permittedFields[] = IAccountManager::PROPERTY_WEBSITE . self::SCOPE_SUFFIX;
$permittedFields[] = IAccountManager::PROPERTY_TWITTER . self::SCOPE_SUFFIX;
$permittedFields[] = IAccountManager::PROPERTY_MASTODON . self::SCOPE_SUFFIX;
$permittedFields[] = IAccountManager::PROPERTY_FEDIVERSE . self::SCOPE_SUFFIX;
$permittedFields[] = IAccountManager::PROPERTY_ORGANISATION . self::SCOPE_SUFFIX;
$permittedFields[] = IAccountManager::PROPERTY_ROLE . self::SCOPE_SUFFIX;
$permittedFields[] = IAccountManager::PROPERTY_HEADLINE . self::SCOPE_SUFFIX;
@ -830,7 +830,7 @@ class UsersController extends AUserData {
$permittedFields[] = IAccountManager::PROPERTY_ADDRESS;
$permittedFields[] = IAccountManager::PROPERTY_WEBSITE;
$permittedFields[] = IAccountManager::PROPERTY_TWITTER;
$permittedFields[] = IAccountManager::PROPERTY_MASTODON;
$permittedFields[] = IAccountManager::PROPERTY_FEDIVERSE;
$permittedFields[] = IAccountManager::PROPERTY_ORGANISATION;
$permittedFields[] = IAccountManager::PROPERTY_ROLE;
$permittedFields[] = IAccountManager::PROPERTY_HEADLINE;
@ -959,7 +959,7 @@ class UsersController extends AUserData {
case IAccountManager::PROPERTY_ADDRESS:
case IAccountManager::PROPERTY_WEBSITE:
case IAccountManager::PROPERTY_TWITTER:
case IAccountManager::PROPERTY_MASTODON:
case IAccountManager::PROPERTY_FEDIVERSE:
case IAccountManager::PROPERTY_ORGANISATION:
case IAccountManager::PROPERTY_ROLE:
case IAccountManager::PROPERTY_HEADLINE:
@ -1004,7 +1004,7 @@ class UsersController extends AUserData {
case IAccountManager::PROPERTY_ADDRESS . self::SCOPE_SUFFIX:
case IAccountManager::PROPERTY_WEBSITE . self::SCOPE_SUFFIX:
case IAccountManager::PROPERTY_TWITTER . self::SCOPE_SUFFIX:
case IAccountManager::PROPERTY_MASTODON . self::SCOPE_SUFFIX:
case IAccountManager::PROPERTY_FEDIVERSE . self::SCOPE_SUFFIX:
case IAccountManager::PROPERTY_ORGANISATION . self::SCOPE_SUFFIX:
case IAccountManager::PROPERTY_ROLE . self::SCOPE_SUFFIX:
case IAccountManager::PROPERTY_HEADLINE . self::SCOPE_SUFFIX:

View file

@ -358,8 +358,8 @@ class UsersController extends Controller {
* @param string|null $addressScope
* @param string|null $twitter
* @param string|null $twitterScope
* @param string|null $mastodon
* @param string|null $mastodonScope
* @param string|null $fediverse
* @param string|null $fediverseScope
*
* @return DataResponse
*/
@ -374,8 +374,10 @@ class UsersController extends Controller {
?string $websiteScope = null,
?string $address = null,
?string $addressScope = null,
?string $mastodon = null,
?string $mastodonScope = null
?string $twitter = null,
?string $twitterScope = null,
?string $fediverse = null,
?string $fediverseScope = null
) {
$user = $this->userSession->getUser();
if (!$user instanceof IUser) {
@ -414,7 +416,7 @@ class UsersController extends Controller {
IAccountManager::PROPERTY_ADDRESS => ['value' => $address, 'scope' => $addressScope],
IAccountManager::PROPERTY_PHONE => ['value' => $phone, 'scope' => $phoneScope],
IAccountManager::PROPERTY_TWITTER => ['value' => $twitter, 'scope' => $twitterScope],
IAccountManager::PROPERTY_MASTODON => ['value' => $mastodon, 'scope' => $mastodonScope],
IAccountManager::PROPERTY_FEDIVERSE => ['value' => $fediverse, 'scope' => $fediverseScope],
];
$allowUserToChangeDisplayName = $this->config->getSystemValueBool('allow_user_to_change_display_name', true);
foreach ($updatable as $property => $data) {
@ -454,8 +456,8 @@ class UsersController extends Controller {
'addressScope' => $userAccount->getProperty(IAccountManager::PROPERTY_ADDRESS)->getScope(),
'twitter' => $userAccount->getProperty(IAccountManager::PROPERTY_TWITTER)->getValue(),
'twitterScope' => $userAccount->getProperty(IAccountManager::PROPERTY_TWITTER)->getScope(),
'mastodon' => $userAccount->getProperty(IAccountManager::PROPERTY_TWITTER)->getValue(),
'mastodonScope' => $userAccount->getProperty(IAccountManager::PROPERTY_MASTODON)->getScope(),
'fediverse' => $userAccount->getProperty(IAccountManager::PROPERTY_FEDIVERSE)->getValue(),
'fediverseScope' => $userAccount->getProperty(IAccountManager::PROPERTY_FEDIVERSE)->getScope(),
'message' => $this->l10n->t('Settings saved'),
],
],

View file

@ -157,7 +157,7 @@ class PersonalInfo implements ISettings {
'location' => $this->getProperty($account, IAccountManager::PROPERTY_ADDRESS),
'website' => $this->getProperty($account, IAccountManager::PROPERTY_WEBSITE),
'twitter' => $this->getProperty($account, IAccountManager::PROPERTY_TWITTER),
'mastodon' => $this->getProperty($account, IAccountManager::PROPERTY_MASTODON),
'fediverse' => $this->getProperty($account, IAccountManager::PROPERTY_FEDIVERSE),
'languageMap' => $this->getLanguageMap($user),
'localeMap' => $this->getLocaleMap($user),
'profileEnabledGlobally' => $this->profileManager->isProfileEnabled(),

View file

@ -21,8 +21,8 @@
-->
<template>
<AccountPropertySection v-bind.sync="mastodon"
:placeholder="t('settings', 'Your Mastodon handle')" />
<AccountPropertySection v-bind.sync="fediverse"
:placeholder="t('settings', 'Your handle')" />
</template>
<script>
@ -32,10 +32,10 @@ import AccountPropertySection from './shared/AccountPropertySection.vue'
import { NAME_READABLE_ENUM } from '../../constants/AccountPropertyConstants.js'
const { mastodon } = loadState('settings', 'personalInfoParameters', {})
const { fediverse } = loadState('settings', 'personalInfoParameters', {})
export default {
name: 'TwitterSection',
name: 'FediverseSection',
components: {
AccountPropertySection,
@ -43,7 +43,7 @@ export default {
data() {
return {
mastodon: { ...mastodon, readable: NAME_READABLE_ENUM[mastodon.name] },
fediverse: { ...fediverse, readable: NAME_READABLE_ENUM[fediverse.name] },
}
},
}

View file

@ -36,7 +36,7 @@ export const ACCOUNT_PROPERTY_ENUM = Object.freeze({
EMAIL: 'email',
HEADLINE: 'headline',
NOTIFICATION_EMAIL: 'notify_email',
MASTODON: 'mastodon',
FEDIVERSE: 'fediverse',
ORGANISATION: 'organisation',
PHONE: 'phone',
PROFILE_ENABLED: 'profile_enabled',
@ -59,7 +59,7 @@ export const ACCOUNT_PROPERTY_READABLE_ENUM = Object.freeze({
PROFILE_ENABLED: t('settings', 'Profile'),
ROLE: t('settings', 'Role'),
TWITTER: t('settings', 'Twitter'),
MASTODON: t('settings', 'Fediverse (e.g. Mastodon)'),
FEDIVERSE: t('settings', 'Fediverse (e.g. Mastodon)'),
WEBSITE: t('settings', 'Website'),
})
@ -76,7 +76,7 @@ export const NAME_READABLE_ENUM = Object.freeze({
[ACCOUNT_PROPERTY_ENUM.PROFILE_ENABLED]: ACCOUNT_PROPERTY_READABLE_ENUM.PROFILE_ENABLED,
[ACCOUNT_PROPERTY_ENUM.ROLE]: ACCOUNT_PROPERTY_READABLE_ENUM.ROLE,
[ACCOUNT_PROPERTY_ENUM.TWITTER]: ACCOUNT_PROPERTY_READABLE_ENUM.TWITTER,
[ACCOUNT_PROPERTY_ENUM.MASTODON]: ACCOUNT_PROPERTY_READABLE_ENUM.MASTODON,
[ACCOUNT_PROPERTY_ENUM.FEDIVERSE]: ACCOUNT_PROPERTY_READABLE_ENUM.FEDIVERSE,
[ACCOUNT_PROPERTY_ENUM.WEBSITE]: ACCOUNT_PROPERTY_READABLE_ENUM.WEBSITE,
})
@ -99,7 +99,7 @@ export const PROPERTY_READABLE_KEYS_ENUM = Object.freeze({
[ACCOUNT_PROPERTY_READABLE_ENUM.PROFILE_ENABLED]: ACCOUNT_PROPERTY_ENUM.PROFILE_ENABLED,
[ACCOUNT_PROPERTY_READABLE_ENUM.ROLE]: ACCOUNT_PROPERTY_ENUM.ROLE,
[ACCOUNT_PROPERTY_READABLE_ENUM.TWITTER]: ACCOUNT_PROPERTY_ENUM.TWITTER,
[ACCOUNT_PROPERTY_READABLE_ENUM.MASTODON]: ACCOUNT_PROPERTY_ENUM.MASTODON,
[ACCOUNT_PROPERTY_READABLE_ENUM.FEDIVERSE]: ACCOUNT_PROPERTY_ENUM.FEDIVERSE,
[ACCOUNT_PROPERTY_READABLE_ENUM.WEBSITE]: ACCOUNT_PROPERTY_ENUM.WEBSITE,
})
@ -141,7 +141,7 @@ export const PROPERTY_READABLE_SUPPORTED_SCOPES_ENUM = Object.freeze({
[ACCOUNT_PROPERTY_READABLE_ENUM.PROFILE_ENABLED]: [SCOPE_ENUM.LOCAL, SCOPE_ENUM.PRIVATE],
[ACCOUNT_PROPERTY_READABLE_ENUM.ROLE]: [SCOPE_ENUM.LOCAL, SCOPE_ENUM.PRIVATE],
[ACCOUNT_PROPERTY_READABLE_ENUM.TWITTER]: [SCOPE_ENUM.LOCAL, SCOPE_ENUM.PRIVATE],
[ACCOUNT_PROPERTY_READABLE_ENUM.MASTODON]: [SCOPE_ENUM.LOCAL, SCOPE_ENUM.PRIVATE],
[ACCOUNT_PROPERTY_READABLE_ENUM.FEDIVERSE]: [SCOPE_ENUM.LOCAL, SCOPE_ENUM.PRIVATE],
[ACCOUNT_PROPERTY_READABLE_ENUM.WEBSITE]: [SCOPE_ENUM.LOCAL, SCOPE_ENUM.PRIVATE],
})

View file

@ -34,7 +34,7 @@ import PhoneSection from './components/PersonalInfo/PhoneSection.vue'
import LocationSection from './components/PersonalInfo/LocationSection.vue'
import WebsiteSection from './components/PersonalInfo/WebsiteSection.vue'
import TwitterSection from './components/PersonalInfo/TwitterSection.vue'
import MastodonSection from './components/PersonalInfo/MastodonSection.vue'
import FediverseSection from './components/PersonalInfo/FediverseSection.vue'
import LanguageSection from './components/PersonalInfo/LanguageSection/LanguageSection.vue'
import LocaleSection from './components/PersonalInfo/LocaleSection/LocaleSection.vue'
import ProfileSection from './components/PersonalInfo/ProfileSection/ProfileSection.vue'
@ -62,7 +62,7 @@ const PhoneView = Vue.extend(PhoneSection)
const LocationView = Vue.extend(LocationSection)
const WebsiteView = Vue.extend(WebsiteSection)
const TwitterView = Vue.extend(TwitterSection)
const MastodonView = Vue.extend(MastodonSection)
const FediverseView = Vue.extend(FediverseSection)
const LanguageView = Vue.extend(LanguageSection)
const LocaleView = Vue.extend(LocaleSection)
@ -74,7 +74,7 @@ new PhoneView().$mount('#vue-phone-section')
new LocationView().$mount('#vue-location-section')
new WebsiteView().$mount('#vue-website-section')
new TwitterView().$mount('#vue-twitter-section')
new MastodonView().$mount('#vue-mastodon-section')
new FediverseView().$mount('#vue-fediverse-section')
new LanguageView().$mount('#vue-language-section')
new LocaleView().$mount('#vue-locale-section')

View file

@ -83,7 +83,7 @@ script('settings', [
<div id="vue-twitter-section"></div>
</div>
<div class="personal-settings-setting-box">
<div id="vue-mastodon-section"></div>
<div id="vue-fediverse-section"></div>
</div>
<?php if ($_['profileEnabledGlobally']) : ?>
<div class="personal-settings-setting-box">

View file

@ -1299,11 +1299,6 @@
<code>\Sabre\Uri\split($this-&gt;principalInfo['uri'])</code>
</UndefinedFunction>
</file>
<file src="apps/files_versions/lib/Storage.php">
<InvalidScalarArgument occurrences="1">
<code>$timestamp</code>
</InvalidScalarArgument>
</file>
<file src="apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php">
<InvalidScalarArgument occurrences="1">
<code>$this-&gt;retries + 1</code>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -131,7 +131,7 @@ class AccountManager implements IAccountManager {
self::PROPERTY_AVATAR => self::SCOPE_FEDERATED,
self::PROPERTY_PHONE => self::SCOPE_LOCAL,
self::PROPERTY_TWITTER => self::SCOPE_LOCAL,
self::PROPERTY_MASTODON => self::SCOPE_LOCAL,
self::PROPERTY_FEDIVERSE => self::SCOPE_LOCAL,
self::PROPERTY_ORGANISATION => self::SCOPE_LOCAL,
self::PROPERTY_ROLE => self::SCOPE_LOCAL,
self::PROPERTY_HEADLINE => self::SCOPE_LOCAL,
@ -526,7 +526,7 @@ class AccountManager implements IAccountManager {
protected function updateVerificationStatus(IAccount $updatedAccount, array $oldData): void {
static $propertiesVerifiableByLookupServer = [
self::PROPERTY_TWITTER,
self::PROPERTY_MASTODON,
self::PROPERTY_FEDIVERSE,
self::PROPERTY_WEBSITE,
self::PROPERTY_EMAIL,
];
@ -726,9 +726,9 @@ class AccountManager implements IAccountManager {
],
[
'name' => self::PROPERTY_MASTODON,
'name' => self::PROPERTY_FEDIVERSE,
'value' => '',
'scope' => $scopes[self::PROPERTY_MASTODON],
'scope' => $scopes[self::PROPERTY_FEDIVERSE],
'verified' => self::NOT_VERIFIED,
],

View file

@ -33,7 +33,7 @@ use OCP\IUser;
use OCP\L10N\IFactory;
use OCP\Profile\ILinkAction;
class MastodonAction implements ILinkAction {
class FediverseAction implements ILinkAction {
private ?string $value = null;
private IAccountManager $accountManager;
private IFactory $l10nFactory;
@ -51,7 +51,7 @@ class MastodonAction implements ILinkAction {
public function preload(IUser $targetUser): void {
$account = $this->accountManager->getAccount($targetUser);
$this->value = $account->getProperty(IAccountManager::PROPERTY_MASTODON)->getValue();
$this->value = $account->getProperty(IAccountManager::PROPERTY_FEDIVERSE)->getValue();
}
public function getAppId(): string {
@ -59,16 +59,16 @@ class MastodonAction implements ILinkAction {
}
public function getId(): string {
return IAccountManager::PROPERTY_MASTODON;
return IAccountManager::PROPERTY_FEDIVERSE;
}
public function getDisplayId(): string {
return $this->l10nFactory->get('lib')->t('Mastodon');
return $this->l10nFactory->get('lib')->t('Fediverse');
}
public function getTitle(): string {
$displayUsername = $this->value[0] === '@' ? $this->value : '@' . $this->value;
return $this->l10nFactory->get('lib')->t('View %s on Mastodon', [$displayUsername]);
return $this->l10nFactory->get('lib')->t('View %s on the fediverse', [$displayUsername]);
}
public function getPriority(): int {

View file

@ -35,7 +35,7 @@ use OC\KnownUser\KnownUserService;
use OC\Profile\Actions\EmailAction;
use OC\Profile\Actions\PhoneAction;
use OC\Profile\Actions\TwitterAction;
use OC\Profile\Actions\MastodonAction;
use OC\Profile\Actions\FediverseAction;
use OC\Profile\Actions\WebsiteAction;
use OCP\Accounts\IAccountManager;
use OCP\Accounts\PropertyDoesNotExistException;
@ -96,7 +96,7 @@ class ProfileManager {
PhoneAction::class,
WebsiteAction::class,
TwitterAction::class,
MastodonAction::class,
FediverseAction::class,
];
/**

View file

@ -112,7 +112,7 @@ interface IAccountManager {
public const PROPERTY_WEBSITE = 'website';
public const PROPERTY_ADDRESS = 'address';
public const PROPERTY_TWITTER = 'twitter';
public const PROPERTY_MASTODON = 'mastodon';
public const PROPERTY_FEDIVERSE = 'fediverse';
/**
* @since 23.0.0
@ -152,7 +152,7 @@ interface IAccountManager {
self::PROPERTY_WEBSITE,
self::PROPERTY_ADDRESS,
self::PROPERTY_TWITTER,
self::PROPERTY_MASTODON,
self::PROPERTY_FEDIVERSE,
self::PROPERTY_ORGANISATION,
self::PROPERTY_ROLE,
self::PROPERTY_HEADLINE,