From 6bf595b95154b3f21f89beab88feeee8f7f1210e Mon Sep 17 00:00:00 2001 From: Chad Little Date: Wed, 12 Apr 2017 13:21:47 -0700 Subject: [PATCH] Check is viewer is a participant before showing count Summary: In Conpherence ProfileMenuItem we show an unread count if you're a participant, but all message count if you're not. Just remove that. Test Plan: Log out of room in Conpherence, leave messages on second account, check menu item on both accounts. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D17664 --- .../menuitem/PhabricatorConpherenceProfileMenuItem.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/applications/search/menuitem/PhabricatorConpherenceProfileMenuItem.php b/src/applications/search/menuitem/PhabricatorConpherenceProfileMenuItem.php index 32755d736f..18342cb357 100644 --- a/src/applications/search/menuitem/PhabricatorConpherenceProfileMenuItem.php +++ b/src/applications/search/menuitem/PhabricatorConpherenceProfileMenuItem.php @@ -102,8 +102,13 @@ final class PhabricatorConpherenceProfileMenuItem return array(); } - $data = $room->getDisplayData($viewer); - $unread_count = $data['unread_count']; + $participants = $room->getParticipants(); + $viewer_phid = $viewer->getPHID(); + $unread_count = null; + if (isset($participants[$viewer_phid])) { + $data = $room->getDisplayData($viewer); + $unread_count = $data['unread_count']; + } $count = null; if ($unread_count) {