From 418a2cfe247cd1fd9dcb2a07166b1f6341857771 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 24 Nov 2017 15:48:30 +0100 Subject: [PATCH] Fixed outgoing file contents storage fetch --- src/db/main-db.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/db/main-db.cpp b/src/db/main-db.cpp index 092f8c56d..96610b9e1 100644 --- a/src/db/main-db.cpp +++ b/src/db/main-db.cpp @@ -404,11 +404,11 @@ MainDb::MainDb (const shared_ptr &core) : AbstractDb(*new MainDbPrivate), // 2 - Fetch contents. { soci::session *session = dbSession.getBackendSession(); - const string query = "SELECT content_type.id, content_type.value, body FROM chat_message_content, content_type" + const string query = "SELECT chat_message_content.id, content_type.id, content_type.value, body FROM chat_message_content, content_type" " WHERE event_id = :eventId AND content_type_id = content_type.id"; soci::rowset rows = (session->prepare << query, soci::use(eventId)); for (const auto &row : rows) { - ContentType contentType(row.get(1)); + ContentType contentType(row.get(2)); Content *content; if (contentType == ContentType::FileTransfer)