Fix code style

This commit is contained in:
Art4 2025-05-13 06:18:41 +00:00
parent b2bbcc4965
commit 02fae146e6
17 changed files with 134 additions and 118 deletions

View file

@ -283,9 +283,15 @@ class Profile extends BaseModule
]); ]);
switch ($localRelationship->rel) { switch ($localRelationship->rel) {
case ContactModel::FRIEND: $relation_text = $this->t('You are mutual friends with %s', $contact['name']); break; case ContactModel::FRIEND:
case ContactModel::FOLLOWER: $relation_text = $this->t('You are sharing with %s', $contact['name']); break; $relation_text = $this->t('You are mutual friends with %s', $contact['name']);
case ContactModel::SHARING: $relation_text = $this->t('%s is sharing with you', $contact['name']); break; break;
case ContactModel::FOLLOWER:
$relation_text = $this->t('You are sharing with %s', $contact['name']);
break;
case ContactModel::SHARING:
$relation_text = $this->t('%s is sharing with you', $contact['name']);
break;
default: default:
$relation_text = ''; $relation_text = '';
} }
@ -308,8 +314,7 @@ class Profile extends BaseModule
$this->logger->notice('Empty gsid for contact', ['contact' => $contact]); $this->logger->notice('Empty gsid for contact', ['contact' => $contact]);
} }
$serverIgnored = $serverIgnored = $contact['gsid'] &&
$contact['gsid'] &&
$this->userGServer->isIgnoredByUser($this->session->getLocalUserId(), $contact['gsid']) ? $this->userGServer->isIgnoredByUser($this->session->getLocalUserId(), $contact['gsid']) ?
$this->t('This contact is on a server you ignored.') $this->t('This contact is on a server you ignored.')
: ''; : '';

View file

@ -31,7 +31,6 @@ use Friendica\Content\Widget\TrendingTags;
use Friendica\Core\ACL; use Friendica\Core\ACL;
use Friendica\Core\Cache\Capability\ICanCache; use Friendica\Core\Cache\Capability\ICanCache;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues; use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;

View file

@ -11,7 +11,6 @@ use Friendica\BaseModule;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Content\Pager; use Friendica\Content\Pager;
use Friendica\Content\Widget; use Friendica\Content\Widget;
use Friendica\Core\Hook;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\Search; use Friendica\Core\Search;
use Friendica\DI; use Friendica\DI;

View file

@ -126,13 +126,18 @@ class PermissionTooltip extends BaseModule
$privacy = ''; $privacy = '';
switch ($model['private'] ?? null) { switch ($model['private'] ?? null) {
case Model\Item::PUBLIC: $privacy = $this->t('Public'); break; case Model\Item::PUBLIC:
case Model\Item::UNLISTED: $privacy = $this->t('Unlisted'); break; $privacy = $this->t('Public');
case Model\Item::PRIVATE: $privacy = $this->t('Limited/Private'); break; break;
case Model\Item::UNLISTED:
$privacy = $this->t('Unlisted');
break;
case Model\Item::PRIVATE:
$privacy = $this->t('Limited/Private');
break;
} }
if ($aclReceivers->isEmpty() && $addressedReceivers->isEmpty() && empty($privacy)) if ($aclReceivers->isEmpty() && $addressedReceivers->isEmpty() && empty($privacy)) {
{
echo $this->t('Remote privacy information not available.'); echo $this->t('Remote privacy information not available.');
exit; exit;
} }

View file

@ -156,21 +156,27 @@ class Acl extends BaseModule
switch ($type) { switch ($type) {
case self::TYPE_MENTION_CONTACT_CIRCLE: case self::TYPE_MENTION_CONTACT_CIRCLE:
case self::TYPE_MENTION_CONTACT: case self::TYPE_MENTION_CONTACT:
$condition = DBA::mergeConditions($condition, $condition = DBA::mergeConditions(
$condition,
["NOT `self` AND NOT `blocked`", ["NOT `self` AND NOT `blocked`",
]); ]
);
break; break;
case self::TYPE_MENTION_GROUP: case self::TYPE_MENTION_GROUP:
$condition = DBA::mergeConditions($condition, $condition = DBA::mergeConditions(
$condition,
["NOT `self` AND NOT `blocked` AND (NOT `ap-posting-restricted` OR `ap-posting-restricted` IS NULL) AND `contact-type` = ?", Contact::TYPE_COMMUNITY ["NOT `self` AND NOT `blocked` AND (NOT `ap-posting-restricted` OR `ap-posting-restricted` IS NULL) AND `contact-type` = ?", Contact::TYPE_COMMUNITY
]); ]
);
break; break;
case self::TYPE_PRIVATE_MESSAGE: case self::TYPE_PRIVATE_MESSAGE:
$condition = DBA::mergeConditions($condition, $condition = DBA::mergeConditions(
$condition,
["NOT `self` AND NOT `blocked` AND `network` IN (?, ?, ?)", Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA ["NOT `self` AND NOT `blocked` AND `network` IN (?, ?, ?)", Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA
]); ]
);
break; break;
} }
@ -184,7 +190,8 @@ class Acl extends BaseModule
if ($type == self::TYPE_MENTION_CONTACT_CIRCLE || $type == self::TYPE_MENTION_CIRCLE) { if ($type == self::TYPE_MENTION_CONTACT_CIRCLE || $type == self::TYPE_MENTION_CIRCLE) {
/// @todo We should cache this query. /// @todo We should cache this query.
// This can be done when we can delete cache entries via wildcard // This can be done when we can delete cache entries via wildcard
$circles = $this->database->toArray($this->database->p("SELECT `circle`.`id`, `circle`.`name`, GROUP_CONCAT(DISTINCT `circle_member`.`contact-id` SEPARATOR ',') AS uids $circles = $this->database->toArray($this->database->p(
"SELECT `circle`.`id`, `circle`.`name`, GROUP_CONCAT(DISTINCT `circle_member`.`contact-id` SEPARATOR ',') AS uids
FROM `group` AS `circle` FROM `group` AS `circle`
INNER JOIN `group_member` AS `circle_member` ON `circle_member`.`gid` = `circle`.`id` INNER JOIN `group_member` AS `circle_member` ON `circle_member`.`gid` = `circle`.`id`
WHERE NOT `circle`.`deleted` AND `circle`.`uid` = ? WHERE NOT `circle`.`deleted` AND `circle`.`uid` = ?

View file

@ -278,7 +278,8 @@ class Index extends BaseSettings
'miscellaneous_section' => $this->t('Miscellaneous'), 'miscellaneous_section' => $this->t('Miscellaneous'),
'custom_fields_section' => $this->t('Custom Profile Fields'), 'custom_fields_section' => $this->t('Custom Profile Fields'),
'profile_photo' => $this->t('Upload Profile Photo'), 'profile_photo' => $this->t('Upload Profile Photo'),
'custom_fields_description' => $this->t('<p>Custom fields appear on <a href="%s">your profile page</a>.</p> 'custom_fields_description' => $this->t(
'<p>Custom fields appear on <a href="%s">your profile page</a>.</p>
<p>You can use BBCodes in the field values.</p> <p>You can use BBCodes in the field values.</p>
<p>Reorder by dragging the field title.</p> <p>Reorder by dragging the field title.</p>
<p>Empty the label field to remove a custom field.</p> <p>Empty the label field to remove a custom field.</p>