X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fpostgresqlstorage.cpp;h=63cb1d0d79b15f3eefd1913e353ee40b8d18439e;hp=e7a71e7bc6ccaf1783f2b7c02a444badfeebc665;hb=35ca85f1c4371ee28d00d5ff0195a5b44aadb299;hpb=a6bcc52535bc584405de447e5fc8dbb63e89c6f4 diff --git a/src/core/postgresqlstorage.cpp b/src/core/postgresqlstorage.cpp index e7a71e7b..63cb1d0d 100644 --- a/src/core/postgresqlstorage.cpp +++ b/src/core/postgresqlstorage.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -944,7 +944,7 @@ void PostgreSqlStorage::setChannelPersistent(UserId user, const NetworkId &netwo QSqlQuery query(logDb()); query.prepare(queryString("update_buffer_persistent_channel")); query.bindValue(":userid", user.toInt()); - query.bindValue(":networkId", networkId.toInt()); + query.bindValue(":networkid", networkId.toInt()); query.bindValue(":buffercname", channel.toLower()); query.bindValue(":joined", isJoined); safeExec(query); @@ -957,7 +957,7 @@ void PostgreSqlStorage::setPersistentChannelKey(UserId user, const NetworkId &ne QSqlQuery query(logDb()); query.prepare(queryString("update_buffer_set_channel_key")); query.bindValue(":userid", user.toInt()); - query.bindValue(":networkId", networkId.toInt()); + query.bindValue(":networkid", networkId.toInt()); query.bindValue(":buffercname", channel.toLower()); query.bindValue(":key", key); safeExec(query); @@ -1601,7 +1601,7 @@ QList PostgreSqlStorage::requestAllMsgs(UserId user, MsgId first, MsgId QDateTime timestamp; for (int i = 0; i < limit && query.next(); i++) { - timestamp = query.value(1).toDateTime(); + timestamp = query.value(2).toDateTime(); timestamp.setTimeSpec(Qt::UTC); Message msg(timestamp, bufferInfoHash[query.value(1).toInt()], @@ -1841,6 +1841,7 @@ bool PostgreSqlMigrationWriter::writeMo(const QuasselUserMO &user) bindValue(0, user.id.toInt()); bindValue(1, user.username); bindValue(2, user.password); + bindValue(3, user.hashversion); return exec(); } @@ -2004,7 +2005,7 @@ bool PostgreSqlMigrationWriter::postProcess() << Sequence("quasseluser", "userid") << Sequence("sender", "senderid"); QList::const_iterator iter; - for (iter = sequences.constBegin(); iter != sequences.constEnd(); iter++) { + for (iter = sequences.constBegin(); iter != sequences.constEnd(); ++iter) { resetQuery(); newQuery(QString("SELECT setval('%1_%2_seq', max(%2)) FROM %1").arg(iter->table, iter->field), db); if (!exec())