From 8d97bc61f577e11b920fcb70cbae62adff0a0d61 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 5 May 2017 05:36:43 +0000 Subject: [PATCH] Mastodon now does return a version number --- include/socgraph.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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) {