]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
pre-fill all notices in conversations on the page
authorEvan Prodromou <evan@status.net>
Mon, 8 Aug 2011 14:39:45 +0000 (10:39 -0400)
committerEvan Prodromou <evan@status.net>
Mon, 8 Aug 2011 14:39:45 +0000 (10:39 -0400)
lib/threadednoticelist.php

index cf3c0b8943ab74ec523ed55512694bdd54be2d5c..6df4ed99df92dc94da5dcaa2c581a990e29f62dc 100644 (file)
@@ -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
      *