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.
This commit is contained in:
Guillaume BIENKOWSKI 2014-05-22 13:41:46 +02:00
parent fa44718513
commit 76a5f51e35

View file

@ -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