]> git.mxchange.org Git - friendica.git/blobdiff - include/socgraph.php
Bugfix: Reimported Friendica posts from pump.io had the links missing.
[friendica.git] / include / socgraph.php
index 421a68cc9ef9212aad785505f179c2814cec5dab..765ed5d8912b5fb30d513d6430a07a47bed86fd6 100644 (file)
@@ -391,6 +391,15 @@ function poco_detect_server($profile) {
                }
        }
 
+       // Mastodon
+       if ($server_url == "") {
+               $red = preg_replace("=(https?://)(.*)/users/(.*)=ism", "$1$2", $profile);
+               if ($red != $profile) {
+                       $server_url = $red;
+                       $network = NETWORK_OSTATUS;
+               }
+       }
+
        return $server_url;
 }
 
@@ -755,6 +764,13 @@ function poco_check_server($server_url, $network = "", $force = false) {
                                                $versionparts = explode("-", $version);
                                                $version = $versionparts[0];
                                        }
+
+                                       if(stristr($line,'Server: Mastodon')) {
+                                               $platform = "Mastodon";
+                                               $network = NETWORK_OSTATUS;
+                                               // Mastodon doesn't reveal version numbers
+                                               $version = "";
+                                       }
                                }
                }
        }