From 76a5f51e35a14778da2fc5ab9b0ce49186099e7e Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Thu, 22 May 2014 13:41:46 +0200 Subject: [PATCH] Use storage id for storing the message state, instead of filtering by message and time. This was historically used because notifications of the new message state would supposedly be made with a new instance of the same message, so without a correct storage_id. I verified that this is not the case anymore. --- coreapi/message_storage.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/coreapi/message_storage.c b/coreapi/message_storage.c index 5a66393f4..b45b1afb1 100644 --- a/coreapi/message_storage.c +++ b/coreapi/message_storage.c @@ -156,12 +156,9 @@ 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 message = %Q AND utc = %i;", - msg->state,msg->message,msg->time); - linphone_sql_request(lc->db,buf); + char *buf=sqlite3_mprintf("UPDATE history SET status=%i WHERE id = %i;",msg->state,msg->storage_id); + linphone_sql_request(lc->db,buf); sqlite3_free(buf); - - } if( msg->state == LinphoneChatMessageStateDelivered