Update mediawiki/mediawiki-codesniffer to 0.7.2
[lhc/web/wiklou.git] / includes / logging / LogEntry.php
index 1d0a543..20d0217 100644 (file)
@@ -428,6 +428,9 @@ class ManualLogEntry extends LogEntryBase {
        /** @var int ID of the log entry */
        protected $id;
 
+       /** @var Can this log entry be patrolled? */
+       protected $isPatrollable = false;
+
        /** @var bool Whether this is a legacy log entry */
        protected $legacy = false;
 
@@ -545,6 +548,19 @@ class ManualLogEntry extends LogEntryBase {
                $this->tags = $tags;
        }
 
+       /**
+        * Set whether this log entry should be made patrollable
+        * This shouldn't depend on config, only on whether there is full support
+        * in the software for patrolling this log entry.
+        * False by default
+        *
+        * @since 1.27
+        * @param bool $patrollable
+        */
+       public function setIsPatrollable( $patrollable ) {
+               $this->isPatrollable = (bool)$patrollable;
+       }
+
        /**
         * Set the 'legacy' flag
         *
@@ -679,7 +695,8 @@ class ManualLogEntry extends LogEntryBase {
                        LogEntryBase::makeParamBlob( $this->getParameters() ),
                        $newId,
                        $formatter->getIRCActionComment(), // Used for IRC feeds
-                       $this->getAssociatedRevId() // Used for e.g. moves and uploads
+                       $this->getAssociatedRevId(), // Used for e.g. moves and uploads
+                       $this->getIsPatrollable()
                );
        }
 
@@ -706,8 +723,8 @@ class ManualLogEntry extends LogEntryBase {
                        $rc->notifyRCFeeds();
                }
 
-               // Log the autopatrol if an associated rev id was passed
-               if ( $this->getAssociatedRevId() > 0 &&
+               // Log the autopatrol if the log entry is patrollable
+               if ( $this->getIsPatrollable() &&
                        $rc->getAttribute( 'rc_patrolled' ) === 1 ) {
                        PatrolLog::record( $rc, true, $this->getPerformer() );
                }
@@ -775,6 +792,16 @@ class ManualLogEntry extends LogEntryBase {
                return $this->tags;
        }
 
+       /**
+        * Whether this log entry is patrollable
+        *
+        * @since 1.27
+        * @return bool
+        */
+       public function getIsPatrollable() {
+               return $this->isPatrollable;
+       }
+
        /**
         * @since 1.25
         * @return bool