Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/storage/ConpherenceParticipant.php
| Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | final class ConpherenceParticipant extends ConpherenceDAO { | ||||
| public function markUpToDate( | public function markUpToDate( | ||||
| ConpherenceThread $conpherence, | ConpherenceThread $conpherence, | ||||
| ConpherenceTransaction $xaction) { | ConpherenceTransaction $xaction) { | ||||
| if (!$this->isUpToDate($conpherence)) { | if (!$this->isUpToDate($conpherence)) { | ||||
| $this->setParticipationStatus(ConpherenceParticipationStatus::UP_TO_DATE); | $this->setParticipationStatus(ConpherenceParticipationStatus::UP_TO_DATE); | ||||
| $this->setBehindTransactionPHID($xaction->getPHID()); | $this->setBehindTransactionPHID($xaction->getPHID()); | ||||
| $this->setSeenMessageCount($conpherence->getMessageCount()); | $this->setSeenMessageCount($conpherence->getMessageCount()); | ||||
| $this->save(); | $this->save(); | ||||
| PhabricatorUserCache::clearCache( | |||||
| PhabricatorUserMessageCountCacheType::KEY_COUNT, | |||||
| $this->getParticipantPHID()); | |||||
| } | } | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| private function isUpToDate(ConpherenceThread $conpherence) { | public function isUpToDate(ConpherenceThread $conpherence) { | ||||
| return | return | ||||
| ($this->getSeenMessageCount() == $conpherence->getMessageCount()) | ($this->getSeenMessageCount() == $conpherence->getMessageCount()) | ||||
| && | && | ||||
| ($this->getParticipationStatus() == | ($this->getParticipationStatus() == | ||||
| ConpherenceParticipationStatus::UP_TO_DATE); | ConpherenceParticipationStatus::UP_TO_DATE); | ||||
| } | } | ||||
| } | } | ||||