1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 21:40:55 +01:00

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
This commit is contained in:
Chad Little 2017-04-12 13:21:47 -07:00
parent 75303567b3
commit 6bf595b951

View file

@ -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) {