* (bug 1459) Search for duplicate files by hash: Special:FileDuplicateSearch
[lhc/web/wiklou.git] / includes / RecentChange.php
index 41af45a..ac647b0 100644 (file)
  *     rc_patrolled    boolean whether or not someone has marked this edit as patrolled
  *     rc_old_len      integer byte length of the text before the edit
  *     rc_new_len      the same after the edit
+  *    rc_deleted              partial deletion
+ *     rc_logid                the log_id value for this log entry (or zero)
+ *  rc_log_type                the log type (or null)
+ *     rc_log_action   the log action (or null)
+ *  rc_params          log params
  *
  * mExtra:
  *     prefixedDBkey   prefixed db key, used by external app via msg queue
@@ -238,6 +243,7 @@ class RecentChange
         * Mark a given change as patrolled
         *
         * @param mixed $change RecentChange or corresponding rc_id
+        * @returns integer number of affected rows
         */
        public static function markPatrolled( $change ) {
                $rcid = $change instanceof RecentChange
@@ -254,18 +260,14 @@ class RecentChange
                        ),
                        __METHOD__
                );
+               return $dbw->affectedRows();
        }
 
        # Makes an entry in the database corresponding to an edit
        public static function notifyEdit( $timestamp, &$title, $minor, &$user, $comment,
-               $oldId, $lastTimestamp, $bot = "default", $ip = '', $oldSize = 0, $newSize = 0,
+               $oldId, $lastTimestamp, $bot, $ip = '', $oldSize = 0, $newSize = 0,
                $newId = 0)
        {
-
-               if ( $bot === 'default' ) {
-                       $bot = $user->isAllowed( 'bot' );
-               }
-
                if ( !$ip ) {
                        $ip = wfGetIP();
                        if ( !$ip ) {
@@ -312,7 +314,7 @@ class RecentChange
         * Note: the title object must be loaded with the new id using resetArticleID()
         * @todo Document parameters and return
         */
-       public static function notifyNew( $timestamp, &$title, $minor, &$user, $comment, $bot = 'default',
+       public static function notifyNew( $timestamp, &$title, $minor, &$user, $comment, $bot,
          $ip='', $size = 0, $newId = 0 )
        {
                if ( !$ip ) {
@@ -321,9 +323,6 @@ class RecentChange
                                $ip = '';
                        }
                }
-               if ( $bot === 'default' ) {
-                       $bot = $user->isAllowed( 'bot' );
-               }
 
                $rc = new RecentChange;
                $rc->mAttribs = array(
@@ -362,6 +361,8 @@ class RecentChange
        # Makes an entry in the database corresponding to a rename
        public static function notifyMove( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='', $overRedir = false )
        {
+               global $wgRequest;
+
                if ( !$ip ) {
                        $ip = wfGetIP();
                        if ( !$ip ) {
@@ -383,7 +384,7 @@ class RecentChange
                        'rc_comment'    => $comment,
                        'rc_this_oldid' => 0,
                        'rc_last_oldid' => 0,
-                       'rc_bot'        => $user->isAllowed( 'bot' ) ? 1 : 0,
+                       'rc_bot'        => $user->isAllowed( 'bot' ) ? $wgRequest->getBool( 'bot' , true ) : 0,
                        'rc_moved_to_ns'        => $newTitle->getNamespace(),
                        'rc_moved_to_title'     => $newTitle->getDBkey(),
                        'rc_ip'         => $ip,
@@ -414,6 +415,8 @@ class RecentChange
        public static function notifyLog( $timestamp, &$title, &$user, $comment, $ip='',
           $type, $action, $target, $logComment, $params )
        {
+               global $wgRequest;
+
                if ( !$ip ) {
                        $ip = wfGetIP();
                        if ( !$ip ) {
@@ -435,7 +438,7 @@ class RecentChange
                        'rc_comment'    => $comment,
                        'rc_this_oldid' => 0,
                        'rc_last_oldid' => 0,
-                       'rc_bot'        => $user->isAllowed( 'bot' ) ? 1 : 0,
+                       'rc_bot'        => $user->isAllowed( 'bot' ) ? $wgRequest->getBool( 'bot' , true ) : 0,
                        'rc_moved_to_ns'        => 0,
                        'rc_moved_to_title'     => '',
                        'rc_ip' => $ip,
@@ -489,6 +492,12 @@ class RecentChange
                        'rc_new' => $row->page_is_new, # obsolete
                        'rc_old_len' => $row->rc_old_len,
                        'rc_new_len' => $row->rc_new_len,
+                       'rc_params' => isset($row->rc_params) ? $row->rc_params : '',
+                       'rc_log_type' => isset($row->rc_log_type) ? $row->rc_log_type : null,
+                       'rc_log_action' => isset($row->rc_log_action) ? $row->rc_log_action : null,
+                       'rc_log_id' => isset($row->rc_log_id) ? $row->rc_log_id: 0,
+                       // this one REALLY should be set...
+                       'rc_deleted' => isset($row->rc_deleted) ? $row->rc_deleted: 0,
                );
 
                $this->mExtra = array();