From 60ce989247d6ac011bfcc33ad7aab8308aa690c7 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 3 Oct 2016 13:21:06 -0700 Subject: [PATCH] Return more transaction types in Conpherence notification menu Summary: Unclear these are worth sending, but mostly seems useful. Returns `getTitle` for the transaction if it's not a message. Fixes T10683 Test Plan: Leave rooms, change names, add pictures. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T10683 Differential Revision: https://secure.phabricator.com/D16658 --- .../conpherence/storage/ConpherenceThread.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/applications/conpherence/storage/ConpherenceThread.php b/src/applications/conpherence/storage/ConpherenceThread.php index 80efc92f5a..d2e7ca8be1 100644 --- a/src/applications/conpherence/storage/ConpherenceThread.php +++ b/src/applications/conpherence/storage/ConpherenceThread.php @@ -284,11 +284,18 @@ final class ConpherenceThread extends ConpherenceDAO $message_title = null; if ($subtitle_mode == 'message') { $message_transaction = null; + $action_transaction = null; foreach ($transactions as $transaction) { switch ($transaction->getTransactionType()) { case PhabricatorTransactions::TYPE_COMMENT: $message_transaction = $transaction; - break 2; + break; + case ConpherenceTransaction::TYPE_TITLE: + case ConpherenceTransaction::TYPE_TOPIC: + case ConpherenceTransaction::TYPE_PICTURE: + case ConpherenceTransaction::TYPE_PARTICIPANTS: + $action_transaction = $transaction; + break; default: break; } @@ -303,6 +310,11 @@ final class ConpherenceThread extends ConpherenceDAO ->truncateString( $message_transaction->getComment()->getContent())); } + if ($action_transaction) { + $message_title = id(clone $action_transaction) + ->setRenderingTarget(PhabricatorApplicationTransaction::TARGET_TEXT) + ->getTitle(); + } } switch ($subtitle_mode) { case 'recent':