+ //! Get the unique NetworkId of the network for a user.
+ /** \param user The core user who owns this network
+ * \param network The network name
+ * \return The NetworkId corresponding to the given network, or 0 if not found
+ */
+ virtual NetworkId getNetworkId(UserId user, const QString &network) = 0;
+
+ //! Get a list of Networks to restore
+ /** Return a list of networks the user was connected at the time of core shutdown
+ * \note This method is threadsafe.
+ *
+ * \param user The User Id in question
+ */
+ virtual QList<NetworkId> connectedNetworks(UserId user) = 0;
+
+ //! Update the connected state of a network
+ /** \note This method is threadsafe
+ *
+ * \param user The Id of the networks owner
+ * \param networkId The Id of the network
+ * \param isConnected whether the network is connected or not
+ */
+ virtual void setNetworkConnected(UserId user, const NetworkId &networkId, bool isConnected) = 0;
+
+ //! Get a hash of channels with their channel keys for a given network
+ /** The keys are channel names and values are passwords (possibly empty)
+ * \note This method is threadsafe
+ *
+ * \param user The id of the networks owner
+ * \param networkId The Id of the network
+ */
+ virtual QHash<QString, QString> persistentChannels(UserId user, const NetworkId &networkId) = 0;
+
+ //! Update the connected state of a channel
+ /** \note This method is threadsafe
+ *
+ * \param user The Id of the networks owner
+ * \param networkId The Id of the network
+ * \param channel The name of the channel
+ * \param isJoined whether the channel is connected or not
+ */
+ virtual void setChannelPersistent(UserId user, const NetworkId &networkId, const QString &channel, bool isJoined) = 0;
+
+ //! Update the key of a channel
+ /** \note This method is threadsafe
+ *
+ * \param user The Id of the networks owner
+ * \param networkId The Id of the network
+ * \param channel The name of the channel
+ * \param key The key of the channel (possibly empty)
+ */
+ virtual void setPersistentChannelKey(UserId user, const NetworkId &networkId, const QString &channel, const QString &key) = 0;
+
+ //! retrieve last known away message for session restore
+ /** \note This method is threadsafe
+ *
+ * \param user The Id of the networks owner
+ * \param networkId The Id of the network
+ */
+ virtual QString awayMessage(UserId user, NetworkId networkId) = 0;
+
+ //! Make away message persistent for session restore
+ /** \note This method is threadsafe
+ *
+ * \param user The Id of the networks owner
+ * \param networkId The Id of the network
+ * \param awayMsg The current away message of own user
+ */
+ virtual void setAwayMessage(UserId user, NetworkId networkId, const QString &awayMsg) = 0;
+
+
+ //! retrieve last known user mode for session restore
+ /** \note This method is threadsafe
+ *
+ * \param user The Id of the networks owner
+ * \param networkId The Id of the network
+ */
+ virtual QString userModes(UserId user, NetworkId networkId) = 0;
+
+ //! Make our user modes persistent for session restore
+ /** \note This method is threadsafe
+ *
+ * \param user The Id of the networks owner
+ * \param networkId The Id of the network
+ * \param userModes The current user modes of own user
+ */
+ virtual void setUserModes(UserId user, NetworkId networkId, const QString &userModes) = 0;
+
+
+ /* Buffer handling */
+
+ //! Get the unique BufferInfo for the given combination of network and buffername for a user.
+ /** \param user The core user who owns this buffername
+ * \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
+ * \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) = 0;
+
+ //! Get the unique BufferInfo for a bufferId
+ /** \param user The core user who owns this buffername
+ * \param bufferId The id of the buffer
+ * \return The BufferInfo corresponding to the given buffer id, or an invalid BufferInfo if not found.
+ */
+ virtual BufferInfo getBufferInfo(UserId user, const BufferId &bufferId) = 0;
+
+ //! 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.
+ * \param user The user whose buffers we request
+ * \return A list of the BufferInfos for all buffers as requested
+ */
+ virtual QList<BufferInfo> requestBuffers(UserId user) = 0;
+
+ //! Request a list of BufferIds for a given NetworkId
+ /** \note This method is threadsafe.
+ *
+ * \param user The user whose buffers we request
+ * \param networkId The NetworkId of the network in question
+ * \return List of BufferIds belonging to the Network
+ */
+ virtual QList<BufferId> requestBufferIdsForNetwork(UserId user, NetworkId networkId) = 0;
+
+ //! Remove permanently a buffer and it's content from the storage backend
+ /** This call cannot be reverted!
+ * \param user The user who is the owner of the buffer
+ * \param bufferId The bufferId
+ * \return true if successfull
+ */
+ virtual bool removeBuffer(const UserId &user, const BufferId &bufferId) = 0;
+
+
+ //! Rename a Buffer
+ /** \note This method is threadsafe.
+ * \param user The id of the buffer owner
+ * \param bufferId The bufferId
+ * \param newName The new name of the buffer
+ * \return true if successfull
+ */
+ virtual bool renameBuffer(const UserId &user, const BufferId &bufferId, const QString &newName) = 0;
+
+ //! Merge the content of two Buffers permanently. This cannot be reversed!
+ /** \note This method is threadsafe.
+ * \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
+ */
+ virtual bool mergeBuffersPermanently(const UserId &user, const BufferId &bufferId1, const BufferId &bufferId2) = 0;
+
+ //! Update the LastSeenDate for a Buffer
+ /** This Method is used to make the LastSeenDate of a Buffer persistent
+ * \param user The Owner of that Buffer
+ * \param bufferId The buffer id
+ * \param MsgId The Message id of the message that has been just seen
+ */
+ virtual void setBufferLastSeenMsg(UserId user, const BufferId &bufferId, const MsgId &msgId) = 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
+ */
+ virtual QHash<BufferId, MsgId> bufferLastSeenMsgIds(UserId user) = 0;