Commit 0c762dde authored by Evan Prodromou's avatar Evan Prodromou

pre-fill all notices in conversations on the page

parent ed31052d
......@@ -80,7 +80,7 @@ class ThreadedNoticeList extends NoticeList
$total = count($notices);
$notices = array_slice($notices, 0, NOTICES_PER_PAGE);
self::prefill($notices);
self::prefill(self::_allNotices($notices));
$conversations = array();
......@@ -123,6 +123,21 @@ class ThreadedNoticeList extends NoticeList
return $total;
}
function _allNotices($notices)
{
$convId = array();
foreach ($notices as $notice) {
$convId[] = $notice->conversation;
}
$convId = array_unique($convId);
$allMap = Memcached_DataObject::listGet('Notice', 'conversation', $convId);
$allArray = array();
foreach ($allMap as $convId => $convNotices) {
$allArray = array_merge($allArray, $convNotices);
}
return $allArray;
}
/**
* returns a new list item for the current notice
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment