Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15408275
D19968.id47663.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D19968.id47663.diff
View Options
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
@@ -3262,7 +3262,7 @@
}
if (!$is_comment || !$seen_comment) {
- $header = $xaction->getTitleForMail();
+ $header = $xaction->getTitleForTextMail();
if ($header !== null) {
$headers[] = $header;
}
@@ -3347,7 +3347,7 @@
// If this is not the first comment in the mail, add the header showing
// who wrote the comment immediately above the comment.
if (!$is_initial) {
- $header = $xaction->getTitleForMail();
+ $header = $xaction->getTitleForTextMail();
if ($header !== null) {
$body->addRawPlaintextSection($header);
}
diff --git a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
--- a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
+++ b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
@@ -763,12 +763,29 @@
return $this->shouldHideForFeed();
}
+ private function getTitleForMailWithRenderingTarget($new_target) {
+ $old_target = $this->getRenderingTarget();
+ try {
+ $this->setRenderingTarget($new_target);
+ $result = $this->getTitleForMail();
+ } catch (Exception $ex) {
+ $this->setRenderingTarget($old_target);
+ throw $ex;
+ }
+ $this->setRenderingTarget($old_target);
+ return $result;
+ }
+
public function getTitleForMail() {
- return id(clone $this)->setRenderingTarget('text')->getTitle();
+ return $this->getTitle();
+ }
+
+ public function getTitleForTextMail() {
+ return $this->getTitleForMailWithRenderingTarget(self::TARGET_TEXT);
}
public function getTitleForHTMLMail() {
- $title = $this->getTitleForMail();
+ $title = $this->getTitleForMailWithRenderingTarget(self::TARGET_HTML);
if ($title === null) {
return null;
}
diff --git a/src/applications/transactions/storage/PhabricatorModularTransaction.php b/src/applications/transactions/storage/PhabricatorModularTransaction.php
--- a/src/applications/transactions/storage/PhabricatorModularTransaction.php
+++ b/src/applications/transactions/storage/PhabricatorModularTransaction.php
@@ -151,12 +151,7 @@
}
public function getTitleForMail() {
- $old_target = $this->getRenderingTarget();
- $new_target = self::TARGET_TEXT;
- $this->setRenderingTarget($new_target);
- $title = $this->getTitle();
- $this->setRenderingTarget($old_target);
- return $title;
+ return $this->getTitle();
}
/* final */ public function getTitleForFeed() {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 19, 10:07 PM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7712085
Default Alt Text
D19968.id47663.diff (2 KB)
Attached To
Mode
D19968: Fix an issue where transactions in mail were always rendered as text
Attached
Detach File
Event Timeline
Log In to Comment