85 $rcQuery = RecentChange::getQueryInfo();
90 $username = $this->opts->getValue(
'username' );
91 $user = Title::makeTitleSafe(
NS_USER, $username );
93 $size = abs( intval( $this->opts->getValue(
'size' ) ) );
95 if ( $this->opts->getValue(
'size-mode' ) ===
'max' ) {
96 $conds[] =
'page_len <= ' . $size;
98 $conds[] =
'page_len >= ' . $size;
103 $conds[
'actor_name'] = $user->getText();
105 # If anons cannot make new pages, don't "exclude logged in users"!
106 $conds[
'actor_user'] =
null;
111 # If this user cannot see patrolled edits or they are off, don't do dumb queries!
112 if ( $this->opts->getValue(
'hidepatrolled' ) && $this->getUser()->useNPPatrol() ) {
113 $conds[
'rc_patrolled'] = RecentChange::PRC_UNPATROLLED;
116 if ( $this->opts->getValue(
'hidebots' ) ) {
117 $conds[
'rc_bot'] = 0;
120 if ( $this->opts->getValue(
'hideredirs' ) ) {
121 $conds[
'page_is_redirect'] = 0;
125 $tables = array_merge( $rcQuery[
'tables'], [
'page' ] );
126 $fields = array_merge( $rcQuery[
'fields'], [
127 'length' =>
'page_len',
'rev_id' =>
'page_latest',
'page_namespace',
'page_title',
128 'page_content_model',
130 $join_conds = [
'page' => [
'JOIN',
'page_id=rc_cur_id' ] ] + $rcQuery[
'joins'];
132 $this->hookRunner->onSpecialNewpagesConditions(
133 $this, $this->opts, $conds, $tables, $fields, $join_conds );
140 'join_conds' => $join_conds
150 $this->opts[
'tagfilter']
163 $namespace = $this->opts->getValue(
'namespace' );
164 if ( $namespace ===
'all' || $namespace ===
'' ) {
168 $namespace = intval( $namespace );
174 $invert = $this->opts->getValue(
'invert' );
175 $associated = $this->opts->getValue(
'associated' );
177 $eq_op = $invert ?
'!=' :
'=';
178 $bool_op = $invert ?
'AND' :
'OR';
181 $selectedNS =
$dbr->addQuotes( $namespace );
182 if ( !$associated ) {
183 return [
"rc_namespace $eq_op $selectedNS" ];
186 $associatedNS =
$dbr->addQuotes(
187 $this->namespaceInfo->getAssociated( $namespace )
190 "rc_namespace $eq_op $selectedNS " .
192 " rc_namespace $eq_op $associatedNS"