From a4109f7c4f5941cecf18b6dcbfcd6dafba187c98 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 25 Jan 2017 11:39:48 +0100 Subject: [PATCH] When marking a chat room as read send IM display notifications only for the messages that were not previously in the displayed state. --- coreapi/message_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/message_storage.c b/coreapi/message_storage.c index ab9fedbe9..262a6b669 100644 --- a/coreapi/message_storage.c +++ b/coreapi/message_storage.c @@ -385,7 +385,7 @@ void linphone_chat_room_mark_as_read(LinphoneChatRoom *cr){ if(linphone_chat_room_get_unread_messages_count(cr) == 0) return; peer=linphone_address_as_string_uri_only(linphone_chat_room_get_peer_address(cr)); - buf = sqlite3_mprintf("SELECT * FROM history WHERE remoteContact = %Q AND direction=%i", peer, LinphoneChatMessageIncoming); + buf = sqlite3_mprintf("SELECT * FROM history WHERE remoteContact = %Q AND direction = %i AND status != %i", peer, LinphoneChatMessageIncoming, LinphoneChatMessageStateDisplayed); linphone_sql_request_message(lc->db, buf, cr); sqlite3_free(buf); for (item = cr->messages_hist; item != NULL; item = bctbx_list_next(item)) {