Prevent adding the same address several times in the remote is composing list.

This commit is contained in:
Ghislain MARY 2018-05-18 17:19:40 +02:00
parent 9691218514
commit c327a60318

View file

@ -196,10 +196,13 @@ void ChatRoomPrivate::notifyChatMessageReceived (const shared_ptr<ChatMessage> &
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());