From: Michael Marley Date: Tue, 27 Mar 2018 23:41:28 +0000 (-0400) Subject: PostgreSqlStorage: Fix apparently-incorrect index in requestAllMsgs X-Git-Tag: 0.12.5~10 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=f5cb45a2c5447f0ab5e7b1bccd53c69d192aa3c6 PostgreSqlStorage: Fix apparently-incorrect index in requestAllMsgs This function was using 1 for its date index, which is the same index as was used for bufferid. The correct index to use is 2. Closes GH-346. (cherry picked from commit 3bf86a5278e26bec5e708a566e6926125f1941f0) --- diff --git a/src/core/postgresqlstorage.cpp b/src/core/postgresqlstorage.cpp index acb7f37c..8ee24d4b 100644 --- a/src/core/postgresqlstorage.cpp +++ b/src/core/postgresqlstorage.cpp @@ -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()],