Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/diff/PhabricatorInlineCommentController.php
| Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | switch ($op) { | ||||
| case 'save': | case 'save': | ||||
| $inline = $this->loadCommentByIDForEdit($this->getCommentID()); | $inline = $this->loadCommentByIDForEdit($this->getCommentID()); | ||||
| if ($op === 'save') { | if ($op === 'save') { | ||||
| $this->updateCommentContentState($inline); | $this->updateCommentContentState($inline); | ||||
| $inline->setIsEditing(false); | $inline->setIsEditing(false); | ||||
| if (!$inline->isVoidComment($viewer)) { | if (!$inline->isVoidComment($viewer)) { | ||||
| $inline->setIsDeleted(0); | |||||
| $this->saveComment($inline); | $this->saveComment($inline); | ||||
| return $this->buildRenderedCommentResponse( | return $this->buildRenderedCommentResponse( | ||||
| $inline, | $inline, | ||||
| $this->getIsOnRight()); | $this->getIsOnRight()); | ||||
| } else { | } else { | ||||
| $inline->setIsDeleted(1); | $inline->setIsDeleted(1); | ||||
| Show All 12 Lines | switch ($op) { | ||||
| // but purging drafts means that loading a page and then closing it | // but purging drafts means that loading a page and then closing it | ||||
| // discards your drafts. | // discards your drafts. | ||||
| // To avoid the purge, only invoke "saveComment()" if we actually | // To avoid the purge, only invoke "saveComment()" if we actually | ||||
| // have changes to apply. | // have changes to apply. | ||||
| $is_dirty = false; | $is_dirty = false; | ||||
| if (!$inline->getIsEditing()) { | if (!$inline->getIsEditing()) { | ||||
| $inline->setIsEditing(true); | $inline | ||||
| ->setIsDeleted(0) | |||||
| ->setIsEditing(true); | |||||
| $is_dirty = true; | $is_dirty = true; | ||||
| } | } | ||||
| if ($this->hasContentState()) { | if ($this->hasContentState()) { | ||||
| $this->updateCommentContentState($inline); | $this->updateCommentContentState($inline); | ||||
| $is_dirty = true; | $is_dirty = true; | ||||
| } else { | } else { | ||||
| PhabricatorInlineComment::loadAndAttachVersionedDrafts( | PhabricatorInlineComment::loadAndAttachVersionedDrafts( | ||||
| ▲ Show 20 Lines • Show All 363 Lines • Show Last 20 Lines | |||||