]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Need to supply data to NoSuchUserException
authorMikael Nordfeldth <mmn@hethane.se>
Thu, 9 Jul 2015 22:08:09 +0000 (00:08 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Thu, 9 Jul 2015 22:08:09 +0000 (00:08 +0200)
classes/User.php

index 3efaa5e72131b5ba7cda2262ba4e4879d0277b1d..9ae0cba80437bdedbc61ae1a4c3286d6190ad957 100644 (file)
@@ -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) {