]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/threadednoticelist.php
Correct args for join event
[quix0rs-gnu-social.git] / lib / threadednoticelist.php
index cf3c0b8943ab74ec523ed55512694bdd54be2d5c..dbf3de642d8021b1c4c5a41adab9fe03239541b4 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
      *
@@ -224,7 +239,6 @@ class ThreadedNoticeListItem extends NoticeListItem
                         $item = new ThreadedNoticeListMoreItem($moreCutoff, $this->out, count($notices));
                         $item->show();
                     }
-                    NoticeList::prefill($notices, AVATAR_MINI_SIZE);
                     foreach (array_reverse($notices) as $notice) {
                         if (Event::handle('StartShowThreadedNoticeSub', array($this, $this->notice, $notice))) {
                             $item = new ThreadedNoticeListSubItem($notice, $this->notice, $this->out);
@@ -544,12 +558,14 @@ class ThreadedNoticeListRepeatsItem extends NoticeListActorsItem
 {
     function getProfiles()
     {
-        $rep = $this->notice->repeatStream();
+        $repeats = $this->notice->getRepeats();
 
         $profiles = array();
-        while ($rep->fetch()) {
+
+        foreach ($repeats as $rep) {
             $profiles[] = $rep->profile_id;
         }
+
         return $profiles;
     }