Fix for bug 2285: chatd shows all chat users as present in every chatroom

Should be fixed, but needs testing.
This commit is contained in:
defacer 2004-12-15 07:08:31 +00:00
parent 62faef84c4
commit 548c4e2e55

View file

@ -251,12 +251,14 @@ class ChatDaemon {
echo '</script></head><body style="font-face: serif;" bgcolor="'.$THEME->body.'">';
echo '<table style="width: 100%;"><tbody>';
if(empty($this->sets_info)) {
// No users
echo '<tr><td>&nbsp;</td></tr>';
}
else {
foreach ($this->sets_info as $usersid => $userinfo) {
// Get the users from that chatroom
$users = $this->chatrooms[$info['chatid']]['users'];
foreach ($users as $usersessionid => $userid) {
// Fetch each user's sessionid and then the rest of his data from $this->sets_info
$userinfo = $this->sets_info[$usersessionid];
$lastping = $timenow - $userinfo['chatuser']->lastmessageping;
$popuppar = '\'/user/view.php?id='.$userinfo['user']->id.'&amp;course='.$userinfo['courseid'].'\',\'user'.$userinfo['chatuser']->id.'\',\'\'';
echo '<tr><td width="35">';
@ -271,7 +273,7 @@ class ChatDaemon {
echo "</font></p>";
echo "<td></tr>";
}
}
echo '</tbody></table>';
// About 2K of HTML comments to force browsers to render the HTML