ContribsPager: Batch page existence lookup for IP range contributions
authorKunal Mehta <legoktm@member.fsf.org>
Thu, 7 Sep 2017 00:08:29 +0000 (17:08 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Thu, 7 Sep 2017 00:08:29 +0000 (17:08 -0700)
When looking up contributions for a range of IP addresses, include the
IP's talk page in page existence lookup batch so it doesn't get looked
up individually.

Change-Id: I5151c10569a92805f79b59f68f9c57c451dc4597

includes/specials/pagers/ContribsPager.php

index 4296b78..31ea810 100644 (file)
@@ -394,6 +394,9 @@ class ContribsPager extends RangeChronologicalPager {
                                if ( $this->contribs === 'newbie' ) { // multiple users
                                        $batch->add( NS_USER, $row->user_name );
                                        $batch->add( NS_USER_TALK, $row->user_name );
+                               } elseif ( $this->isQueryableRange( $this->target ) ) {
+                                       // If this is an IP range, batch the IP's talk page
+                                       $batch->add( NS_USER_TALK, $row->rev_user_text );
                                }
                                $batch->add( $row->page_namespace, $row->page_title );
                        }