r104451 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104450‎ | r104451 | r104452 >
Date:16:13, 28 November 2011
Author:petrb
Status:deferred
Tags:
Comment:
rm check which was aready in another fc
Modified paths:
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php (modified) (history)
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.status.php (modified) (history)
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBarHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.status.php
@@ -64,7 +64,6 @@
6565 */
6666 public static function getStatus( $user, $delayed_check = false ) {
6767 global $wgOnlineStatusBarDefaultOffline, $wgOnlineStatusBarDefaultOnline;
68 -
6968 // instead of delete every time just select the records which are not that old
7069 if ( !$delayed_check ) {
7170 $t_time = OnlineStatusBar::getTimeoutDate();
@@ -185,7 +184,6 @@
186185 );
187186 self::deleteOld();
188187 }
189 -
190188 return true;
191189 }
192190
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php
@@ -56,11 +56,6 @@
5757 return false;
5858 }
5959
60 - // checks ns
61 - if ( $title->getNamespace() != NS_USER && $title->getNamespace() != NS_USER_TALK ) {
62 - return false;
63 - }
64 -
6560 // we need to create temporary user object
6661 $user = User::newFromId( 0 );
6762 $user->setName( $title->getBaseText() );
@@ -70,6 +65,10 @@
7166 return false;
7267 }
7368
 69+ if ( self::isValid( $user ) != true ) {
 70+ return false;
 71+ }
 72+
7473 $status = OnlineStatusBar_StatusCheck::getStatus( $user );
7574
7675 return array( $status, $user );
@@ -83,10 +82,6 @@
8483 * @return array|bool Array containing the status and User object
8584 */
8685 public static function getUserInfoFromTitle( Title $title ) {
87 - if ( $title->getNamespace() != NS_USER && $title->getNamespace() != NS_USER_TALK ) {
88 - return false;
89 - }
90 -
9186 // We create an user object using name of user parsed from title
9287 $user = User::newFromName( $title->getBaseText() );
9388 // Invalid user
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBarHooks.php
@@ -60,7 +60,7 @@
6161 public static function renderBar( &$article, &$outputDone, &$pcache ) {
6262 $context = $article->getContext();
6363
64 - // Update status of each user who wants to be tracked
 64+ // Update status of all users who wants to be tracked
6565 OnlineStatusBar_StatusCheck::updateStatus();
6666
6767 // Performace fix
@@ -73,7 +73,7 @@
7474 $result = OnlineStatusBar::getUserInfoFromTitle( $title );
7575 // In case that status can't be parsed we check if it isn't anon
7676 if ( $result === false && User::isIP ( $title->getBaseText() ) ) {
77 - $result = OnlineStatusBar::getAnonFromTitle( $title );
 77+ $result = OnlineStatusBar::getAnonFromTitle( $title );
7878 }
7979
8080 // In case we were unable to get a status let's quit

Status & tagging log