r70018 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70017‎ | r70018 | r70019 >
Date:15:52, 27 July 2010
Author:reedy
Status:reverted
Tags:
Comment:
Kill off some more < 1.16 stuff
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/NewMessagesController.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/NewMessagesController.php
@@ -256,34 +256,30 @@
257257 $dbr = wfGetDB( DB_SLAVE );
258258 $fields = array( $dbr->tableName( 'user' ) . '.*' );
259259 $join_conds = array();
260 - $oldPreferenceFormat = false;
261 - if ( version_compare( $wgVersion, '1.16', '<' ) ) {
262 - $oldPreferenceFormat = true;
263 - } else {
264 - $tableNameUserProperties = $dbr->tableName( 'user_properties' );
 260+
 261+ $tableNameUserProperties = $dbr->tableName( 'user_properties' );
265262
266 - $tables[] = $tableNameUserProperties . ' as tc_prop';
267 - $fields[] = 'tc_prop.up_value as timecorrection';
 263+ $tables[] = $tableNameUserProperties . ' as tc_prop';
 264+ $fields[] = 'tc_prop.up_value as timecorrection';
268265
269 - $join_conds[$tableNameUserProperties . ' as tc_prop'] = array(
270 - 'left join',
271 - array(
272 - 'tc_prop.up_user=user_id',
273 - 'tc_prop.up_property' => 'timecorrection',
274 - )
275 - );
 266+ $join_conds[$tableNameUserProperties . ' as tc_prop'] = array(
 267+ 'left join',
 268+ array(
 269+ 'tc_prop.up_user=user_id',
 270+ 'tc_prop.up_property' => 'timecorrection',
 271+ )
 272+ );
276273
277 - $tables[] = $tableNameUserProperties . ' as l_prop';
278 - $fields[] = 'l_prop.up_value as language';
 274+ $tables[] = $tableNameUserProperties . ' as l_prop';
 275+ $fields[] = 'l_prop.up_value as language';
279276
280 - $join_conds[$tableNameUserProperties . ' as l_prop'] = array(
281 - 'left join',
282 - array(
283 - 'l_prop.up_user=user_id',
284 - 'l_prop.up_property' => 'language',
285 - )
286 - );
287 - }
 277+ $join_conds[$tableNameUserProperties . ' as l_prop'] = array(
 278+ 'left join',
 279+ array(
 280+ 'l_prop.up_user=user_id',
 281+ 'l_prop.up_property' => 'language',
 282+ )
 283+ );
288284
289285 $res = $dbr->select(
290286 $tables, $fields,
@@ -305,9 +301,7 @@
306302 while ( $row = $dbr->fetchObject( $res ) ) {
307303 $u = User::newFromRow( $row );
308304
309 - if ( $oldPreferenceFormat ) {
310 - $langCode = $u->getOption( 'language' );
311 - } elseif ( $row->language ) {
 305+ if ( $row->language ) {
312306 $langCode = $row->language;
313307 } else {
314308 global $wgLanguageCode;
@@ -317,11 +311,7 @@
318312 $lang = Language::factory( $langCode );
319313
320314 // Adjust with time correction
321 - if ( $oldPreferenceFormat ) {
322 - $timeCorrection = $u->getOption( 'timecorrection' );
323 - } else {
324 - $timeCorrection = $row->timecorrection;
325 - }
 315+ $timeCorrection = $row->timecorrection;
326316 $adjustedTimestamp = $lang->userAdjust( $timestamp, $timeCorrection );
327317
328318 $date = $lang->date( $adjustedTimestamp );
@@ -334,7 +324,7 @@
335325 $msg = wfMsgReal( $msgName, $params, true /* use DB */, $langCode,
336326 true /*transform*/ );
337327
338 - $to = new MailAddress( $u );
 328+ $to = new MailAddress( $u );
339329 $subject = wfMsgReal( $subjectMsg, array( $threadSubject ), true /* use DB */,
340330 $langCode, true /* transform */ );
341331
@@ -380,8 +370,9 @@
381371
382372 $cval = $wgMemc->get( wfMemcKey( 'lqt-new-messages-count', $user->getId() ) );
383373
384 - if ( $cval )
 374+ if ( $cval ) {
385375 return $cval;
 376+ }
386377
387378 $dbr = wfGetDB( DB_SLAVE );
388379

Follow-up revisions

RevisionCommit summaryAuthorDate
r70075Revert r70017 and r70018. I'm not going to deliberately remove support for 1....werdna10:02, 28 July 2010
r81030Reapplying r70018 in a cleaner wayreedy16:28, 26 January 2011

Status & tagging log