private function renderPreferencesDialog(ConpherenceThread $conpherence) { $request = $this->getRequest(); $user = $request->getUser(); $participant = $conpherence->getParticipantIfExists($user->getPHID()); if (!$participant) { $can_join = PhabricatorPolicyFilter::hasCapability($user, $conpherence, PhabricatorPolicyCapability::CAN_JOIN); if ($can_join) { $text = pht('Notification settings are available after joining the room.'); } else { if ($user->isLoggedIn()) { $text = pht('Notification settings not applicable to rooms you can not join.'); } else { $text = pht('Notification settings are available after logging in and joining ' . 'the room.'); } } return id(new AphrontDialogView())->setTitle(pht('Room Preferences'))->appendParagraph($text); } $notification_key = PhabricatorConpherenceNotificationsSetting::SETTINGKEY; $notification_default = $user->getUserSetting($notification_key); $settings = $participant->getSettings(); $notifications = idx($settings, 'notifications', $notification_default); $form = id(new AphrontFormView())->setUser($user)->setFullWidth(true)->appendControl(id(new AphrontFormRadioButtonControl())->addButton(PhabricatorConpherenceNotificationsSetting::VALUE_CONPHERENCE_EMAIL, PhabricatorConpherenceNotificationsSetting::getSettingLabel(PhabricatorConpherenceNotificationsSetting::VALUE_CONPHERENCE_EMAIL), '')->addButton(PhabricatorConpherenceNotificationsSetting::VALUE_CONPHERENCE_NOTIFY, PhabricatorConpherenceNotificationsSetting::getSettingLabel(PhabricatorConpherenceNotificationsSetting::VALUE_CONPHERENCE_NOTIFY), '')->setName('notifications')->setValue($notifications)); return id(new AphrontDialogView())->setTitle(pht('Room Preferences'))->addHiddenInput('action', 'notifications')->addHiddenInput('latest_transaction_id', $request->getInt('latest_transaction_id'))->appendForm($form); }