X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fabstractsqlstorage.h;h=7f8e38f4b439e813a9256329c33ef7a9b139857f;hb=cb53823eeecff3f033adfe2cb1a48d8b8a89dbae;hp=0cf91b962ee1507a8332986cbde50cea3c7b4aa9;hpb=04315f46a16fc3627218377071e008b6b9744992;p=quassel.git diff --git a/src/core/abstractsqlstorage.h b/src/core/abstractsqlstorage.h index 0cf91b96..7f8e38f4 100644 --- a/src/core/abstractsqlstorage.h +++ b/src/core/abstractsqlstorage.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2013 by the Quassel Project * + * Copyright (C) 2005-2016 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -50,8 +50,24 @@ protected: QSqlDatabase logDb(); - QString queryString(const QString &queryName, int version); - inline QString queryString(const QString &queryName) { return queryString(queryName, 0); } + /** + * Fetch an SQL query string by name and optional schema version + * + * Loads the named SQL query from the built-in SQL resource collection, returning it as a + * string. If a version is specified, it'll be loaded from the schema version-specific folder + * instead. + * + * @see schemaVersion() + * + * @param[in] queryName File name of the SQL query, minus the .sql extension + * @param[in] version + * @parblock + * SQL schema version; if 0, fetches from current version, otherwise loads from the specified + * schema version instead of the current schema files. + * @endparblock + * @return String with the requested SQL query, ready for parameter substitution + */ + QString queryString(const QString &queryName, int version = 0); QStringList setupQueries(); @@ -80,13 +96,14 @@ protected: * When reimplementing this method, don't use logDB() inside this function as * this would cause as we're just about to initialize that DB connection. */ - inline virtual void initDbSession(QSqlDatabase & /* db */) {} + inline virtual bool initDbSession(QSqlDatabase & /* db */) { return true; } private slots: void connectionDestroyed(); private: void addConnectionToPool(); + void dbConnect(QSqlDatabase &db); int _schemaVersion; bool _debug; @@ -130,6 +147,7 @@ public: UserId id; QString username; QString password; + int hashversion; }; struct SenderMO { @@ -186,6 +204,12 @@ public: int autoreconnectretries; bool unlimitedconnectretries; bool rejoinchannels; + // Custom rate limiting + bool usecustommessagerate; + int messagerateburstsize; + int messageratedelay; + bool unlimitedmessagerate; + // ... bool connected; QString usermode; QString awaymessage; @@ -204,6 +228,7 @@ public: QString buffername; QString buffercname; int buffertype; + int lastmsgid; int lastseenmsgid; int markerlinemsgid; QString key; @@ -228,6 +253,7 @@ public: int port; QString password; bool ssl; + bool sslverify; /// If true, validate SSL certificates int sslversion; bool useproxy; int proxytype;