mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Fix two edge case issues with Differential mail tags
Summary: Via Asana. The tags on Differential mail are wrong in two cases: - Transactions which submit inline comments but no comment text are not labeled as "comments", but should be. - Non-close, non-comment transactions are not labeled at all, but should be labeled "other". Test Plan: Submitted a no-comments, inlines-only transaction and got a message with proper `X-Phabricator-Mail-Tags` header. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D7912
This commit is contained in:
parent
b960c8114b
commit
68de639470
1 changed files with 8 additions and 1 deletions
|
@ -56,7 +56,10 @@ final class DifferentialCommentMail extends DifferentialMail {
|
|||
break;
|
||||
}
|
||||
|
||||
if (strlen(trim($comment->getContent()))) {
|
||||
$has_comment = strlen(trim($comment->getContent()));
|
||||
$has_inlines = (bool)$this->getInlineComments();
|
||||
|
||||
if ($has_comment || $has_inlines) {
|
||||
switch ($action) {
|
||||
case DifferentialAction::ACTION_CLOSE:
|
||||
// Commit comments are auto-generated and not especially interesting,
|
||||
|
@ -68,6 +71,10 @@ final class DifferentialCommentMail extends DifferentialMail {
|
|||
}
|
||||
}
|
||||
|
||||
if (!$tags) {
|
||||
$tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_OTHER;
|
||||
}
|
||||
|
||||
return $tags;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue