Mastodon now does return a version number

This commit is contained in:
Michael 2017-05-05 05:36:43 +00:00
parent 0c64178de7
commit 8d97bc61f5
1 changed files with 14 additions and 0 deletions

View File

@ -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) {