From a9f0cc86f53b3875a614b7f1b353e118815c426f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 26 Dec 2011 19:00:32 +0100 Subject: [PATCH] Set new lastSeen-message --- file/lib/page/ChatMessagePage.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/file/lib/page/ChatMessagePage.class.php b/file/lib/page/ChatMessagePage.class.php index 3bdaf6c..b3b674d 100644 --- a/file/lib/page/ChatMessagePage.class.php +++ b/file/lib/page/ChatMessagePage.class.php @@ -32,6 +32,10 @@ public function readData() { if (!$this->room->canEnter()) throw new \wcf\system\exception\PermissionDeniedException(); $this->messages = chat\message\ChatMessageList::getMessagesSince($this->room, \wcf\util\ChatUtil::readUserData('lastSeen')); + $stmt = WCF::getDB()->prepareStatement("SELECT max(messageID) as messageID FROM wcf".WCF_N."_chat_message"); + $stmt->execute(); + $row = $stmt->fetchArray(); + \wcf\util\ChatUtil::writeUserData(array('lastSeen' => $row['messageID'])); } /**