X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fstorage.h;h=5d47c097fa23d465cb3e56a5c5816f53deb3865b;hp=b49aee0ac3047d07de0d4989eed066ad0b0fd5af;hb=HEAD;hpb=7168c6adaa3cd2be160aa1731c7444dc384a4a98 diff --git a/src/core/storage.h b/src/core/storage.h index b49aee0a..ecf90732 100644 --- a/src/core/storage.h +++ b/src/core/storage.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2020 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 * @@ -45,7 +45,7 @@ public: { IsReady, // ready to go NeedsSetup, // need basic setup (ask the user for input) - NotAvailable // remove the storage backend from the list of avaliable backends + NotAvailable // remove the storage backend from the list of available backends }; enum HashVersion @@ -56,7 +56,6 @@ public: }; -public slots: /* General */ //! Check if the storage type is available. @@ -108,7 +107,7 @@ public slots: //! Makes temp data persistent /** This Method is periodically called by the Quassel Core to make temporary - * data persistant. This reduces the data loss drastically in the + * data persistent. This reduces the data loss drastically in the * unlikely case of a Core crash. */ virtual void sync() = 0; @@ -215,7 +214,7 @@ public slots: /** * \param user The core user * \param networkInfo The Updated NetworkInfo - * \return true if successfull. + * \return true if successful. */ virtual bool updateNetwork(UserId user, const NetworkInfo& info) = 0; @@ -224,7 +223,7 @@ public slots: * * \param user The core user * \param networkId The network to delete - * \return true if successfull. + * \return true if successful. */ virtual bool removeNetwork(UserId user, const NetworkId& networkId) = 0; @@ -323,7 +322,7 @@ public slots: * \param networkId The network id * \param type The type of the buffer (StatusBuffer, Channel, etc.) * \param buffer The buffer name (if empty, the net's status buffer is returned) - * \param create Whether or not the buffer should be created if it doesnt exist + * \param create Whether or not the buffer should be created if it doesn't exist * \return The BufferInfo corresponding to the given network and buffer name, or an invalid BufferInfo if not found */ virtual BufferInfo bufferInfo(UserId user, const NetworkId& networkId, BufferInfo::Type type, const QString& buffer = "", bool create = true) @@ -356,7 +355,7 @@ public slots: /** This call cannot be reverted! * \param user The user who is the owner of the buffer * \param bufferId The bufferId - * \return true if successfull + * \return true if successful */ virtual bool removeBuffer(const UserId& user, const BufferId& bufferId) = 0; @@ -365,7 +364,7 @@ public slots: * \param user The id of the buffer owner * \param bufferId The bufferId * \param newName The new name of the buffer - * \return true if successfull + * \return true if successful */ virtual bool renameBuffer(const UserId& user, const BufferId& bufferId, const QString& newName) = 0; @@ -374,7 +373,7 @@ public slots: * \param user The id of the buffer owner * \param bufferId1 The bufferId of the remaining buffer * \param bufferId2 The buffer that is about to be removed - * \return true if successfull + * \return true if successful */ virtual bool mergeBuffersPermanently(const UserId& user, const BufferId& bufferId1, const BufferId& bufferId2) = 0; @@ -386,6 +385,12 @@ public slots: */ virtual void setBufferLastSeenMsg(UserId user, const BufferId& bufferId, const MsgId& msgId) = 0; + //! Get a Hash of all last message ids + /** This Method is called when the Quassel Core is started to restore the lastMsgIds + * \param user The Owner of the buffers + */ + virtual QHash bufferLastMsgIds(UserId user) = 0; + //! Get a Hash of all last seen message ids /** This Method is called when the Quassel Core is started to restore the lastSeenMsgIds * \param user The Owner of the buffers @@ -522,6 +527,23 @@ public slots: Message::Types type = Message::Types{-1}, Message::Flags flags = Message::Flags{-1}) = 0; + //! 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 + */ + virtual 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}) = 0; + //! 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