Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php |
— | — | @@ -132,13 +132,15 @@ |
133 | 133 | * @return bool |
134 | 134 | * |
135 | 135 | */ |
136 | | - public static function purge( $userName, $user ) { |
137 | | - if ( $user === null && $userName != null ) { |
| 136 | + public static function purge( $user_type ) { |
| 137 | + if ( is_a( $user_type, User ) ) { |
| 138 | + $old_user = $user; |
| 139 | + } else if ( is_string( $user_type ) ){ |
138 | 140 | $old_user = User::newFromName( $userName ); |
| 141 | + } else { |
| 142 | + return false; |
139 | 143 | } |
140 | | - else { |
141 | | - $old_user = $user; |
142 | | - } |
| 144 | + |
143 | 145 | // check if something weird didn't happen |
144 | 146 | if ( $old_user === false || $old_user == null ) { |
145 | 147 | return true; |
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBarHooks.php |
— | — | @@ -28,8 +28,7 @@ |
29 | 29 | * @return bool |
30 | 30 | */ |
31 | 31 | public static function logout( &$user, &$inject_html, $old_name ) { |
32 | | - // this doesn't work yet |
33 | | - //OnlineStatusBar::purge( $old_name, null ); |
| 32 | + OnlineStatusBar::purge( $old_name, null ); |
34 | 33 | OnlineStatusBar::DeleteStatus( $old_name ); |
35 | 34 | return true; |
36 | 35 | } |