]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
slight rearrangement of getting profile URIs
authorEvan Prodromou <evan@status.net>
Mon, 22 Feb 2010 03:52:27 +0000 (22:52 -0500)
committerEvan Prodromou <evan@status.net>
Mon, 22 Feb 2010 03:52:27 +0000 (22:52 -0500)
classes/Profile.php

index 6b396c8c340b64115b7c4377b3d148c1921eba23..5ff746e309149d0f2f4c34bb43cfb86d3ca447c5 100644 (file)
@@ -841,28 +841,22 @@ class Profile extends Memcached_DataObject
     {
         $uri = null;
 
-        // check for a local user first
-        $user = User::staticGet('id', $this->id);
+        // give plugins a chance to set the URI
+        if (Event::handle('StartGetProfileUri', array($this, &$uri))) {
 
-        if (!empty($user)) {
-            $uri = common_local_url(
-                'userbyid',
-                array('id' => $user->id)
-            );
-        } else {
-
-            // give plugins a chance to set the URI
-            if (Event::handle('StartGetProfileUri', array($this, &$uri))) {
+            // check for a local user first
+            $user = User::staticGet('id', $this->id);
 
+            if (!empty($user)) {
+                $uri = $user->uri;
+            } else {
                 // return OMB profile if any
                 $remote = Remote_profile::staticGet('id', $this->id);
-
                 if (!empty($remote)) {
                     $uri = $remote->uri;
                 }
-
-                Event::handle('EndGetProfileUri', array($this, &$uri));
             }
+            Event::handle('EndGetProfileUri', array($this, &$uri));
         }
 
         return $uri;