Changeset View
Changeset View
Standalone View
Standalone View
src/applications/aphlict/query/AphlictDropdownDataQuery.php
| Show All 40 Lines | final class AphlictDropdownDataQuery extends Phobject { | ||||
| public function execute() { | public function execute() { | ||||
| $viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
| $conpherence_app = 'PhabricatorConpherenceApplication'; | $conpherence_app = 'PhabricatorConpherenceApplication'; | ||||
| $is_c_installed = PhabricatorApplication::isClassInstalledForViewer( | $is_c_installed = PhabricatorApplication::isClassInstalledForViewer( | ||||
| $conpherence_app, | $conpherence_app, | ||||
| $viewer); | $viewer); | ||||
| $raw_message_count_number = null; | |||||
| $message_count_number = null; | |||||
| if ($is_c_installed) { | if ($is_c_installed) { | ||||
| $unread_status = ConpherenceParticipationStatus::BEHIND; | $raw_message_count_number = $viewer->getUnreadMessageCount(); | ||||
| $unread = id(new ConpherenceParticipantCountQuery()) | |||||
| ->withParticipantPHIDs(array($viewer->getPHID())) | |||||
| ->withParticipationStatus($unread_status) | |||||
| ->execute(); | |||||
| $raw_message_count_number = idx($unread, $viewer->getPHID(), 0); | |||||
| $message_count_number = $this->formatNumber($raw_message_count_number); | $message_count_number = $this->formatNumber($raw_message_count_number); | ||||
| } else { | |||||
| $raw_message_count_number = null; | |||||
| $message_count_number = null; | |||||
| } | } | ||||
| $conpherence_data = array( | $conpherence_data = array( | ||||
| 'isInstalled' => $is_c_installed, | 'isInstalled' => $is_c_installed, | ||||
| 'countType' => 'messages', | 'countType' => 'messages', | ||||
| 'count' => $message_count_number, | 'count' => $message_count_number, | ||||
| 'rawCount' => $raw_message_count_number, | 'rawCount' => $raw_message_count_number, | ||||
| ); | ); | ||||
| $this->setConpherenceData($conpherence_data); | $this->setConpherenceData($conpherence_data); | ||||
| $notification_app = 'PhabricatorNotificationsApplication'; | $notification_app = 'PhabricatorNotificationsApplication'; | ||||
| $is_n_installed = PhabricatorApplication::isClassInstalledForViewer( | $is_n_installed = PhabricatorApplication::isClassInstalledForViewer( | ||||
| $notification_app, | $notification_app, | ||||
| $viewer); | $viewer); | ||||
| $notification_count_number = null; | |||||
| $raw_notification_count_number = null; | |||||
| if ($is_n_installed) { | if ($is_n_installed) { | ||||
| $raw_notification_count_number = | $raw_notification_count_number = $viewer->getUnreadNotificationCount(); | ||||
| id(new PhabricatorFeedStoryNotification()) | |||||
| ->countUnread($viewer); | |||||
| $notification_count_number = $this->formatNumber( | $notification_count_number = $this->formatNumber( | ||||
| $raw_notification_count_number); | $raw_notification_count_number); | ||||
| } else { | |||||
| $notification_count_number = null; | |||||
| $raw_notification_count_number = null; | |||||
| } | } | ||||
| $notification_data = array( | $notification_data = array( | ||||
| 'isInstalled' => $is_n_installed, | 'isInstalled' => $is_n_installed, | ||||
| 'countType' => 'notifications', | 'countType' => 'notifications', | ||||
| 'count' => $notification_count_number, | 'count' => $notification_count_number, | ||||
| 'rawCount' => $raw_notification_count_number, | 'rawCount' => $raw_notification_count_number, | ||||
| ); | ); | ||||
| $this->setNotificationData($notification_data); | $this->setNotificationData($notification_data); | ||||
| Show All 15 Lines | |||||