X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcore.h;h=0814e7c2f6825d21236084876381130221b0c9ad;hp=640ba18d96475b52d0d7a848cb0f940bd26d874b;hb=b9169a652a6854b3fa85aee8f833cb9e18a8d510;hpb=b8d7e647bca45cba82db5fa38c58f336aefe5768 diff --git a/src/core/core.h b/src/core/core.h index 640ba18d..0814e7c2 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -429,6 +429,22 @@ public: } + //! Request a certain number messages stored in a given buffer, matching certain filters + /** \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 + * \return The requested list of messages + */ + static inline QList requestMsgsFiltered(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->requestMsgsFiltered(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 @@ -441,6 +457,21 @@ public: } + //! Request a certain number of messages across all buffers, matching certain filters + /** \param first if != -1 return only messages with a MsgId >= first + * \param last if != -1 return only messages with a MsgId < last + * \param limit Max amount of messages + * \param type The Message::Types that should be returned + * \return The requested list of messages + */ + static inline QList requestAllMsgsFiltered(UserId user, MsgId first = -1, MsgId last = -1, int limit = -1, + Message::Types type = Message::Types{-1}, + Message::Flags flags = Message::Flags{-1}) + { + return instance()->_storage->requestAllMsgsFiltered(user, first, last, limit, type, flags); + } + + //! Request a list of all buffers known to a user. /** This method is used to get a list of all buffers we have stored a backlog from. * \note This method is threadsafe.