summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-12-31 09:14:55 -1000
committerEvan Prodromou <evan@status.net>2009-12-31 09:14:55 -1000
commit053b8c600d7db73ec19e5f1d3e26c4c98fdf3d8c (patch)
tree5664c78f951e91827c810b745a771aeb21ab9dbf /classes
parentad8ea98cd72855f61c71945b533331b6f30d04b6 (diff)
parent01dbee2ba5280d97ddd0bb82217e8b3e7680e67b (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'classes')
-rw-r--r--classes/Notice_inbox.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/classes/Notice_inbox.php b/classes/Notice_inbox.php
index b39006542..d3ddad656 100644
--- a/classes/Notice_inbox.php
+++ b/classes/Notice_inbox.php
@@ -106,6 +106,13 @@ class Notice_inbox extends Memcached_DataObject
return Memcached_DataObject::pkeyGet('Notice_inbox', $kv);
}
+ /**
+ * Trim inbox for a given user to latest NOTICE_INBOX_LIMIT items
+ * (up to NOTICE_INBOX_GC_MAX will be deleted).
+ *
+ * @param int $user_id
+ * @return int count of notices dropped from the inbox, if any
+ */
static function gc($user_id)
{
$entry = new Notice_inbox();
@@ -133,6 +140,8 @@ class Notice_inbox extends Memcached_DataObject
$notices = array();
}
}
+
+ return $total;
}
static function deleteMatching($user_id, $notices)