X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcore.h;h=e6ee9d899408eeef51f26d3c63c19c6e93635443;hb=145a52eb79fed146731f85c23b60f0609e40e785;hp=2df19475538da7aa02e43c13c4f5fe579a838f67;hpb=6e3574a163f07c28d44276318f2d9f92e169f491;p=quassel.git diff --git a/src/core/core.h b/src/core/core.h index 2df19475..e6ee9d89 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2019 by the Quassel Project * + * Copyright (C) 2005-2020 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -27,19 +27,11 @@ #include #include +#include #include #include #include -#ifdef HAVE_SSL -# include - -# include "sslserver.h" -#else -# include -# include -#endif - #include "authenticator.h" #include "bufferinfo.h" #include "deferredptr.h" @@ -49,6 +41,7 @@ #include "oidentdconfiggenerator.h" #include "sessionthread.h" #include "singleton.h" +#include "sslserver.h" #include "storage.h" #include "types.h" @@ -431,6 +424,26 @@ public: return instance()->_storage->requestMsgsFiltered(user, bufferId, first, last, limit, type, flags); } + //! Request a certain number messages stored in a given buffer, matching certain filters, ascending + /** \param buffer The buffer we request messages from + * \param first if != -1 return only messages with a MsgId >= first + * \param last if != -1 return only messages with a MsgId < last + * \param limit if != -1 limit the returned list to a max of \limit entries + * \param type The Message::Types that should be returned + * \param flags The Message::Flags that should be returned + * \return The requested list of messages + */ + static inline std::vector requestMsgsForward(UserId user, + BufferId bufferId, + MsgId first = -1, + MsgId last = -1, + int limit = -1, + Message::Types type = Message::Types{-1}, + Message::Flags flags = Message::Flags{-1}) + { + return instance()->_storage->requestMsgsForward(user, bufferId, first, last, limit, type, flags); + } + //! Request a certain number of messages across all buffers /** \param first if != -1 return only messages with a MsgId >= first * \param last if != -1 return only messages with a MsgId < last @@ -536,6 +549,14 @@ public: */ QString strictSysIdent(UserId user) const; + //! Get a Hash of all last message ids + /** This Method is called when the Quassel Core is started to restore the lastMsgIds + * \note This method is threadsafe. + * + * \param user The Owner of the buffers + */ + static inline QHash bufferLastMsgIds(UserId user) { return instance()->_storage->bufferLastMsgIds(user); } + //! Get a Hash of all last seen message ids /** This Method is called when the Quassel Core is started to restore the lastSeenMsgIds * \note This method is threadsafe. @@ -773,11 +794,7 @@ private: QTimer _storageSyncTimer; -#ifdef HAVE_SSL SslServer _server, _v6server; -#else - QTcpServer _server, _v6server; -#endif OidentdConfigGenerator* _oidentdConfigGenerator{nullptr};