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

This commit is contained in:
Gautier Pelloux-Prayer 2015-11-18 13:27:35 +01:00
parent d9a2fb2e08
commit 91352ffccd

View file

@ -417,10 +417,9 @@ void linphone_chat_room_delete_message(LinphoneChatRoom *cr, LinphoneChatMessage
linphone_sql_request(lc->db,buf);
sqlite3_free(buf);
if(cr->unread_count >= 0 && !msg->is_read) {
assert(cr->unread_count > 0);
cr->unread_count--;
}
/* Invalidate unread_count when we modify the database, so that next
time we need it it will be recomputed from latest database state */
cr->unread_count = -1;
}
void linphone_chat_room_delete_history(LinphoneChatRoom *cr){