Index: branches/wmf/1.18wmf1/includes/ChangesList.php |
— | — | @@ -513,6 +513,18 @@ |
514 | 514 | public function insertExtra( &$s, &$rc, &$classes ) { |
515 | 515 | ## Empty, used for subclassers to add anything special. |
516 | 516 | } |
| 517 | + |
| 518 | + protected function showAsUnpatrolled( RecentChange $rc ) { |
| 519 | + $unpatrolled = false; |
| 520 | + if ( !$rc->mAttribs['rc_patrolled'] ) { |
| 521 | + if ( $this->getUser()->useRCPatrol() ) { |
| 522 | + $unpatrolled = true; |
| 523 | + } elseif ( $this->getUser()->useNPPatrol() && $rc->mAttribs['rc_new'] ) { |
| 524 | + $unpatrolled = true; |
| 525 | + } |
| 526 | + } |
| 527 | + return $unpatrolled; |
| 528 | + } |
517 | 529 | } |
518 | 530 | |
519 | 531 | |
— | — | @@ -528,8 +540,9 @@ |
529 | 541 | public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) { |
530 | 542 | global $wgRCShowChangedSize; |
531 | 543 | wfProfileIn( __METHOD__ ); |
| 544 | + |
532 | 545 | # Should patrol-related stuff be shown? |
533 | | - $unpatrolled = $this->getUser()->useRCPatrol() && !$rc->mAttribs['rc_patrolled']; |
| 546 | + $unpatrolled = $this->showAsUnpatrolled( $rc ); |
534 | 547 | |
535 | 548 | $dateheader = ''; // $s now contains only <li>...</li>, for hooks' convenience. |
536 | 549 | $this->insertDateHeader( $dateheader, $rc->mAttribs['rc_timestamp'] ); |
— | — | @@ -661,11 +674,7 @@ |
662 | 675 | } |
663 | 676 | |
664 | 677 | # Should patrol-related stuff be shown? |
665 | | - if( $this->getUser()->useRCPatrol() ) { |
666 | | - $rc->unpatrolled = !$rc->mAttribs['rc_patrolled']; |
667 | | - } else { |
668 | | - $rc->unpatrolled = false; |
669 | | - } |
| 678 | + $rc->unpatrolled = $this->showAsUnpatrolled( $rc ); |
670 | 679 | |
671 | 680 | $showdifflinks = true; |
672 | 681 | # Make article link |