]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Profile.php
Fixed group representation in Directory plugin, also some ->raw calls
[quix0rs-gnu-social.git] / classes / Profile.php
index 554215a973f48b7adf320e7e1eb9dbd18fde1d55..8e12dfc6ee5cbad32427996db1e0dc37fc6186d6 100644 (file)
@@ -1422,6 +1422,18 @@ class Profile extends Managed_DataObject
      */
     public function getUrl()
     {
+        $url = null;
+        if ($this->isGroup()) {
+            // FIXME: Get rid of this event, it fills no real purpose, data should be in Profile->profileurl (replaces User_group->mainpage)
+            if (Event::handle('StartUserGroupHomeUrl', array($this->getGroup(), &$url))) {
+                $url = $this->isLocal()
+                        ? common_local_url('showgroup', array('nickname' => $this->getNickname()))
+                        : $this->profileurl;
+            }
+            Event::handle('EndUserGroupHomeUrl', array($this->getGroup(), $url));
+        } else {
+            $url = $this->profileurl;
+        }
         if (empty($this->profileurl) ||
                 !filter_var($this->profileurl, FILTER_VALIDATE_URL)) {
             throw new InvalidUrlException($this->profileurl);