diff --git a/src/applications/differential/controller/DifferentialInlineCommentEditController.php b/src/applications/differential/controller/DifferentialInlineCommentEditController.php --- a/src/applications/differential/controller/DifferentialInlineCommentEditController.php +++ b/src/applications/differential/controller/DifferentialInlineCommentEditController.php @@ -131,11 +131,26 @@ protected function deleteComment(PhabricatorInlineCommentInterface $inline) { $inline->openTransaction(); + + $inline->setIsDeleted(1)->save(); DifferentialDraft::deleteHasDraft( $inline->getAuthorPHID(), $inline->getRevisionPHID(), $inline->getPHID()); - $inline->delete(); + + $inline->saveTransaction(); + } + + protected function undeleteComment( + PhabricatorInlineCommentInterface $inline) { + $inline->openTransaction(); + + $inline->setIsDeleted(0)->save(); + DifferentialDraft::markHasDraft( + $inline->getAuthorPHID(), + $inline->getRevisionPHID(), + $inline->getPHID()); + $inline->saveTransaction(); } diff --git a/src/applications/diffusion/controller/DiffusionInlineCommentController.php b/src/applications/diffusion/controller/DiffusionInlineCommentController.php --- a/src/applications/diffusion/controller/DiffusionInlineCommentController.php +++ b/src/applications/diffusion/controller/DiffusionInlineCommentController.php @@ -108,7 +108,12 @@ } protected function deleteComment(PhabricatorInlineCommentInterface $inline) { - return $inline->delete(); + $inline->setIsDeleted(1)->save(); + } + + protected function undeleteComment( + PhabricatorInlineCommentInterface $inline) { + $inline->setIsDeleted(0)->save(); } protected function saveComment(PhabricatorInlineCommentInterface $inline) { diff --git a/src/infrastructure/diff/PhabricatorInlineCommentController.php b/src/infrastructure/diff/PhabricatorInlineCommentController.php --- a/src/infrastructure/diff/PhabricatorInlineCommentController.php +++ b/src/infrastructure/diff/PhabricatorInlineCommentController.php @@ -12,6 +12,8 @@ PhabricatorInlineCommentInterface $inline); abstract protected function deleteComment( PhabricatorInlineCommentInterface $inline); + abstract protected function undeleteComment( + PhabricatorInlineCommentInterface $inline); abstract protected function saveComment( PhabricatorInlineCommentInterface $inline); @@ -167,7 +169,12 @@ $is_delete = ($op == 'delete' || $op == 'refdelete'); $inline = $this->loadCommentForEdit($this->getCommentID()); - $inline->setIsDeleted((int)$is_delete)->save(); + + if ($is_delete) { + $this->deleteComment($inline); + } else { + $this->undeleteComment($inline); + } return $this->buildEmptyResponse(); case 'edit':