X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryWatchlist.php;h=69f18387860f59a0e68c5a00c2d39bf8b7933c87;hb=faf7cc4a09848c538320bd2b9067b1a77c0a0183;hp=1e3b2c739832ec6ee3682aac615ef38faf113f2d;hpb=e0b2787dae749ba3d4cb18bc9b3fe789db69046f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index 1e3b2c7398..69f1838786 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -1,9 +1,5 @@ @gmail.com" * * This program is free software; you can redistribute it and/or modify @@ -53,7 +49,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { $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 @@ -82,6 +78,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { $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() ) { @@ -90,7 +87,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { } if ( $this->fld_comment || $this->fld_parsedcomment ) { - $this->commentStore = new CommentStore( 'rc_comment' ); + $this->commentStore = CommentStore::getStore(); } } @@ -243,6 +240,9 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { if ( $this->fld_loginfo ) { $includeFields[] = WatchedItemQueryService::INCLUDE_LOG_INFO; } + if ( $this->fld_tags ) { + $includeFields[] = WatchedItemQueryService::INCLUDE_TAGS; + } return $includeFields; } @@ -357,7 +357,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { Revision::DELETED_COMMENT, $user ) ) { - $comment = $this->commentStore->getComment( $recentChangeInfo )->text; + $comment = $this->commentStore->getComment( 'rc_comment', $recentChangeInfo )->text; if ( $this->fld_comment ) { $vals['comment'] = $comment; } @@ -391,6 +391,16 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { } } + 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; } @@ -453,6 +463,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { 'sizes', 'notificationtimestamp', 'loginfo', + 'tags', ] ], 'show' => [