Ejemplo n.º 1
0
 function getNotices($offset, $limit, $sinceId = null, $maxId = null)
 {
     $all = Memcached_DataObject::listGet('Notice', 'conversation', array($this->id));
     $notices = $all[$this->id];
     // Re-order in reverse-chron
     usort($notices, array('RawConversationNoticeStream', '_reverseChron'));
     // FIXME: handle since and max
     $wanted = array_slice($notices, $offset, $limit);
     return new ArrayWrapper($wanted);
 }
Ejemplo n.º 2
0
 static function fillRepeats(&$notices)
 {
     $ids = self::_idsOf($notices);
     $repeatMap = Memcached_DataObject::listGet('Notice', 'repeat_of', $ids);
     foreach ($notices as $notice) {
         $repeats = $repeatMap[$notice->id];
         $notice->_setRepeats($repeats);
     }
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 function getMessagesFrom()
 {
     $msgMap = Memcached_DataObject::listGet('Message', 'from_profile', array($this->user->id));
     $messages = $msgMap[$this->user->id];
     if (!empty($this->after)) {
         $messages = array_filter($messages, array($this, 'createdAfter'));
     }
     return $messages;
 }