Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php |
— | — | @@ -110,10 +110,23 @@ |
111 | 111 | global $wgOnlineStatusBarModes, $wgOnlineStatusBarDefaultOffline, $wgOnlineStatusBarDefaultOnline, $wgDBname; |
112 | 112 | $dbw = wfGetDB( DB_MASTER ); |
113 | 113 | OnlineStatusBar::DeleteOld(); |
| 114 | + $user = User::newFromName($userID); |
| 115 | + if ($user == null) |
| 116 | + { |
| 117 | + //something is wrong |
| 118 | + return $wgOnlineStatusBarDefaultOffline; |
| 119 | + } |
114 | 120 | $result = $dbw->selectField( 'online_status', 'username', array( 'username' => strtolower($userID) ), __METHOD__, array( 'limit 1', 'order by timestamp desc' ) ); |
115 | 121 | if ( $result ) |
116 | 122 | { |
117 | | - return $wgOnlineStatusBarDefaultOnline; |
| 123 | + $status = $user->getOption("OnlineStatusBar_status"); |
| 124 | + if ($status == null || $status == "") |
| 125 | + { |
| 126 | + return $wgOnlineStatusBarDefaultOnline; |
| 127 | + } else |
| 128 | + { |
| 129 | + return $status; |
| 130 | + } |
118 | 131 | } |
119 | 132 | |
120 | 133 | return $wgOnlineStatusBarDefaultOffline; |