/** * @see \wcf\page\IPage::readData() */ public function readData() { parent::readData(); // add breadcrumbs WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.conversation.conversations'), LinkHandler::getInstance()->getLink('ConversationList'))); if ($this->conversation->isDraft) { WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.conversation.folder.draft'), LinkHandler::getInstance()->getLink('ConversationList', array('filter' => 'draft')))); } // update last visit time count if ($this->conversation->isNew() && $this->objectList->getMaxPostTime() > $this->conversation->lastVisitTime) { $visitTime = $this->objectList->getMaxPostTime(); if ($visitTime == $this->conversation->lastPostTime) { $visitTime = TIME_NOW; } $conversationAction = new ConversationAction(array($this->conversation->getDecoratedObject()), 'markAsRead', array('visitTime' => $visitTime)); $conversationAction->executeAction(); } // get participants $this->participantList = new ConversationParticipantList($this->conversationID, WCF::getUser()->userID, $this->conversation->userID == WCF::getUser()->userID); $this->participantList->readObjects(); // init quote objects $messageIDs = array(); foreach ($this->objectList as $message) { $messageIDs[] = $message->messageID; } MessageQuoteManager::getInstance()->initObjects('com.woltlab.wcf.conversation.message', $messageIDs); // set attachment permissions if ($this->objectList->getAttachmentList() !== null) { $this->objectList->getAttachmentList()->setPermissions(array('canDownload' => true, 'canViewPreview' => true)); } // get timeframe for modifications $this->objectList->rewind(); $startTime = $this->objectList->current()->time; $count = count($this->objectList); if ($count == 1) { $endTime = $startTime; } else { $this->objectList->seek($count - 1); $endTime = $this->objectList->current()->time; } $this->objectList->rewind(); // load modification log entries $this->modificationLogList = new ConversationLogModificationLogList(); $this->modificationLogList->setConversation($this->conversation->getDecoratedObject()); $this->modificationLogList->getConditionBuilder()->add("modification_log.time BETWEEN ? AND ?", array($startTime, $endTime)); $this->modificationLogList->readObjects(); }