Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / conpherence / storage / ConpherenceParticipant.php
blob1edf7940e90daf0198125ceece1119fe15df46ed
1 <?php
3 final class ConpherenceParticipant extends ConpherenceDAO {
5 protected $participantPHID;
6 protected $conpherencePHID;
7 protected $seenMessageCount;
8 protected $settings = array();
10 protected function getConfiguration() {
11 return array(
12 self::CONFIG_SERIALIZATION => array(
13 'settings' => self::SERIALIZATION_JSON,
15 self::CONFIG_COLUMN_SCHEMA => array(
16 'seenMessageCount' => 'uint64',
18 self::CONFIG_KEY_SCHEMA => array(
19 'conpherencePHID' => array(
20 'columns' => array('conpherencePHID', 'participantPHID'),
21 'unique' => true,
23 'key_thread' => array(
24 'columns' => array('participantPHID', 'conpherencePHID'),
27 ) + parent::getConfiguration();
30 public function getSettings() {
31 return nonempty($this->settings, array());
34 public function markUpToDate(ConpherenceThread $conpherence) {
36 if (!$this->isUpToDate($conpherence)) {
37 $this->setSeenMessageCount($conpherence->getMessageCount());
38 $this->save();
40 PhabricatorUserCache::clearCache(
41 PhabricatorUserMessageCountCacheType::KEY_COUNT,
42 $this->getParticipantPHID());
45 return $this;
48 public function isUpToDate(ConpherenceThread $conpherence) {
49 return ($this->getSeenMessageCount() == $conpherence->getMessageCount());