From 3bf86a5278e26bec5e708a566e6926125f1941f0 Mon Sep 17 00:00:00 2001 From: Michael Marley Date: Tue, 27 Mar 2018 19:41:28 -0400 Subject: [PATCH] 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. --- src/core/postgresqlstorage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/postgresqlstorage.cpp b/src/core/postgresqlstorage.cpp index 955253b7..715442dc 100644 --- a/src/core/postgresqlstorage.cpp +++ b/src/core/postgresqlstorage.cpp @@ -1685,7 +1685,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()], -- 2.20.1