Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/editor/ConpherenceEditor.php
Show First 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | protected function getCustomTransactionNewValue( | ||||
PhabricatorApplicationTransaction $xaction) { | PhabricatorApplicationTransaction $xaction) { | ||||
switch ($xaction->getTransactionType()) { | switch ($xaction->getTransactionType()) { | ||||
case ConpherenceTransaction::TYPE_TITLE: | case ConpherenceTransaction::TYPE_TITLE: | ||||
case ConpherenceTransaction::TYPE_TOPIC: | case ConpherenceTransaction::TYPE_TOPIC: | ||||
case ConpherenceTransaction::TYPE_PICTURE: | case ConpherenceTransaction::TYPE_PICTURE: | ||||
return $xaction->getNewValue(); | return $xaction->getNewValue(); | ||||
case ConpherenceTransaction::TYPE_PARTICIPANTS: | case ConpherenceTransaction::TYPE_PARTICIPANTS: | ||||
return $this->getPHIDTransactionNewValue($xaction); | return $xaction->getNewValue(); | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* We really only need a read lock if we have a comment. In that case, we | * We really only need a read lock if we have a comment. In that case, we | ||||
* must update the messagesCount field on the conpherence and | * must update the messagesCount field on the conpherence and | ||||
* seenMessagesCount(s) for the participant(s). | * seenMessagesCount(s) for the participant(s). | ||||
*/ | */ | ||||
Show All 35 Lines | foreach ($xactions as $xaction) { | ||||
case ConpherenceTransaction::TYPE_PARTICIPANTS: | case ConpherenceTransaction::TYPE_PARTICIPANTS: | ||||
// Since this is a new ConpherenceThread, we have to create the | // Since this is a new ConpherenceThread, we have to create the | ||||
// participation data asap to pass policy checks. For existing | // participation data asap to pass policy checks. For existing | ||||
// ConpherenceThreads, the existing participation is correct | // ConpherenceThreads, the existing participation is correct | ||||
// at this stage. Note that later in applyCustomExternalTransaction | // at this stage. Note that later in applyCustomExternalTransaction | ||||
// this participation data will be updated, particularly the | // this participation data will be updated, particularly the | ||||
// behindTransactionPHID which is just a generated dummy for now. | // behindTransactionPHID which is just a generated dummy for now. | ||||
$participants = array(); | $participants = array(); | ||||
$phids = $this->getPHIDTransactionNewValue($xaction, array()); | $phids = $xaction->getNewValue(); | ||||
foreach ($phids as $phid) { | foreach ($phids as $phid) { | ||||
if ($phid == $this->getActor()->getPHID()) { | if ($phid == $this->getActor()->getPHID()) { | ||||
$status = ConpherenceParticipationStatus::UP_TO_DATE; | $status = ConpherenceParticipationStatus::UP_TO_DATE; | ||||
$message_count = 1; | $message_count = 1; | ||||
} else { | } else { | ||||
$status = ConpherenceParticipationStatus::BEHIND; | $status = ConpherenceParticipationStatus::BEHIND; | ||||
$message_count = 0; | $message_count = 0; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 396 Lines • ▼ Show 20 Lines | switch ($type) { | ||||
last($xactions)); | last($xactions)); | ||||
$error->setIsMissingFieldError(true); | $error->setIsMissingFieldError(true); | ||||
$errors[] = $error; | $errors[] = $error; | ||||
} | } | ||||
break; | break; | ||||
case ConpherenceTransaction::TYPE_PARTICIPANTS: | case ConpherenceTransaction::TYPE_PARTICIPANTS: | ||||
foreach ($xactions as $xaction) { | foreach ($xactions as $xaction) { | ||||
$new_phids = $this->getPHIDTransactionNewValue($xaction, array()); | $new_phids = $xaction->getNewValue(); | ||||
$old_phids = nonempty($object->getParticipantPHIDs(), array()); | $old_phids = nonempty($object->getParticipantPHIDs(), array()); | ||||
$phids = array_diff($new_phids, $old_phids); | $phids = array_diff($new_phids, $old_phids); | ||||
if (!$phids) { | if (!$phids) { | ||||
continue; | continue; | ||||
} | } | ||||
$users = id(new PhabricatorPeopleQuery()) | $users = id(new PhabricatorPeopleQuery()) | ||||
Show All 21 Lines |