X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FProfile.php;h=e8470d96c5d209641434934ee5d5bdde15b4046f;hb=d1e609a886ad31b1478a9500b92f363014fc0d7c;hp=467a2601d9e87f703e391cf64e206e3a496296ee;hpb=31c8416a8f97a7fa7bd8e84252403d00f669a759;p=quix0rs-gnu-social.git diff --git a/classes/Profile.php b/classes/Profile.php index 467a2601d9..e8470d96c5 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -175,7 +175,6 @@ class Profile extends Managed_DataObject $avatar->mediatype = image_type_to_mime_type($imagefile->type); $avatar->filename = $filename; $avatar->original = true; - $avatar->url = Avatar::url($filename); $avatar->created = common_sql_now(); // XXX: start a transaction here @@ -822,6 +821,7 @@ class Profile extends Managed_DataObject $notices = new Notice(); $notices->profile_id = $this->id; + $notices->verb = ActivityVerb::POST; $cnt = (int) $notices->count('distinct id'); if (!empty($c)) { @@ -1422,11 +1422,25 @@ class Profile extends Managed_DataObject */ public function getUrl() { - if (empty($this->profileurl) || - !filter_var($this->profileurl, FILTER_VALIDATE_URL)) { - throw new InvalidUrlException($this->profileurl); + $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->getGroup()->isLocal() + ? common_local_url('showgroup', array('nickname' => $this->getNickname())) + : $this->profileurl; + } + Event::handle('EndUserGroupHomeUrl', array($this->getGroup(), $url)); + } elseif ($this->isLocal()) { + $url = common_local_url('showstream', array('nickname' => $this->getNickname())); + } else { + $url = $this->profileurl; + } + if (empty($url) || + !filter_var($url, FILTER_VALIDATE_URL)) { + throw new InvalidUrlException($url); } - return $this->profileurl; + return $url; } public function getNickname()