]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/AnonymousFave/actions/anonfavor.php
Fave::addNew now calls Notice::saveActivity
[quix0rs-gnu-social.git] / plugins / AnonymousFave / actions / anonfavor.php
index c9282f15f68df3769399b865c216f83bdd097461..4029154d7208b804409fce2b41d293848ea61bf2 100644 (file)
@@ -66,14 +66,9 @@ class AnonFavorAction extends RedirectingAction
             // TRANS: Client error.
             throw new AlreadyFulfilledException(_m('This notice is already a favorite!'));
         }
-        $fave = Fave::addNew($profile, $notice);
 
-        if (!$fave instanceof Fave) {
-            // TRANS: Server error.
-            $this->serverError(_m('Could not create favorite.'));
-        }
-
-        Fave::blowCacheForProfileId($profile->id);
+        // Throws exception
+        $stored = Fave::addNew($profile, $notice);
 
         if ($this->boolean('ajax')) {
             $this->startHTML('text/xml;charset=utf-8');