mirror of
https://github.com/friendica/friendica
synced 2025-04-28 02:30:16 +00:00
Don't try legacy if the server supports more
This commit is contained in:
parent
bf563a1a39
commit
050f31eeb3
2 changed files with 37 additions and 13 deletions
|
@ -1744,7 +1744,7 @@ class GServer
|
|||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
static function setProtocol(int $gsid, int $protocol)
|
||||
public static function setProtocol(int $gsid, int $protocol)
|
||||
{
|
||||
if (empty($gsid)) {
|
||||
return;
|
||||
|
@ -1796,4 +1796,25 @@ class GServer
|
|||
Logger::info('Protocol for server', ['protocol' => $protocol, 'old' => $old, 'id' => $gsid, 'url' => $gserver['url']]);
|
||||
DBA::update('gserver', ['protocol' => $protocol], ['id' => $gsid]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the protocol of the given server
|
||||
*
|
||||
* @param int $gsid Server id
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function getProtocol(int $gsid)
|
||||
{
|
||||
if (empty($gsid)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$gserver = DBA::selectFirst('gserver', ['protocol'], ['id' => $gsid]);
|
||||
if (DBA::isResult($gserver)) {
|
||||
return $gserver['protocol'];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue