$fld_flags = false, $fld_timestamp = false, $fld_user = false,
$fld_comment = false, $fld_parsedcomment = false, $fld_sizes = false,
$fld_notificationtimestamp = false, $fld_userid = false,
- $fld_loginfo = false;
+ $fld_loginfo = false, $fld_tags;
/**
* @param ApiPageSet $resultPageSet
$this->fld_patrol = isset( $prop['patrol'] );
$this->fld_notificationtimestamp = isset( $prop['notificationtimestamp'] );
$this->fld_loginfo = isset( $prop['loginfo'] );
+ $this->fld_tags = isset( $prop['tags'] );
if ( $this->fld_patrol ) {
if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
if ( $this->fld_loginfo ) {
$includeFields[] = WatchedItemQueryService::INCLUDE_LOG_INFO;
}
+ if ( $this->fld_tags ) {
+ $includeFields[] = WatchedItemQueryService::INCLUDE_TAGS;
+ }
return $includeFields;
}
}
}
+ if ( $this->fld_tags ) {
+ if ( $recentChangeInfo['rc_tags'] ) {
+ $tags = explode( ',', $recentChangeInfo['rc_tags'] );
+ ApiResult::setIndexedTagName( $tags, 'tag' );
+ $vals['tags'] = $tags;
+ } else {
+ $vals['tags'] = [];
+ }
+ }
+
if ( $anyHidden && ( $recentChangeInfo['rc_deleted'] & Revision::DELETED_RESTRICTED ) ) {
$vals['suppressed'] = true;
}
'sizes',
'notificationtimestamp',
'loginfo',
+ 'tags',
]
],
'show' => [
"apihelp-query+watchlist-paramvalue-prop-sizes": "Adds the old and new lengths of the page.",
"apihelp-query+watchlist-paramvalue-prop-notificationtimestamp": "Adds timestamp of when the user was last notified about the edit.",
"apihelp-query+watchlist-paramvalue-prop-loginfo": "Adds log information where appropriate.",
+ "apihelp-query+watchlist-paramvalue-prop-tags": "Lists tags for the entry.",
"apihelp-query+watchlist-param-show": "Show only items that meet these criteria. For example, to see only minor edits done by logged-in users, set $1show=minor|!anon.",
"apihelp-query+watchlist-param-type": "Which types of changes to show:",
"apihelp-query+watchlist-paramvalue-type-edit": "Regular page edits.",
"apihelp-query+watchlist-paramvalue-prop-sizes": "{{doc-apihelp-paramvalue|query+watchlist|prop|sizes}}",
"apihelp-query+watchlist-paramvalue-prop-notificationtimestamp": "{{doc-apihelp-paramvalue|query+watchlist|prop|notificationtimestamp}}",
"apihelp-query+watchlist-paramvalue-prop-loginfo": "{{doc-apihelp-paramvalue|query+watchlist|prop|loginfo}}",
+ "apihelp-query+watchlist-paramvalue-prop-tags": "{{doc-apihelp-paramvalue|query+watchlist|prop|tags}}",
"apihelp-query+watchlist-param-show": "{{doc-apihelp-param|query+watchlist|show}}",
"apihelp-query+watchlist-param-type": "{{doc-apihelp-param|query+watchlist|type}}",
"apihelp-query+watchlist-paramvalue-type-edit": "{{doc-apihelp-paramvalue|query+watchlist|type|edit}}",
const INCLUDE_PATROL_INFO = 'patrol';
const INCLUDE_SIZES = 'sizes';
const INCLUDE_LOG_INFO = 'loginfo';
+ const INCLUDE_TAGS = 'tags';
// FILTER_* constants are part of public API (are used in ApiQueryWatchlist and
// ApiQueryWatchlistRaw classes) and should not be changed.
if ( in_array( self::INCLUDE_COMMENT, $options['includeFields'] ) ) {
$tables += $this->getCommentStore()->getJoin()['tables'];
}
+ if ( in_array( self::INCLUDE_TAGS, $options['includeFields'] ) ) {
+ $tables[] = 'tag_summary';
+ }
return $tables;
}
if ( in_array( self::INCLUDE_LOG_INFO, $options['includeFields'] ) ) {
$fields = array_merge( $fields, [ 'rc_logid', 'rc_log_type', 'rc_log_action', 'rc_params' ] );
}
+ if ( in_array( self::INCLUDE_TAGS, $options['includeFields'] ) ) {
+ // prefixed with rc_ to include the field in getRecentChangeFieldsFromRow
+ $fields['rc_tags'] = 'ts_tags';
+ }
return $fields;
}
if ( in_array( self::INCLUDE_COMMENT, $options['includeFields'] ) ) {
$joinConds += $this->getCommentStore()->getJoin()['joins'];
}
+ if ( in_array( self::INCLUDE_TAGS, $options['includeFields'] ) ) {
+ $joinConds['tag_summary'] = [ 'LEFT JOIN', [ 'rc_id=ts_rc_id' ] ];
+ }
return $joinConds;
}