X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FContactSelector.php;h=d9f475e2e7595f1fa028ece7297177fb21e319e5;hb=739b6d6533fb54b1d7e6a641242c0103d73c487e;hp=9035d37e73c01d3c838e35c30bbc662e1507acc0;hpb=322b7c856ca9ba53bd9c7da50dd5c1e3c9197d56;p=friendica.git diff --git a/src/Content/ContactSelector.php b/src/Content/ContactSelector.php index 9035d37e73..d9f475e2e7 100644 --- a/src/Content/ContactSelector.php +++ b/src/Content/ContactSelector.php @@ -1,6 +1,6 @@ DI::l10n()->t('DFRN'), @@ -137,6 +140,7 @@ 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'), ]; Hook::callAll('network_to_name', $nets); @@ -179,12 +183,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,6 +211,7 @@ class ContactSelector Protocol::STATUSNET => 'gnu-social', Protocol::ACTIVITYPUB => 'activitypub', Protocol::PNUT => 'file-text-o', /// @todo + Protocol::TUMBLR => 'tumblr', ]; $platform_icons = ['diaspora' => 'diaspora', 'friendica' => 'friendica', 'friendika' => 'friendica', @@ -218,7 +226,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; }