X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FNotice_inbox.php;h=e350e6e2f8469b0281f5edff0656cfc741f61db8;hb=b0aea3f9c1cf9a6402bcb2751ac767445103a70b;hp=b39006542c2a65943e2ae370d591a99e3d3314d0;hpb=e9b733e7f036bc03353ae6dd7b096ea179698a4d;p=quix0rs-gnu-social.git diff --git a/classes/Notice_inbox.php b/classes/Notice_inbox.php index b39006542c..e350e6e2f8 100644 --- a/classes/Notice_inbox.php +++ b/classes/Notice_inbox.php @@ -101,11 +101,18 @@ class Notice_inbox extends Memcached_DataObject return $ids; } - function &pkeyGet($kv) + function pkeyGet($kv) { 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)