Skip to content
Browse files

FIx for display of first session, from stable

  • Loading branch information...
1 parent 47162a5 commit 68c3b0779437d808abe0bcaefa39ac5007afadc5 moodler committed Dec 8, 2004
Showing with 6 additions and 1 deletion.
  1. +6 −1 mod/chat/report.php
View
7 mod/chat/report.php
@@ -144,14 +144,19 @@
$sessionusers = array();
$lasttime = 0;
+ $messagesleft = count($messages);
+
foreach ($messages as $message) { // We are walking BACKWARDS through the messages
+
+ $messagesleft --; // Countdown
+
if (!$lasttime) {
$lasttime = $message->timestamp;
}
if (!$sessionend) {
$sessionend = $message->timestamp;
}
- if (($lasttime - $message->timestamp) < $sessiongap) { // Same session
+ if ((($lasttime - $message->timestamp) < $sessiongap) and $messagesleft) { // Same session
if ($message->userid and !$message->system) { // Remember user and count messages
if (empty($sessionusers[$message->userid])) {
$sessionusers[$message->userid] = 1;

0 comments on commit 68c3b07

Please sign in to comment.
Something went wrong with that request. Please try again.