Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -79,6 +79,7 @@ |
80 | 80 | * (bug 27593) API: add error message when sha1/sha1base36 is invalid |
81 | 81 | * (bug 28578) API's parse module should not silently override invalid |
82 | 82 | title inputs |
| 83 | +* (bug 20699) API watchlist should list log-events |
83 | 84 | |
84 | 85 | === Languages updated in 1.19 === |
85 | 86 | |
Index: trunk/phase3/includes/api/ApiQueryWatchlist.php |
— | — | @@ -51,7 +51,7 @@ |
52 | 52 | |
53 | 53 | private $fld_ids = false, $fld_title = false, $fld_patrol = false, $fld_flags = false, |
54 | 54 | $fld_timestamp = false, $fld_user = false, $fld_comment = false, $fld_parsedcomment = false, $fld_sizes = false, |
55 | | - $fld_notificationtimestamp = false, $fld_userid = false; |
| 55 | + $fld_notificationtimestamp = false, $fld_userid = false, $fld_loginfo = false; |
56 | 56 | |
57 | 57 | /** |
58 | 58 | * @param $resultPageSet ApiPageSet |
— | — | @@ -78,6 +78,7 @@ |
79 | 79 | $this->fld_sizes = isset( $prop['sizes'] ); |
80 | 80 | $this->fld_patrol = isset( $prop['patrol'] ); |
81 | 81 | $this->fld_notificationtimestamp = isset( $prop['notificationtimestamp'] ); |
| 82 | + $this->fld_loginfo = isset( $prop['loginfo'] ); |
82 | 83 | |
83 | 84 | if ( $this->fld_patrol ) { |
84 | 85 | if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) { |
— | — | @@ -89,7 +90,8 @@ |
90 | 91 | $this->addFields( array( |
91 | 92 | 'rc_namespace', |
92 | 93 | 'rc_title', |
93 | | - 'rc_timestamp' |
| 94 | + 'rc_timestamp', |
| 95 | + 'rc_type', |
94 | 96 | ) ); |
95 | 97 | |
96 | 98 | if ( is_null( $resultPageSet ) ) { |
— | — | @@ -108,6 +110,10 @@ |
109 | 111 | $this->addFieldsIf( 'rc_old_len', $this->fld_sizes ); |
110 | 112 | $this->addFieldsIf( 'rc_new_len', $this->fld_sizes ); |
111 | 113 | $this->addFieldsIf( 'wl_notificationtimestamp', $this->fld_notificationtimestamp ); |
| 114 | + $this->addFieldsIf( 'rc_logid', $this->fld_loginfo ); |
| 115 | + $this->addFieldsIf( 'rc_log_type', $this->fld_loginfo ); |
| 116 | + $this->addFieldsIf( 'rc_log_action', $this->fld_loginfo ); |
| 117 | + $this->addFieldsIf( 'rc_params', $this->fld_loginfo ); |
112 | 118 | } elseif ( $params['allrev'] ) { |
113 | 119 | $this->addFields( 'rc_this_oldid' ); |
114 | 120 | } else { |
— | — | @@ -139,7 +145,7 @@ |
140 | 146 | $db->timestamp( $params['start'] ), |
141 | 147 | $db->timestamp( $params['end'] ) ); |
142 | 148 | $this->addWhereFld( 'wl_namespace', $params['namespace'] ); |
143 | | - $this->addWhereIf( 'rc_this_oldid=page_latest', !$params['allrev'] ); |
| 149 | + $this->addWhereIf( 'rc_this_oldid=page_latest OR rc_type=' . RC_LOG, !$params['allrev'] ); |
144 | 150 | |
145 | 151 | if ( !is_null( $params['show'] ) ) { |
146 | 152 | $show = array_flip( $params['show'] ); |
— | — | @@ -294,6 +300,17 @@ |
295 | 301 | $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( $row->rc_comment, $title ); |
296 | 302 | } |
297 | 303 | |
| 304 | + if ( $this->fld_loginfo && $row->rc_type == RC_LOG ) { |
| 305 | + $vals['logid'] = intval( $row->rc_logid ); |
| 306 | + $vals['logtype'] = $row->rc_log_type; |
| 307 | + $vals['logaction'] = $row->rc_log_action; |
| 308 | + ApiQueryLogEvents::addLogParams( |
| 309 | + $this->getResult(), |
| 310 | + $vals, $row->rc_params, |
| 311 | + $row->rc_log_type, $row->rc_timestamp |
| 312 | + ); |
| 313 | + } |
| 314 | + |
298 | 315 | return $vals; |
299 | 316 | } |
300 | 317 | |
— | — | @@ -344,7 +361,8 @@ |
345 | 362 | 'timestamp', |
346 | 363 | 'patrol', |
347 | 364 | 'sizes', |
348 | | - 'notificationtimestamp' |
| 365 | + 'notificationtimestamp', |
| 366 | + 'loginfo', |
349 | 367 | ) |
350 | 368 | ), |
351 | 369 | 'show' => array( |
— | — | @@ -393,6 +411,7 @@ |
394 | 412 | ' patrol - Tags edits that are patrolled', |
395 | 413 | ' size - Adds the old and new lengths of the page', |
396 | 414 | ' notificationtimestamp - Adds timestamp of when the user was last notified about the edit', |
| 415 | + ' loginfo - Adds log information where appropriate', |
397 | 416 | ), |
398 | 417 | 'show' => array( |
399 | 418 | 'Show only items that meet this criteria.', |