diff --git a/resources/sql/autopatches/20170419.thread.01.behind.sql b/resources/sql/autopatches/20170419.thread.01.behind.sql new file mode 100644 --- /dev/null +++ b/resources/sql/autopatches/20170419.thread.01.behind.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_conpherence.conpherence_participant + DROP behindTransactionPHID; diff --git a/src/applications/conpherence/editor/ConpherenceEditor.php b/src/applications/conpherence/editor/ConpherenceEditor.php --- a/src/applications/conpherence/editor/ConpherenceEditor.php +++ b/src/applications/conpherence/editor/ConpherenceEditor.php @@ -168,8 +168,7 @@ // participation data asap to pass policy checks. For existing // ConpherenceThreads, the existing participation is correct // at this stage. Note that later in applyCustomExternalTransaction - // this participation data will be updated, particularly the - // behindTransactionPHID which is just a generated dummy for now. + // this participation data will be updated. $participants = array(); $phids = $this->getPHIDTransactionNewValue($xaction, array()); foreach ($phids as $phid) { @@ -186,7 +185,6 @@ ->setParticipantPHID($phid) ->setParticipationStatus($status) ->setDateTouched(time()) - ->setBehindTransactionPHID($xaction->generatePHID()) ->setSeenMessageCount($message_count) ->save(); $object->attachParticipants($participants); @@ -257,7 +255,6 @@ ->setParticipantPHID($phid) ->setParticipationStatus($status) ->setDateTouched(time()) - ->setBehindTransactionPHID($xaction->getPHID()) ->setSeenMessageCount($message_count) ->save(); } @@ -290,7 +287,6 @@ foreach ($participants as $phid => $participant) { if ($phid != $user->getPHID()) { if ($participant->getParticipationStatus() != $behind) { - $participant->setBehindTransactionPHID($xaction_phid); $participant->setSeenMessageCount( $object->getMessageCount() - $message_count); } @@ -298,7 +294,6 @@ $participant->setDateTouched($time); } else { $participant->setSeenMessageCount($object->getMessageCount()); - $participant->setBehindTransactionPHID($xaction_phid); $participant->setParticipationStatus($up_to_date); $participant->setDateTouched($time); } diff --git a/src/applications/conpherence/storage/ConpherenceParticipant.php b/src/applications/conpherence/storage/ConpherenceParticipant.php --- a/src/applications/conpherence/storage/ConpherenceParticipant.php +++ b/src/applications/conpherence/storage/ConpherenceParticipant.php @@ -5,7 +5,6 @@ protected $participantPHID; protected $conpherencePHID; protected $participationStatus; - protected $behindTransactionPHID; protected $seenMessageCount; protected $dateTouched; protected $settings = array(); @@ -44,7 +43,6 @@ ConpherenceTransaction $xaction) { if (!$this->isUpToDate($conpherence)) { $this->setParticipationStatus(ConpherenceParticipationStatus::UP_TO_DATE); - $this->setBehindTransactionPHID($xaction->getPHID()); $this->setSeenMessageCount($conpherence->getMessageCount()); $this->save();