]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/OStatus.php
Merge pull request #7634 from tobiasd/20190916-de
[friendica.git] / src / Protocol / OStatus.php
index b3685a147522e586e0e01df7218ff60452d55319..054eaf51b2812939153424fa80058c9485ee18d9 100644 (file)
@@ -2302,4 +2302,19 @@ class OStatus
 
                return trim($doc->saveXML());
        }
+
+       /**
+        * Checks if the given contact url does support OStatus
+        *
+        * @param string  $url    profile url
+        * @param boolean $update Update the profile
+        * @return boolean
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+        * @throws \ImagickException
+        */
+       public static function isSupportedByContactUrl($url, $update = false)
+       {
+               $probe = Probe::uri($url, Protocol::OSTATUS, 0, !$update);
+               return $probe['network'] == Protocol::OSTATUS;
+       }
 }