X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcore.h;h=1288ae01df6920f54d81f4835e41377341e72ecd;hp=277c43ccc8e3f6a13d4b16aa0106582b6e960ce5;hb=52a7b4d0f289f075aa386445a47d876743bcb6d0;hpb=b79832bf9c4c21b05629cfd2fdbd008ad690572f diff --git a/src/core/core.h b/src/core/core.h index 277c43cc..1288ae01 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -26,14 +26,19 @@ #include #include #include -#include + +#ifndef QT_NO_OPENSSL #include +#include "sslserver.h" +#else +#include +#include +#endif #include "bufferinfo.h" #include "message.h" #include "global.h" #include "sessionthread.h" -#include "sslserver.h" #include "types.h" class CoreSession; @@ -54,6 +59,24 @@ class Core : public QObject { /*** Storage access ***/ // These methods are threadsafe. + //! Store a user setting persistently + /** + * \param userId The users Id + * \param settingName The Name of the Setting + * \param data The Value + */ + static void setUserSetting(UserId userId, const QString &settingName, const QVariant &data); + + //! Retrieve a persistent user setting + /** + * \param userId The users Id + * \param settingName The Name of the Setting + * \param default Value to return in case it's unset. + * \return the Value of the Setting or the default value if it is unset. + */ + static QVariant getUserSetting(UserId userId, const QString &settingName, const QVariant &data = QVariant()); + + //! Create a Network in the Storage and store it's Id in the given NetworkInfo /** \note This method is thredsafe. * @@ -202,17 +225,24 @@ class Core : public QObject { */ static QList requestMsgRange(UserId user, BufferId buffer, int first, int last); - //! Request a list of all buffers known to a user since a certain point in time. + //! 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. - * Optionally, a QDateTime can be given, so that only buffers are listed that were active - * since that point in time. * \note This method is threadsafe. * * \param user The user whose buffers we request - * \param since If this is defined, older buffers will be ignored * \return A list of the BufferInfos for all buffers as requested */ - static QList requestBuffers(UserId user, QDateTime since = QDateTime()); + static QList requestBuffers(UserId user); + + + //! 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 + */ + static QList requestBufferIdsForNetwork(UserId user, NetworkId networkId); //! Remove permanently a buffer and it's content from the storage backend /** This call cannot be reverted! @@ -271,7 +301,9 @@ class Core : public QObject { bool initStorage(QVariantMap dbSettings, bool setup = false); +#ifndef QT_NO_OPENSSL void sslErrors(const QList &errors); +#endif void socketError(QAbstractSocket::SocketError); private: