Issue 8547: Improve page load speed

This commit is contained in:
Michael
2021-03-07 20:15:25 +00:00
parent b862150409
commit 7510e854de
3 changed files with 13 additions and 5 deletions
+9 -2
View File
@@ -117,7 +117,7 @@ class ContactSelector
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function networkToName($network, $profile = '', $protocol = '')
public static function networkToName($network, $profile = '', $protocol = '', $gsid = 0)
{
$nets = [
Protocol::DFRN => DI::l10n()->t('DFRN'),
@@ -147,7 +147,14 @@ class ContactSelector
$networkname = 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'])) {
$platform = $gserver['platform'];