1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-10-31 14:10:08 +00:00

Fix CHAT_LASTMESSAGES === 0

This commit is contained in:
Tim Düsterhus 2013-06-23 18:46:52 +03:00
parent b9187bfb6d
commit e0859c5952

View File

@ -24,6 +24,8 @@ class MessageList extends \wcf\data\DatabaseObjectList {
* @return array<\chat\data\message\Message> * @return array<\chat\data\message\Message>
*/ */
public static function getNewestMessages(\chat\data\room\Room $room, $number = CHAT_LASTMESSAGES) { public static function getNewestMessages(\chat\data\room\Room $room, $number = CHAT_LASTMESSAGES) {
if ($number === 0) return array();
$messageList = new static(); $messageList = new static();
$messageList->sqlOrderBy = "message.messageID DESC"; $messageList->sqlOrderBy = "message.messageID DESC";
$messageList->sqlLimit = $number; $messageList->sqlLimit = $number;