Fix multiple compose (can show when killing remote while composing)

This commit is contained in:
Julien Wadel 2021-08-09 16:45:06 +02:00
parent 89e976f649
commit 7e12a3d5d5

View file

@ -771,13 +771,12 @@ void ChatRoomModel::handlePresenceStatusReceived(std::shared_ptr<linphone::Frien
//----------------------------------------------------------
void ChatRoomModel::onIsComposingReceived(const std::shared_ptr<linphone::ChatRoom> & chatRoom, const std::shared_ptr<const linphone::Address> & remoteAddress, bool isComposing){
if(!isComposing) {
auto it = mComposers.begin();
while(it != mComposers.end() && !it.key()->weakEqual(remoteAddress))
++it;
if(it != mComposers.end())
mComposers.erase(it);
}else
auto it = mComposers.begin();
while(it != mComposers.end() && !it.key()->weakEqual(remoteAddress))
++it;
if(it != mComposers.end())
mComposers.erase(it);
if(isComposing)
mComposers[remoteAddress] = Utils::getDisplayName(remoteAddress);
emit isRemoteComposingChanged();
setLastUpdateTime(QDateTime::fromMSecsSinceEpoch(chatRoom->getLastUpdateTime()));