From c327a60318a41851a32c1280ae86e109f3c5d15b Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 18 May 2018 17:19:40 +0200 Subject: [PATCH] Prevent adding the same address several times in the remote is composing list. --- src/chat/chat-room/chat-room.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/chat/chat-room/chat-room.cpp b/src/chat/chat-room/chat-room.cpp index 6b70da34d..aaecdf469 100644 --- a/src/chat/chat-room/chat-room.cpp +++ b/src/chat/chat-room/chat-room.cpp @@ -196,10 +196,13 @@ void ChatRoomPrivate::notifyChatMessageReceived (const shared_ptr & void ChatRoomPrivate::notifyIsComposingReceived (const Address &remoteAddress, bool isComposing) { L_Q(); - if (isComposing) - remoteIsComposing.push_back(remoteAddress); - else + if (isComposing) { + auto it = find(remoteIsComposing.cbegin(), remoteIsComposing.cend(), remoteAddress); + if (it == remoteIsComposing.cend()) + remoteIsComposing.push_back(remoteAddress); + } else { remoteIsComposing.remove(remoteAddress); + } LinphoneChatRoom *cr = getCChatRoom(); LinphoneAddress *lAddr = linphone_address_new(remoteAddress.asString().c_str());