]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/ActivityPub.php
New functions to check if a contact supports that protocol
[friendica.git] / src / Protocol / ActivityPub.php
index 6c7bbb4745c488f87bec60b9b421dacf6043f9c8..14fca625a8e458ace6b4b8c18085b4c51aac69cf 100644 (file)
@@ -194,4 +194,18 @@ class ActivityPub
                        ActivityPub\Receiver::processActivity($ldactivity, '', $uid, true);
                }
        }
+
+       /**
+        * Checks if the given contact url does support ActivityPub
+        *
+        * @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 = null)
+       {
+               return !empty(APContact::getByURL($url, $update));
+       }
 }