From 0d01dab5a375007a46892b9f6674bc7092a2497d Mon Sep 17 00:00:00 2001
From: epriestley <git@epriestley.com>
Date: Sat, 28 Nov 2015 12:45:17 -0800
Subject: [PATCH] Partially revert D14511 to fix "INLINE COMMENTS" in mail

Summary:
Ref T9845. In Differential, this is not a remarkup block -- it's a mail section. `addTextSection()` has special magic behavior when handed a prebuilt section since D9375.

Swapping to `addRemarkupSection()` causes the error in T9845 and renders nothing in the comment section.

Even if it were a block of text, it would not be appropriate to add it as remarkup. This would incorrectly render comments in files like `__init__.py`, which are common on Python (the filename would render as "__init__.py"). Okay that's a bad example since it works fine but, uh, a file named `T123` would be no good or whatever.

I'll realign T9845 to clean this up and fix it more durably.

Test Plan: Sent myself some mail with inline comments, saw them in the mail.

Reviewers: joshuaspence, chad

Reviewed By: chad

Maniphest Tasks: T9845

Differential Revision: https://secure.phabricator.com/D14589
---
 src/applications/audit/editor/PhabricatorAuditEditor.php        | 2 +-
 .../differential/editor/DifferentialTransactionEditor.php       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/applications/audit/editor/PhabricatorAuditEditor.php b/src/applications/audit/editor/PhabricatorAuditEditor.php
index 47fa055388..51efdf175b 100644
--- a/src/applications/audit/editor/PhabricatorAuditEditor.php
+++ b/src/applications/audit/editor/PhabricatorAuditEditor.php
@@ -660,7 +660,7 @@ final class PhabricatorAuditEditor
     }
 
     if ($inlines) {
-      $body->addRemarkupSection(
+      $body->addTextSection(
         pht('INLINE COMMENTS'),
         $this->renderInlineCommentsForMail($object, $inlines));
     }
diff --git a/src/applications/differential/editor/DifferentialTransactionEditor.php b/src/applications/differential/editor/DifferentialTransactionEditor.php
index b2e946cf7f..fabd2511ba 100644
--- a/src/applications/differential/editor/DifferentialTransactionEditor.php
+++ b/src/applications/differential/editor/DifferentialTransactionEditor.php
@@ -1212,7 +1212,7 @@ final class DifferentialTransactionEditor
     }
 
     if ($inlines) {
-      $body->addRemarkupSection(
+      $body->addTextSection(
         pht('INLINE COMMENTS'),
         $this->renderInlineCommentsForMail($object, $inlines));
     }