]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Delete Faves onProfileDeleteRelated instead of User
authorMikael Nordfeldth <mmn@hethane.se>
Mon, 9 Mar 2015 14:01:05 +0000 (15:01 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 9 Mar 2015 14:01:05 +0000 (15:01 +0100)
plugins/Favorite/FavoritePlugin.php

index 49ba2b684515b425a93c791b49cb026f07ed47b1..e4e842d8ccfa1688d52942db2f588bfc6a117054 100644 (file)
@@ -284,13 +284,14 @@ class FavoritePlugin extends ActivityHandlerPlugin
         $fave->free();
     }
 
-    public function onUserDeleteRelated(User $user, array &$related)
+    public function onProfileDeleteRelated(Profile $profile, array &$related)
     {
         $fave = new Fave();
-        $fave->user_id = $user->id;
+        $fave->user_id = $profile->id;
         $fave->delete();    // Will perform a DELETE matching "user_id = {$user->id}"
+        $fave->free();
 
-        Fave::blowCacheForProfileId($user->id);
+        Fave::blowCacheForProfileId($profile->id);
         return true;
     }