Better fix: just in case, don't use the storage id and use a better search condition.

This commit is contained in:
Guillaume BIENKOWSKI 2014-05-22 14:40:42 +02:00
parent 76a5f51e35
commit 43e42a55f5

View file

@ -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);
}