X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FContactSelector.php;h=56d6961be54fe9c921ab86474c15042f1442966b;hb=5cf71baf551bf209e62cf13b16173bddcd76a0fc;hp=b2e607113786cea674ad21d03136b0b8bdf97961;hpb=53e38b03130ea798bba44db44ccb7f331dc4b91d;p=friendica.git diff --git a/src/Content/ContactSelector.php b/src/Content/ContactSelector.php index b2e6071137..56d6961be5 100644 --- a/src/Content/ContactSelector.php +++ b/src/Content/ContactSelector.php @@ -1,6 +1,6 @@ DI::l10n()->t('DFRN'), @@ -137,6 +140,8 @@ class ContactSelector Protocol::STATUSNET => DI::l10n()->t('GNU Social Connector'), Protocol::ACTIVITYPUB => DI::l10n()->t('ActivityPub'), Protocol::PNUT => DI::l10n()->t('pnut'), + Protocol::TUMBLR => DI::l10n()->t('Tumblr'), + Protocol::BLUESKY => DI::l10n()->t('Bluesky'), ]; Hook::callAll('network_to_name', $nets); @@ -179,12 +184,15 @@ class ContactSelector } /** + * Determines network's icon name + * * @param string $network network * @param string $profile optional, default empty - * @return string + * @param int $gsid Server id + * @return string Name for network icon * @throws \Exception */ - public static function networkToIcon($network, $profile = "") + public static function networkToIcon(string $network, string $profile = "", int $gsid = null): string { $nets = [ Protocol::DFRN => 'friendica', @@ -204,13 +212,17 @@ class ContactSelector Protocol::STATUSNET => 'gnu-social', Protocol::ACTIVITYPUB => 'activitypub', Protocol::PNUT => 'file-text-o', /// @todo + Protocol::TUMBLR => 'tumblr', + Protocol::BLUESKY => 'circle', /// @todo ]; $platform_icons = ['diaspora' => 'diaspora', 'friendica' => 'friendica', 'friendika' => 'friendica', 'GNU Social' => 'gnu-social', 'gnusocial' => 'gnu-social', 'hubzilla' => 'hubzilla', 'mastodon' => 'mastodon', 'peertube' => 'peertube', 'pixelfed' => 'pixelfed', 'pleroma' => 'pleroma', 'red' => 'hubzilla', 'redmatrix' => 'hubzilla', - 'socialhome' => 'social-home', 'wordpress' => 'wordpress']; + 'socialhome' => 'social-home', 'wordpress' => 'wordpress', 'lemmy' => 'users', + 'plume' => 'plume', 'funkwhale' => 'funkwhale', 'nextcloud' => 'nextcloud', 'drupal' => 'drupal', + 'firefish' => 'fire', 'calckey' => 'calculator', 'kbin' => 'check']; $search = array_keys($nets); $replace = array_values($nets); @@ -218,7 +230,14 @@ class ContactSelector $network_icon = str_replace($search, $replace, $network); if ((in_array($network, Protocol::FEDERATED)) && ($profile != "")) { - $gserver = self::getServerForProfile($profile); + if (!empty($gsid) && !empty(self::$serverdata[$gsid])) { + $gserver = self::$serverdata[$gsid]; + } elseif (!empty($gsid)) { + $gserver = DBA::selectFirst('gserver', ['platform', 'network'], ['id' => $gsid]); + self::$serverdata[$gsid] = $gserver; + } else { + $gserver = self::getServerForProfile($profile); + } if (!empty($gserver['platform'])) { $network_icon = $platform_icons[strtolower($gserver['platform'])] ?? $network_icon; }