r104440 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104439‎ | r104440 | r104441 >
Date:15:25, 28 November 2011
Author:petrb
Status:deferred
Tags:
Comment:
r104435 changed hook to correct one should be faster
Modified paths:
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.php (modified) (history)
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBarHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.php
@@ -113,7 +113,7 @@
114114 $wgOnlineStatusBar_AwayTime = 15;
115115
116116 $wgHooks['LoadExtensionSchemaUpdates'][] = 'OnlineStatusBarHooks::ckSchema';
117 -$wgHooks['UserLogoutComplete'][] = 'OnlineStatusBarHooks::logout';
 117+$wgHooks['UserLogout'][] = 'OnlineStatusBarHooks::logout';
118118 $wgHooks['ArticleViewHeader'][] = 'OnlineStatusBarHooks::renderBar';
119119 $wgHooks['UserLoginComplete'][] = 'OnlineStatusBarHooks::updateStatus';
120120 $wgHooks['GetPreferences'][] = 'OnlineStatusBarHooks::preferencesHook';
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBarHooks.php
@@ -28,15 +28,13 @@
2929 * @param $old_name string
3030 * @return bool
3131 */
32 - public static function logout( &$user, &$inject_html, $old_name ) {
 32+ public static function logout( &$user ) {
3333 global $wgOnlineStatusBarDefaultEnabled;
3434 // check if user had enabled this feature before we write to db
35 - $olduser = User::newFromName( $old_name );
36 - if ( $olduser instanceof User ) {
37 - if ( $olduser->getOption( 'OnlineStatusBar_active', $wgOnlineStatusBarDefaultEnabled ) ) {
38 - OnlineStatusBar::purge( $old_name );
39 - OnlineStatusBar_StatusCheck::deleteStatus( $old_name );
40 - }
 35+ if ( $user->getOption( 'OnlineStatusBar_active', $wgOnlineStatusBarDefaultEnabled ) ) {
 36+ $userName->getName();
 37+ OnlineStatusBar::purge( $userName );
 38+ OnlineStatusBar_StatusCheck::deleteStatus( $userName );
4139 }
4240 return true;
4341 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r104442r104440 fixed typopetrb15:33, 28 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104435Performace - check if previous user had extension enabled before updating db,...petrb15:18, 28 November 2011

Status & tagging log