about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2022-01-01 09:54:03 +0100
committerGitHub <noreply@github.com>2022-01-01 09:54:03 +0100
commit81d074be73e1416e0d62ccab061eea54457d4a51 (patch)
tree848202d459fd23661974ca3b5f65f5f31f141cfd /src
parenta1e0f1d414fbd25ddf0ddf8d008e8e6c5ac6bbc6 (diff)
parentc5b370bffc1c74749af23d00c74bc96a1ca9fe5d (diff)
downloadprofani-tty-81d074be73e1416e0d62ccab061eea54457d4a51.tar.gz
Merge pull request #1625 from JurajMlich/master
database.c: fix inserting messages to chat logs if archive_id is empty
Diffstat (limited to 'src')
-rw-r--r--src/database.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/database.c b/src/database.c
index c05e3035..6d8e79d4 100644
--- a/src/database.c
+++ b/src/database.c
@@ -328,7 +328,7 @@ _add_to_db(ProfMessage* message, char* type, const Jid* const from_jid, const Ji
         type = (char*)_get_message_type_str(message->type);
     }
 
-    query = sqlite3_mprintf("INSERT INTO `ChatLogs` (`from_jid`, `from_resource`, `to_jid`, `to_resource`, `message`, `timestamp`, `stanza_id`, `archive_id`, `replace_id`, `type`, `encryption`) SELECT '%q', '%q', '%q', '%q', '%q', '%q', '%q', '%q', '%q', '%q', '%q' WHERE NOT EXISTS (SELECT 1 FROM `ChatLogs` WHERE `archive_id` = '%q')",
+    query = sqlite3_mprintf("INSERT INTO `ChatLogs` (`from_jid`, `from_resource`, `to_jid`, `to_resource`, `message`, `timestamp`, `stanza_id`, `archive_id`, `replace_id`, `type`, `encryption`) SELECT '%q', '%q', '%q', '%q', '%q', '%q', '%q', '%q', '%q', '%q', '%q' WHERE NOT EXISTS (SELECT 1 FROM `ChatLogs` WHERE `archive_id` = '%q' AND `archive_id` != '')",
                             from_jid->barejid,
                             from_jid->resourcepart ? from_jid->resourcepart : "",
                             to_jid->barejid,