+ function doBatchLookups() {
+ $uids = array();
+ foreach ( $this->mResult as $row ) {
+ $uids[] = $row->user_id;
+ }
+ // Fetch the block status of the user for showing "(blocked)" text and for
+ // striking out names of suppressed users when privileged user views the list.
+ // Although the first query already hits the block table for un-privileged, this
+ // is done in two queries to avoid huge quicksorts and to make COUNT(*) correct.
+ $dbr = $this->getDatabase();
+ $res = $dbr->select( 'ipblocks',
+ array( 'ipb_user', 'MAX(ipb_deleted) AS block_status' ),
+ array( 'ipb_user' => $uids ),
+ __METHOD__,
+ array( 'GROUP BY' => array( 'ipb_user' ) )
+ );
+ $this->blockStatusByUid = array();
+ foreach ( $res as $row ) {
+ $this->blockStatusByUid[$row->ipb_user] = $row->block_status; // 0 or 1
+ }
+ $this->mResult->seek( 0 );
+ }
+