]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apifavoritecreate.php
Merge branch 'master' of gitorious.org:statusnet/mainline
[quix0rs-gnu-social.git] / actions / apifavoritecreate.php
index a80a6492e9414fc7c220572bcbfd2dfc67f35e69..0447a92ba2613f04f60acc997dcfcc19b21e10ec 100644 (file)
@@ -25,6 +25,7 @@
  * @author    Evan Prodromou <evan@status.net>
  * @author    Zach Copley <zach@status.net>
  * @copyright 2009 StatusNet, Inc.
+ * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link      http://status.net/
  */
@@ -96,7 +97,7 @@ class ApiFavoriteCreateAction extends ApiAuthAction
 
         if (!in_array($this->format, array('xml', 'json'))) {
             $this->clientError(
-                _('API method not found!'),
+                _('API method not found.'),
                 404,
                 $this->format
             );
@@ -116,18 +117,18 @@ class ApiFavoriteCreateAction extends ApiAuthAction
 
         if ($this->user->hasFave($this->notice)) {
             $this->clientError(
-                _('This status is already a favorite!'),
+                _('This status is already a favorite.'),
                 403,
                 $this->format
             );
             return;
         }
 
-        $fave = Fave::addNew($this->user, $this->notice);
+        $fave = Fave::addNew($this->user->getProfile(), $this->notice);
 
         if (empty($fave)) {
             $this->clientError(
-                _('Could not create favorite.')
+                _('Could not create favorite.'),
                 403,
                 $this->format
             );