]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Event handler StartGetProfileAcctUri for WebFinger
authorMikael Nordfeldth <mmn@hethane.se>
Mon, 28 Oct 2013 17:26:00 +0000 (18:26 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 28 Oct 2013 17:26:00 +0000 (18:26 +0100)
plugins/WebFinger/WebFingerPlugin.php
plugins/WebFinger/lib/webfingerresource/profile.php

index 24200a6f36dbd9d486f0e3b2ecfa90f5bf0e66c2..7e3453ffb2978a77916d95ffb05a2a0d1b986e84 100644 (file)
@@ -58,6 +58,18 @@ class WebFingerPlugin extends Plugin
         return true;
     }
 
+    public function onStartGetProfileAcctUri(Profile $profile, &$acct)
+    {
+        $wfr = new WebFingerResource_Profile($profile);
+        try {
+            $acct = $wfr->reconstructAcct();
+        } catch (Exception $e) {
+            return true;
+        }
+
+        return false;
+    }
+
     public function onEndGetWebFingerResource($resource, WebFingerResource &$target=null, array $args=array())
     {
         $profile = null;
index 03dd84e0efd65c8fd04175636063297206f377b1..76987cb3efe1a587520e7ffd19610f562967c8ff 100644 (file)
@@ -31,7 +31,7 @@ class WebFingerResource_Profile extends WebFingerResource
         return array_merge($aliases, parent::getAliases());
     }
 
-    protected function reconstructAcct()
+    public function reconstructAcct()
     {
         $acct = null;