Merge pull request #3429 from annando/1705-mastodon-version
Mastodon now does return a version number
This commit is contained in:
commit
17632118d6
|
@ -1136,6 +1136,20 @@ function poco_check_server($server_url, $network = "", $force = false) {
|
|||
$network = NETWORK_OSTATUS;
|
||||
$last_contact = datetime_convert();
|
||||
}
|
||||
|
||||
// Test for Mastodon
|
||||
$serverret = z_fetch_url($server_url."/api/v1/instance");
|
||||
if ($serverret["success"] AND ($serverret["body"] != '')) {
|
||||
$data = json_decode($serverret["body"]);
|
||||
if (isset($data->version)) {
|
||||
$platform = "Mastodon";
|
||||
$version = $data->version;
|
||||
$site_name = $data->title;
|
||||
$info = $data->description;
|
||||
$network = NETWORK_OSTATUS;
|
||||
$last_contact = datetime_convert();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$failure) {
|
||||
|
|
Loading…
Reference in a new issue