Add a cache for unread messagaes count in LinphoneChatRoom
That fix a performance issue when typing a message. The sqlite database was accessed each time a character was typed in order to mark all preceeding messages as read. That was done even if all message was marked as read. This patch add cache for unread messages count. Then, the count is only carried out at the first call of linphone_chat_room_get_unread_messages_count(). This function is used in linphone_chat_room_mark_as_read() to prevent database from being accessed if all messages are already marked as read.
Showing with 29 additions and 0 deletions