Fix initial backlog for buffers with no new messages
authorManuel Nickschas <sputnick@quassel-irc.org>
Mon, 21 Sep 2009 08:06:19 +0000 (10:06 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Mon, 21 Sep 2009 08:36:22 +0000 (10:36 +0200)
src/core/corebacklogmanager.cpp

index 1c3fae9..9ef4b89 100644 (file)
@@ -43,8 +43,8 @@ QVariantList CoreBacklogManager::requestBacklog(BufferId bufferId, MsgId first,
     msgIter++;
   }
 
-  if(additional) {
-    MsgId oldestMessage;
+  if(additional && limit != 0) {
+    MsgId oldestMessage = first;
     if(!msgList.isEmpty()) {
       if(msgList.first().msgId() < msgList.last().msgId())
         oldestMessage = msgList.first().msgId();