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'));
|
$this->messages = chat\message\ChatMessageList::getMessagesSince($this->room, \wcf\util\ChatUtil::readUserData('lastSeen'));
|
||||||
|
|
||||||
// update last seen message
|
// update last seen message
|
||||||
$sql = "SELECT
|
if (count($this->messages)) {
|
||||||
max(messageID) as messageID
|
$lastSeen = $this->messages[count($this->messages)-1]->messageID;
|
||||||
FROM
|
\wcf\util\ChatUtil::writeUserData(array('lastSeen' => $lastSeen));
|
||||||
wcf".WCF_N."_chat_message";
|
}
|
||||||
$stmt = WCF::getDB()->prepareStatement($sql);
|
|
||||||
$stmt->execute();
|
|
||||||
$row = $stmt->fetchArray();
|
|
||||||
\wcf\util\ChatUtil::writeUserData(array('lastSeen' => $row['messageID']));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function readRoom() {
|
public function readRoom() {
|
||||||
|
Loading…
Reference in New Issue
Block a user