]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Move blowFavesCache() to Profile
authorZach Copley <zach@status.net>
Tue, 28 Sep 2010 22:46:14 +0000 (15:46 -0700)
committerZach Copley <zach@status.net>
Tue, 28 Sep 2010 22:46:14 +0000 (15:46 -0700)
classes/Profile.php
classes/User.php

index 1a54489ed80b7d9f5a918bd0de9d71d0c0180eef..9753b278ecdf3b29de9193443f04ee8e225b35e2 100644 (file)
@@ -552,6 +552,20 @@ class Profile extends Memcached_DataObject
         return $cnt;
     }
 
+    function blowFavesCache()
+    {
+        $cache = common_memcache();
+        if ($cache) {
+            // Faves don't happen chronologically, so we need to blow
+            // ;last cache, too
+            $cache->delete(common_cache_key('fave:ids_by_user:'.$this->id));
+            $cache->delete(common_cache_key('fave:ids_by_user:'.$this->id.';last'));
+            $cache->delete(common_cache_key('fave:ids_by_user_own:'.$this->id));
+            $cache->delete(common_cache_key('fave:ids_by_user_own:'.$this->id.';last'));
+        }
+        $this->blowFaveCount();
+    }
+
     function blowSubscriberCount()
     {
         $c = common_memcache();
index 27299e62e04f2db7fd0410da82fe8e2ef16f7aa5..e784fd9e9a7278ec8c49955bcdeb5ad94588facc 100644 (file)
@@ -482,17 +482,8 @@ class User extends Memcached_DataObject
 
     function blowFavesCache()
     {
-        $cache = common_memcache();
-        if ($cache) {
-            // Faves don't happen chronologically, so we need to blow
-            // ;last cache, too
-            $cache->delete(common_cache_key('fave:ids_by_user:'.$this->id));
-            $cache->delete(common_cache_key('fave:ids_by_user:'.$this->id.';last'));
-            $cache->delete(common_cache_key('fave:ids_by_user_own:'.$this->id));
-            $cache->delete(common_cache_key('fave:ids_by_user_own:'.$this->id.';last'));
-        }
         $profile = $this->getProfile();
-        $profile->blowFaveCount();
+        $profile->blowFavesCache();
     }
 
     function getSelfTags()