Make server components of inline comment content handling state-oriented

Summary: Ref T13513. Introduce a formal server-side content state object so the whole state can be saved and restored to the drafts table, read from the request, etc.

Test Plan: Created and edited inlines. Reloaded drafts with edits. Submitted normal and editing comments. Grepped for affected symbols.

Maniphest Tasks: T13513

Differential Revision: https://secure.phabricator.com/D21275
This commit is contained in:
epriestley
2020-05-19 14:50:32 -07:00
parent 4b2a447003
commit 00430fdbe1
10 changed files with 207 additions and 70 deletions

View File

@@ -218,9 +218,9 @@ abstract class PhabricatorDiffInlineCommentQuery
// as it is currently shown to the user, not as it was stored the last
// time they clicked "Save".
$draft_content = $inline->getContentForEdit($viewer);
if (strlen($draft_content)) {
$inline->setContent($draft_content);
$draft_state = $inline->getContentStateForEdit($viewer);
if (!$draft_state->isEmptyContentState()) {
$inline->setContentState($draft_state);
}
}
}