X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcorebacklogmanager.cpp;h=9ef4b8990e2279fbe46b8c29c38e7e62dda710ef;hp=39feb2ab66a65b66d09f964c358867c2efc09038;hb=5ff4265bbd3a682a6d6542480760eaf4a2b85d77;hpb=6411b0f9a71708b58c8d5ba00bf59d1062267470 diff --git a/src/core/corebacklogmanager.cpp b/src/core/corebacklogmanager.cpp index 39feb2ab..9ef4b899 100644 --- a/src/core/corebacklogmanager.cpp +++ b/src/core/corebacklogmanager.cpp @@ -24,6 +24,7 @@ #include +INIT_SYNCABLE_OBJECT(CoreBacklogManager) CoreBacklogManager::CoreBacklogManager(CoreSession *coreSession) : BacklogManager(coreSession), _coreSession(coreSession) @@ -42,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(); @@ -57,9 +58,9 @@ QVariantList CoreBacklogManager::requestBacklog(BufferId bufferId, MsgId first, last = oldestMessage; } - // only fetch additional messages if they they continue seemlessly + // only fetch additional messages if they continue seemlessly // that is, if the list of messages is not truncated by the limit - if(last.isValid() && last == oldestMessage) { + if(last == oldestMessage) { msgList = Core::requestMsgs(coreSession()->user(), bufferId, -1, last, additional); msgIter = msgList.constBegin(); msgListEnd = msgList.constEnd(); @@ -74,7 +75,6 @@ QVariantList CoreBacklogManager::requestBacklog(BufferId bufferId, MsgId first, } QVariantList CoreBacklogManager::requestBacklogAll(MsgId first, MsgId last, int limit, int additional) { - qDebug() << "CoreBacklogManager::requestBacklogAll" << first << last << limit << additional; QVariantList backlog; QList msgList; msgList = Core::requestAllMsgs(coreSession()->user(), first, last, limit);