X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fnoticelist.php;h=7f38cf005b29469dddca30197946a0cc78da5b4d;hb=cbd13407d87df9c6bfd48ff6f087094c067f4f27;hp=148f428edf0955420c58a7510b70c31ce1bf3def;hpb=ba6235a446d5cb848e6d9555c5f5d899e4314a83;p=quix0rs-gnu-social.git diff --git a/lib/noticelist.php b/lib/noticelist.php index 148f428edf..7f38cf005b 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -124,25 +124,34 @@ class NoticeList extends Widget static function prefill(&$notices, $avatarSize=AVATAR_STREAM_SIZE) { - // Prefill attachments - Notice::fillAttachments($notices); - // Prefill attachments - Notice::fillFaves($notices); - // Prefill the profiles - $profiles = Notice::fillProfiles($notices); - // Prefill the avatars - Profile::fillAvatars($profiles, $avatarSize); + if (Event::handle('StartNoticeListPrefill', array(&$notices, $avatarSize))) { + + // Prefill attachments + Notice::fillAttachments($notices); + // Prefill attachments + Notice::fillFaves($notices); + // Prefill repeat data + Notice::fillRepeats($notices); + // Prefill the profiles + $profiles = Notice::fillProfiles($notices); + // Prefill the avatars + Profile::fillAvatars($profiles, $avatarSize); - $p = Profile::current(); + $p = Profile::current(); - $ids = array(); + if (!empty($p)) { + + $ids = array(); - foreach ($notices as $notice) { - $ids[] = $notice->id; - } + foreach ($notices as $notice) { + $ids[] = $notice->id; + } - if (!empty($p)) { - Memcached_DataObject::pivotGet('Fave', 'notice_id', $ids, array('user_id' => $p->id)); - } + Memcached_DataObject::pivotGet('Fave', 'notice_id', $ids, array('user_id' => $p->id)); + Memcached_DataObject::pivotGet('Notice', 'repeat_of', $ids, array('profile_id' => $p->id)); + } + + Event::handle('EndNoticeListPrefill', array(&$notices, &$profiles, $avatarSize)); + } } }