From: Marcus Eggenberger Date: Thu, 25 Dec 2008 15:16:55 +0000 (+0100) Subject: applying new server definitions to storage backend X-Git-Tag: 0.4.0~337 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=d747c2060a17ddc24dcc83d6a7aa87066765c9dc applying new server definitions to storage backend --- diff --git a/src/core/SQL/SQLite/12/insert_server.sql b/src/core/SQL/SQLite/12/insert_server.sql index 1a1d4bc9..d9605ebd 100644 --- a/src/core/SQL/SQLite/12/insert_server.sql +++ b/src/core/SQL/SQLite/12/insert_server.sql @@ -1,2 +1,2 @@ -INSERT INTO ircserver (userid, networkid, hostname, port, password, ssl) -VALUES (:userid, :networkid, :hostname, :port, :password, :ssl) +INSERT INTO ircserver (userid, networkid, hostname, port, password, ssl, sslversion, useproxy, proxytype, proxyhost, proxyport, proxyuser, proxypass) +VALUES (:userid, :networkid, :hostname, :port, :password, :ssl, :sslversion, :useproxy, :proxytype, :proxyhost, :proxyport, :proxyuser, :proxypass) diff --git a/src/core/SQL/SQLite/12/select_servers_for_network.sql b/src/core/SQL/SQLite/12/select_servers_for_network.sql index a8fb64fc..d6b5cf46 100644 --- a/src/core/SQL/SQLite/12/select_servers_for_network.sql +++ b/src/core/SQL/SQLite/12/select_servers_for_network.sql @@ -1,3 +1,3 @@ -SELECT hostname, port, password, ssl +SELECT hostname, port, password, ssl, sslversion, useproxy, proxytype, proxyhost, proxyport, proxyuser, proxypass FROM ircserver WHERE networkid = :networkid diff --git a/src/core/SQL/SQLite/12/setup_080_ircservers.sql b/src/core/SQL/SQLite/12/setup_080_ircservers.sql index 68737263..3c8239e3 100644 --- a/src/core/SQL/SQLite/12/setup_080_ircservers.sql +++ b/src/core/SQL/SQLite/12/setup_080_ircservers.sql @@ -6,7 +6,7 @@ CREATE TABLE ircserver ( port INTEGER NOT NULL DEFAULT 6667, password TEXT, ssl INTEGER NOT NULL DEFAULT 0, -- bool - sslVersion INTEGER NOT NULL DEFAULT 0, + sslversion INTEGER NOT NULL DEFAULT 0, useproxy INTEGER NOT NULL DEFAULT 0, -- bool proxytype INTEGER NOT NULL DEFAULT 0, proxyhost TEXT NOT NULL DEFAULT 'localhost', diff --git a/src/core/SQL/SQLite/12/upgrade_030_create_ircserver.sql b/src/core/SQL/SQLite/12/upgrade_030_create_ircserver.sql index 68737263..3c8239e3 100644 --- a/src/core/SQL/SQLite/12/upgrade_030_create_ircserver.sql +++ b/src/core/SQL/SQLite/12/upgrade_030_create_ircserver.sql @@ -6,7 +6,7 @@ CREATE TABLE ircserver ( port INTEGER NOT NULL DEFAULT 6667, password TEXT, ssl INTEGER NOT NULL DEFAULT 0, -- bool - sslVersion INTEGER NOT NULL DEFAULT 0, + sslversion INTEGER NOT NULL DEFAULT 0, useproxy INTEGER NOT NULL DEFAULT 0, -- bool proxytype INTEGER NOT NULL DEFAULT 0, proxyhost TEXT NOT NULL DEFAULT 'localhost', diff --git a/src/core/sqlitestorage.cpp b/src/core/sqlitestorage.cpp index 054b3899..a418d055 100644 --- a/src/core/sqlitestorage.cpp +++ b/src/core/sqlitestorage.cpp @@ -416,12 +416,19 @@ bool SqliteStorage::updateNetwork(UserId user, const NetworkInfo &info) { QSqlQuery insertServersQuery(logDb()); insertServersQuery.prepare(queryString("insert_server")); foreach(Network::Server server, info.serverList) { + insertServersQuery.bindValue(":userid", user.toInt()); + insertServersQuery.bindValue(":networkid", info.networkId.toInt()); insertServersQuery.bindValue(":hostname", server.host); insertServersQuery.bindValue(":port", server.port); insertServersQuery.bindValue(":password", server.password); insertServersQuery.bindValue(":ssl", server.useSsl ? 1 : 0); - insertServersQuery.bindValue(":userid", user.toInt()); - insertServersQuery.bindValue(":networkid", info.networkId.toInt()); + insertServersQuery.bindValue(":sslversion", server.sslVersion); + insertServersQuery.bindValue(":useproxy", server.useProxy ? 1 : 0); + insertServersQuery.bindValue(":proxytype", server.proxyType); + insertServersQuery.bindValue(":proxyhost", server.proxyHost); + insertServersQuery.bindValue(":proxyport", server.proxyPort); + insertServersQuery.bindValue(":proxyuser", server.proxyUser); + insertServersQuery.bindValue(":proxypass", server.proxyPass); safeExec(insertServersQuery); if(!watchQuery(insertServersQuery)) @@ -533,6 +540,13 @@ QList SqliteStorage::networks(UserId user) { server.port = serversQuery.value(1).toUInt(); server.password = serversQuery.value(2).toString(); server.useSsl = serversQuery.value(3).toInt() == 1 ? true : false; + server.sslVersion = serversQuery.value(4).toInt(); + server.useProxy = serversQuery.value(5).toInt() == 1 ? true : false; + server.proxyType = serversQuery.value(6).toInt(); + server.proxyHost = serversQuery.value(7).toString(); + server.proxyPort = serversQuery.value(8).toUInt(); + server.proxyUser = serversQuery.value(9).toString(); + server.proxyPass = serversQuery.value(10).toString(); servers << server; } net.serverList = servers;