mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
remove unneded query
This commit is contained in:
parent
83dcbe9014
commit
8d05dfcd2b
@ -36,14 +36,10 @@ public function readMessages() {
|
||||
$this->messages = chat\message\ChatMessageList::getMessagesSince($this->room, \wcf\util\ChatUtil::readUserData('lastSeen'));
|
||||
|
||||
// update last seen message
|
||||
$sql = "SELECT
|
||||
max(messageID) as messageID
|
||||
FROM
|
||||
wcf".WCF_N."_chat_message";
|
||||
$stmt = WCF::getDB()->prepareStatement($sql);
|
||||
$stmt->execute();
|
||||
$row = $stmt->fetchArray();
|
||||
\wcf\util\ChatUtil::writeUserData(array('lastSeen' => $row['messageID']));
|
||||
if (count($this->messages)) {
|
||||
$lastSeen = $this->messages[count($this->messages)-1]->messageID;
|
||||
\wcf\util\ChatUtil::writeUserData(array('lastSeen' => $lastSeen));
|
||||
}
|
||||
}
|
||||
|
||||
public function readRoom() {
|
||||
|
Loading…
Reference in New Issue
Block a user