From 43e42a55f54da89e09d02811f9fcdf21cd4b9f14 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Thu, 22 May 2014 14:40:42 +0200 Subject: [PATCH] Better fix: just in case, don't use the storage id and use a better search condition. --- coreapi/message_storage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coreapi/message_storage.c b/coreapi/message_storage.c index b45b1afb1..3676b5685 100644 --- a/coreapi/message_storage.c +++ b/coreapi/message_storage.c @@ -156,7 +156,8 @@ unsigned int linphone_chat_message_store(LinphoneChatMessage *msg){ void linphone_chat_message_store_state(LinphoneChatMessage *msg){ LinphoneCore *lc=msg->chat_room->lc; if (lc->db){ - char *buf=sqlite3_mprintf("UPDATE history SET status=%i WHERE id = %i;",msg->state,msg->storage_id); + char *buf=sqlite3_mprintf("UPDATE history SET status=%i WHERE (message = %Q OR url = %Q) AND utc = %i;", + msg->state,msg->message,msg->external_body_url,msg->time); linphone_sql_request(lc->db,buf); sqlite3_free(buf); }