Merge "selenium: Run wdio directly without grunt"
[lhc/web/wiklou.git] / includes / watcheditem / WatchedItemQueryService.php
index 412fdf5..506ee00 100644 (file)
@@ -25,6 +25,7 @@ class WatchedItemQueryService {
        const INCLUDE_USER_ID = 'userid';
        const INCLUDE_COMMENT = 'comment';
        const INCLUDE_PATROL_INFO = 'patrol';
+       const INCLUDE_AUTOPATROL_INFO = 'autopatrol';
        const INCLUDE_SIZES = 'sizes';
        const INCLUDE_LOG_INFO = 'loginfo';
        const INCLUDE_TAGS = 'tags';
@@ -40,6 +41,8 @@ class WatchedItemQueryService {
        const FILTER_NOT_ANON = '!anon';
        const FILTER_PATROLLED = 'patrolled';
        const FILTER_NOT_PATROLLED = '!patrolled';
+       const FILTER_AUTOPATROLLED = 'autopatrolled';
+       const FILTER_NOT_AUTOPATROLLED = '!autopatrolled';
        const FILTER_UNREAD = 'unread';
        const FILTER_NOT_UNREAD = '!unread';
        const FILTER_CHANGED = 'changed';
@@ -495,9 +498,15 @@ class WatchedItemQueryService {
                        // TODO: not sure if this should simply ignore patrolled filters if user does not have the patrol
                        // right, or maybe rather fail loud at this point, same as e.g. ApiQueryWatchlist does?
                        if ( in_array( self::FILTER_PATROLLED, $options['filters'] ) ) {
-                               $conds[] = 'rc_patrolled != 0';
+                               $conds[] = 'rc_patrolled != ' . RecentChange::PRC_UNPATROLLED;
                        } elseif ( in_array( self::FILTER_NOT_PATROLLED, $options['filters'] ) ) {
-                               $conds[] = 'rc_patrolled = 0';
+                               $conds['rc_patrolled'] = RecentChange::PRC_UNPATROLLED;
+                       }
+
+                       if ( in_array( self::FILTER_AUTOPATROLLED, $options['filters'] ) ) {
+                               $conds['rc_patrolled'] = RecentChange::PRC_AUTOPATROLLED;
+                       } elseif ( in_array( self::FILTER_NOT_AUTOPATROLLED, $options['filters'] ) ) {
+                               $conds[] = 'rc_patrolled != ' . RecentChange::PRC_AUTOPATROLLED;
                        }
                }