X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FUser_group.php;h=8f736de6d09a5728b194f37487405ee5f2905fee;hb=cb8bf360c42ca8fce44fac62316d6d71d66d912e;hp=7bfb16e27f67df7e04d2a91c43a2a820fe3c00e3;hpb=4ea396f8718648ef6b900ea2aa8a7cad9f14d721;p=quix0rs-gnu-social.git diff --git a/classes/User_group.php b/classes/User_group.php index 7bfb16e27f..8f736de6d0 100644 --- a/classes/User_group.php +++ b/classes/User_group.php @@ -14,6 +14,7 @@ class User_group extends Managed_DataObject public $__table = 'user_group'; // table name public $id; // int(4) primary_key not_null + public $profile_id; // int(4) primary_key not_null public $nickname; // varchar(64) public $fullname; // varchar(191) not 255 because utf8mb4 takes more space public $homepage; // varchar(191) not 255 because utf8mb4 takes more space @@ -104,6 +105,11 @@ class User_group extends Managed_DataObject return $this->getProfile()->getNickname(); } + public function getFullname() + { + return $this->getProfile()->getFullname(); + } + public static function defaultLogo($size) { static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile', @@ -114,18 +120,7 @@ class User_group extends Managed_DataObject function homeUrl() { - $url = null; - if (Event::handle('StartUserGroupHomeUrl', array($this, &$url))) { - // normally stored in mainpage, but older ones may be null - if (!empty($this->mainpage)) { - $url = $this->mainpage; - } elseif ($this->isLocal()) { - $url = common_local_url('showgroup', - array('nickname' => $this->nickname)); - } - } - Event::handle('EndUserGroupHomeUrl', array($this, &$url)); - return $url; + return $this->getProfile()->getUrl(); } function getUri() @@ -158,7 +153,9 @@ class User_group extends Managed_DataObject function getNotices($offset, $limit, $since_id=null, $max_id=null) { - $stream = new GroupNoticeStream($this); + // FIXME: Get the Profile::current() some other way, to avoid + // possible confusion between current session and queue process. + $stream = new GroupNoticeStream($this, Profile::current()); return $stream->getNotices($offset, $limit, $since_id, $max_id); }