Sbisson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/216131

Change subject: Allow ChangesList::isUnpatrolled to use different change types
......................................................................

Allow ChangesList::isUnpatrolled to use different change types

This function is really useful for patrolling in Flow
but we need to check for a different rcType (RC_FLOW: 142).

I would prefer to generalize this function than duplicate
some of its logic. If this is unacceptable and there is
a better way, please let me know.

Bug: T95025
Change-Id: I7795d8f7965b2af1618fb2b6b817ecfa440225f3
---
M includes/changes/ChangesList.php
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/31/216131/1

diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php
index 932006d..687d704 100644
--- a/includes/changes/ChangesList.php
+++ b/includes/changes/ChangesList.php
@@ -571,9 +571,10 @@
        /**
         * @param object|RecentChange $rc Database row from recentchanges or a 
RecentChange object
         * @param User $user
+        * @param int $npChangeType
         * @return bool
         */
-       public static function isUnpatrolled( $rc, User $user ) {
+       public static function isUnpatrolled( $rc, User $user, $npChangeType = 
RC_NEW ) {
                if ( $rc instanceof RecentChange ) {
                        $isPatrolled = $rc->mAttribs['rc_patrolled'];
                        $rcType = $rc->mAttribs['rc_type'];
@@ -586,7 +587,7 @@
                        if ( $user->useRCPatrol() ) {
                                return true;
                        }
-                       if ( $user->useNPPatrol() && $rcType == RC_NEW ) {
+                       if ( $user->useNPPatrol() && $rcType == $npChangeType ) 
{
                                return true;
                        }
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/216131
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7795d8f7965b2af1618fb2b6b817ecfa440225f3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Sbisson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to