cmake: avoid de-duplication of user's CXXFLAGS
[quassel.git] / src / core / corebacklogmanager.cpp
index deb2ac9..d26d278 100644 (file)
@@ -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;