X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FUser.php;h=27299e62e04f2db7fd0410da82fe8e2ef16f7aa5;hb=c19e592fa80f616a18718c4650ea0ffc9661f7ce;hp=b85192b29cce97b9475bd8517da597809b707f72;hpb=0f1fc36a05c8d858827718255bef20e8d0c0d3f6;p=quix0rs-gnu-social.git diff --git a/classes/User.php b/classes/User.php index b85192b29c..27299e62e0 100644 --- a/classes/User.php +++ b/classes/User.php @@ -412,37 +412,8 @@ class User extends Memcached_DataObject function hasFave($notice) { - $cache = common_memcache(); - - // XXX: Kind of a hack. - - if ($cache) { - // This is the stream of favorite notices, in rev chron - // order. This forces it into cache. - - $ids = Fave::stream($this->id, 0, NOTICE_CACHE_WINDOW); - - // If it's in the list, then it's a fave - - if (in_array($notice->id, $ids)) { - return true; - } - - // If we're not past the end of the cache window, - // then the cache has all available faves, so this one - // is not a fave. - - if (count($ids) < NOTICE_CACHE_WINDOW) { - return false; - } - - // Otherwise, cache doesn't have all faves; - // fall through to the default - } - - $fave = Fave::pkeyGet(array('user_id' => $this->id, - 'notice_id' => $notice->id)); - return ((is_null($fave)) ? false : true); + $profile = $this->getProfile(); + return $profile->hasFave($notice); } function mutuallySubscribed($other)