Small optimization
authorMarcel Werk <burntime@woltlab.com>
Mon, 18 Mar 2013 20:22:00 +0000 (21:22 +0100)
committerMarcel Werk <burntime@woltlab.com>
Mon, 18 Mar 2013 20:22:00 +0000 (21:22 +0100)
files/lib/page/ConversationPage.class.php

index 015d7ea559a345ca47fb37ae92be4104c20aebc6..603bc69b3b6608b7cc6885620673b3aece636fe5 100644 (file)
@@ -171,7 +171,9 @@ class ConversationPage extends MultipleLinkPage {
                
                // update last visit time count
                if ($this->conversation->isNew() && $this->objectList->getMaxPostTime() > $this->conversation->lastVisitTime) {
-                       $conversationAction = new ConversationAction(array($this->conversation->getDecoratedObject()), 'markAsRead', array('visitTime' => $this->objectList->getMaxPostTime()));
+                       $visitTime = $this->objectList->getMaxPostTime();
+                       if ($visitTime == $this->conversation->lastPostTime) $visitTime = TIME_NOW;
+                       $conversationAction = new ConversationAction(array($this->conversation->getDecoratedObject()), 'markAsRead', array('visitTime' => $visitTime));
                        $conversationAction->executeAction();
                }