Permalink
Browse files

If the first chat session was a real one with more than one person, then

the logs for it are now displayed in the list of sessions.
  • Loading branch information...
moodler
moodler committed Dec 8, 2004
1 parent 0970dd6 commit 97152c1b885db569cad337e581cdfd47d8b2df1d
Showing with 6 additions and 1 deletion.
  1. +6 −1 mod/chat/report.php
View
@@ -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 97152c1

Please sign in to comment.