Merge "Add IContextSource as parameter to ChangeTags::formatSummaryRow"
[lhc/web/wiklou.git] / includes / changes / ChangesList.php
index 9567700..1c7d4f0 100644 (file)
@@ -481,20 +481,6 @@ class ChangesList extends ContextSource {
                }
        }
 
-       /**
-        * Check whether to enable recent changes patrol features
-        *
-        * @deprecated since 1.22
-        * @return bool
-        */
-       public static function usePatrol() {
-               global $wgUser;
-
-               wfDeprecated( __METHOD__, '1.22' );
-
-               return $wgUser->useRCPatrol();
-       }
-
        /**
         * Returns the string which indicates the number of watching users
         * @param int $count Number of user watching a page
@@ -505,10 +491,9 @@ class ChangesList extends ContextSource {
                        return '';
                }
                $cache = $this->watchMsgCache;
-               $that = $this;
                return $cache->getWithSetCallback( $count, $cache::TTL_INDEFINITE,
-                       function () use ( $that, $count ) {
-                               return $that->msg( 'number_of_watching_users_RCview' )
+                       function () use ( $count ) {
+                               return $this->msg( 'number_of_watching_users_RCview' )
                                        ->numParams( $count )->escaped();
                        }
                );
@@ -604,7 +589,8 @@ class ChangesList extends ContextSource {
 
                list( $tagSummary, $newClasses ) = ChangeTags::formatSummaryRow(
                        $rc->mAttribs['ts_tags'],
-                       'changeslist'
+                       'changeslist',
+                       $this->getContext()
                );
                $classes = array_merge( $classes, $newClasses );
                $s .= ' ' . $tagSummary;
@@ -639,9 +625,11 @@ class ChangesList extends ContextSource {
                if ( $rc instanceof RecentChange ) {
                        $isPatrolled = $rc->mAttribs['rc_patrolled'];
                        $rcType = $rc->mAttribs['rc_type'];
+                       $rcLogType = $rc->mAttribs['rc_log_type'];
                } else {
                        $isPatrolled = $rc->rc_patrolled;
                        $rcType = $rc->rc_type;
+                       $rcLogType = $rc->rc_log_type;
                }
 
                if ( !$isPatrolled ) {
@@ -651,6 +639,9 @@ class ChangesList extends ContextSource {
                        if ( $user->useNPPatrol() && $rcType == RC_NEW ) {
                                return true;
                        }
+                       if ( $user->useFilePatrol() && $rcLogType == 'upload' ) {
+                               return true;
+                       }
                }
 
                return false;