private function indexComment(ConpherenceThread $thread, ConpherenceTransaction $xaction) { $previous = id(new ConpherenceTransactionQuery())->setViewer($this->getViewer())->withObjectPHIDs(array($thread->getPHID()))->withTransactionTypes(array(PhabricatorTransactions::TYPE_COMMENT))->setAfterID($xaction->getID())->setLimit(1)->executeOne(); $index = id(new ConpherenceIndex())->setThreadPHID($thread->getPHID())->setTransactionPHID($xaction->getPHID())->setPreviousTransactionPHID($previous ? $previous->getPHID() : null)->setCorpus($xaction->getComment()->getContent()); queryfx($index->establishConnection('w'), 'INSERT INTO %T (threadPHID, transactionPHID, previousTransactionPHID, corpus) VALUES (%s, %s, %ns, %s) ON DUPLICATE KEY UPDATE corpus = VALUES(corpus)', $index->getTableName(), $index->getThreadPHID(), $index->getTransactionPHID(), $index->getPreviousTransactionPHID(), $index->getCorpus()); }
public function markUpToDate(ConpherenceThread $conpherence, ConpherenceTransaction $xaction) { if (!$this->isUpToDate($conpherence)) { $this->setParticipationStatus(ConpherenceParticipationStatus::UP_TO_DATE); $this->setBehindTransactionPHID($xaction->getPHID()); $this->setSeenMessageCount($conpherence->getMessageCount()); $this->save(); } return $this; }
public function markUpToDate(ConpherenceThread $conpherence, ConpherenceTransaction $xaction) { if (!$this->isUpToDate($conpherence)) { $this->setParticipationStatus(ConpherenceParticipationStatus::UP_TO_DATE); $this->setBehindTransactionPHID($xaction->getPHID()); $this->setSeenMessageCount($conpherence->getMessageCount()); $this->save(); PhabricatorUserCache::clearCache(PhabricatorUserMessageCountCacheType::KEY_COUNT, $this->getParticipantPHID()); } return $this; }