Index: trunk/phase3/includes/ChangesList.php |
— | — | @@ -483,6 +483,18 @@ |
484 | 484 | public function insertExtra( &$s, &$rc, &$classes ) { |
485 | 485 | ## Empty, used for subclassers to add anything special. |
486 | 486 | } |
| 487 | + |
| 488 | + protected function showAsUnpatrolled( RecentChange $rc ) { |
| 489 | + $unpatrolled = false; |
| 490 | + if ( !$rc->mAttribs['rc_patrolled'] ) { |
| 491 | + if ( $this->getUser()->useRCPatrol() ) { |
| 492 | + $unpatrolled = true; |
| 493 | + } elseif ( $this->getUser()->useNPPatrol() && $rc->mAttribs['rc_new'] ) { |
| 494 | + $unpatrolled = true; |
| 495 | + } |
| 496 | + } |
| 497 | + return $unpatrolled; |
| 498 | + } |
487 | 499 | } |
488 | 500 | |
489 | 501 | |
— | — | @@ -498,8 +510,9 @@ |
499 | 511 | public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) { |
500 | 512 | global $wgRCShowChangedSize; |
501 | 513 | wfProfileIn( __METHOD__ ); |
| 514 | + |
502 | 515 | # Should patrol-related stuff be shown? |
503 | | - $unpatrolled = $this->getUser()->useRCPatrol() && !$rc->mAttribs['rc_patrolled']; |
| 516 | + $unpatrolled = $this->showAsUnpatrolled( $rc ); |
504 | 517 | |
505 | 518 | $dateheader = ''; // $s now contains only <li>...</li>, for hooks' convenience. |
506 | 519 | $this->insertDateHeader( $dateheader, $rc->mAttribs['rc_timestamp'] ); |
— | — | @@ -633,11 +646,7 @@ |
634 | 647 | } |
635 | 648 | |
636 | 649 | # Should patrol-related stuff be shown? |
637 | | - if( $this->getUser()->useRCPatrol() ) { |
638 | | - $rc->unpatrolled = !$rc->mAttribs['rc_patrolled']; |
639 | | - } else { |
640 | | - $rc->unpatrolled = false; |
641 | | - } |
| 650 | + $rc->unpatrolled = $this->showAsUnpatrolled( $rc ); |
642 | 651 | |
643 | 652 | $showdifflinks = true; |
644 | 653 | # Make article link |