X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcorebacklogmanager.cpp;h=f973adcd62d1e9a28fa1dd93f50349575999bac4;hp=deb2ac99f22a295e528d4d8b755af85f218a6779;hb=HEAD;hpb=6e3574a163f07c28d44276318f2d9f92e169f491 diff --git a/src/core/corebacklogmanager.cpp b/src/core/corebacklogmanager.cpp index deb2ac99..d26d2787 100644 --- a/src/core/corebacklogmanager.cpp +++ b/src/core/corebacklogmanager.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2019 by the Quassel Project * + * Copyright (C) 2005-2022 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -58,7 +58,7 @@ QVariantList CoreBacklogManager::requestBacklog(BufferId bufferId, MsgId first, last = oldestMessage; } - // only fetch additional messages if they continue seemlessly + // only fetch additional messages if they continue seamlessly // that is, if the list of messages is not truncated by the limit if (last == oldestMessage) { msgList = Core::requestMsgs(coreSession()->user(), bufferId, -1, last, additional); @@ -96,7 +96,7 @@ QVariantList CoreBacklogManager::requestBacklogFiltered(BufferId bufferId, MsgId last = oldestMessage; } - // only fetch additional messages if they continue seemlessly + // only fetch additional messages if they continue seamlessly // that is, if the list of messages is not truncated by the limit if (last == oldestMessage) { msgList = Core::requestMsgsFiltered(coreSession()->user(), bufferId, -1, last, additional, Message::Types{type}, Message::Flags{flags}); @@ -109,6 +109,18 @@ QVariantList CoreBacklogManager::requestBacklogFiltered(BufferId bufferId, MsgId return backlog; } +QVariantList CoreBacklogManager::requestBacklogForward(BufferId bufferId, MsgId first, MsgId last, int limit, int type, int flags) +{ + QVariantList backlog; + auto msgList = Core::requestMsgsForward(coreSession()->user(), bufferId, first, last, limit, Message::Types{type}, Message::Flags{flags}); + + std::transform(msgList.cbegin(), msgList.cend(), std::back_inserter(backlog), [](auto&& msg) { + return QVariant::fromValue(msg); + }); + + return backlog; +} + QVariantList CoreBacklogManager::requestBacklogAll(MsgId first, MsgId last, int limit, int additional) { QVariantList backlog;