<commit_before><?php

/**
 * @group conpherence
 */
final class ConpherenceNotificationPanelController
  extends ConpherenceController {

  public function processRequest() {

    $request = $this->getRequest();
    $user = $request->getUser();
    $conpherences = array();
    $unread_status = ConpherenceParticipationStatus::BEHIND;

    $participant_data = id(new ConpherenceParticipantQuery())
      ->withParticipantPHIDs(array($user->getPHID()))
      ->setLimit(5)
      ->execute();

    if ($participant_data) {
      $conpherences = id(new ConpherenceThreadQuery())
        ->setViewer($user)
        ->withPHIDs(array_keys($participant_data))
        ->needParticipantCache(true)
        ->execute();
    }

    if ($conpherences) {
      require_celerity_resource('conpherence-notification-css');
      $view = new AphrontNullView();
      foreach ($conpherences as $conpherence) {
        $p_data = $participant_data[$conpherence->getPHID()];
        $d_data = $conpherence->getDisplayData($user);
        $classes = array(
          'phabricator-notification',
          'conpherence-notification',
        );

        if ($p_data->getParticipationStatus() == $unread_status) {
          $classes[] = 'phabricator-notification-unread';
        }
        $uri = $this->getApplicationURI($conpherence->getID().'/');
        $title = $d_data['title'];
        $subtitle = $d_data['subtitle'];
        $unread_count = $d_data['unread_count'];
        $epoch = $d_data['epoch'];
        $image = $d_data['image'];<commit_msg>Conpherence notifications - fix ordering<commit_after><?php

/**
 * @group conpherence
 */
final class ConpherenceNotificationPanelController
  extends ConpherenceController {

  public function processRequest() {

    $request = $this->getRequest();
    $user = $request->getUser();
    $conpherences = array();
    $unread_status = ConpherenceParticipationStatus::BEHIND;

    $participant_data = id(new ConpherenceParticipantQuery())
      ->withParticipantPHIDs(array($user->getPHID()))
      ->setLimit(5)
      ->execute();

    if ($participant_data) {
      $conpherences = id(new ConpherenceThreadQuery())
        ->setViewer($user)
        ->withPHIDs(array_keys($participant_data))
        ->needParticipantCache(true)
        ->execute();
    }

    if ($conpherences) {
      require_celerity_resource('conpherence-notification-css');
      // re-order the conpherences based on participation data
      $conpherences = array_select_keys(
        $conpherences, array_keys($participant_data));
      $view = new AphrontNullView();
      foreach ($conpherences as $conpherence) {
        $p_data = $participant_data[$conpherence->getPHID()];
        $d_data = $conpherence->getDisplayData($user);
        $classes = array(
          'phabricator-notification',
          'conpherence-notification',
        );

        if ($p_data->getParticipationStatus() == $unread_status) {
          $classes[] = 'phabricator-notification-unread';
        }
        $uri = $this->getApplicationURI($conpherence->getID().'/');
        $title = $d_data['title'];
        $subtitle = $d_data['subtitle'];
        $unread_count = $d_data['unread_count'];
        $epoch = $d_data['epoch'];
        $image = $d_data['image'];
{'fraction_non_alphanumeric': 0.14689612784265518, 'fraction_numerical': 0.0006146281499692685, 'mean_word_length': 3.183804627249357, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6964604', 'n_tokens_mistral': 1016, 'n_tokens_neox': 983, 'n_words': 151}