X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FContactSelector.php;h=ee6fcfa062736f0f342598914ee480cba7737fe2;hb=f61fd93db02bc2d66e1473ca34dc1154e77217a3;hp=b2e607113786cea674ad21d03136b0b8bdf97961;hpb=befc2af5043a3afde251721c0d27df695db1bb7e;p=friendica.git diff --git a/src/Content/ContactSelector.php b/src/Content/ContactSelector.php index b2e6071137..ee6fcfa062 100644 --- a/src/Content/ContactSelector.php +++ b/src/Content/ContactSelector.php @@ -1,6 +1,6 @@ DI::l10n()->t('DFRN'), @@ -179,12 +182,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', @@ -218,7 +224,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; }