Commit 91352ffc authored by Gautier Pelloux-Prayer's avatar Gautier Pelloux-Prayer
Browse files

message_storage.c: remove invalid assert in linphone_chat_room_delete_message...

message_storage.c: remove invalid assert in linphone_chat_room_delete_message and force recomputation of unread messages count after removal, since database is not synced anymore with chat messages in memory
parent d9a2fb2e
...@@ -417,10 +417,9 @@ void linphone_chat_room_delete_message(LinphoneChatRoom *cr, LinphoneChatMessage ...@@ -417,10 +417,9 @@ void linphone_chat_room_delete_message(LinphoneChatRoom *cr, LinphoneChatMessage
linphone_sql_request(lc->db,buf); linphone_sql_request(lc->db,buf);
sqlite3_free(buf); sqlite3_free(buf);
if(cr->unread_count >= 0 && !msg->is_read) { /* Invalidate unread_count when we modify the database, so that next
assert(cr->unread_count > 0); time we need it it will be recomputed from latest database state */
cr->unread_count--; cr->unread_count = -1;
}
} }
void linphone_chat_room_delete_history(LinphoneChatRoom *cr){ void linphone_chat_room_delete_history(LinphoneChatRoom *cr){
......
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