summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/User.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/classes/User.php b/classes/User.php
index 1168406ef..fcae38c09 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -149,6 +149,16 @@ class User extends DB_DataObject
}
function noticesWithFriends($offset=0, $limit=20) {
+
+ # We clearly need a more elegant way to make this work.
+
+ if (common_config('memcached', 'enabled')) {
+ if ($offset + $limit <= WITHFRIENDS_CACHE_WINDOW) {
+ $cached = $this->noticesWithFriendsWindow();
+ $wrapper = new NoticeWrapper(array_slice($cached, $offset, $limit));
+ return $wrapper;
+ }
+ }
$notice = new Notice();