From 8cc85f684b7615009f4e29963a2d32b08293dee2 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Fri, 10 Jul 2015 00:08:09 +0200 Subject: [PATCH] Need to supply data to NoSuchUserException --- classes/User.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/classes/User.php b/classes/User.php index 3efaa5e721..9ae0cba804 100644 --- a/classes/User.php +++ b/classes/User.php @@ -142,6 +142,16 @@ class User extends Managed_DataObject return $this->getProfile()->getNickname(); } + public function getByNickname($nickname) + { + $user = User::getKV('nickname', $nickname); + if (!$user instanceof User) { + throw new NoSuchUserException(array('nickname' => $nickname)); + } + + return $user; + } + function isSubscribed(Profile $other) { return $this->getProfile()->isSubscribed($other); @@ -439,7 +449,7 @@ class User extends Managed_DataObject function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0) { - return Reply::stream($this->id, $offset, $limit, $since_id, $before_id); + return $this->getProfile()->getReplies($offset, $limit, $since_id, $before_id); } function getTaggedNotices($tag, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0) { -- 2.39.5