Commit 76a5f51e authored by Guillaume BIENKOWSKI's avatar Guillaume BIENKOWSKI
Browse files

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.
parent fa447185
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment