From: Michael Date: Fri, 5 May 2017 05:36:43 +0000 (+0000) Subject: Mastodon now does return a version number X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8d97bc61f577e11b920fcb70cbae62adff0a0d61;p=friendica.git Mastodon now does return a version number --- diff --git a/include/socgraph.php b/include/socgraph.php index a39eca5e86..71257c51b7 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -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) {