mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-02-03 04:39:24 +00:00
Fix unread messages on terminated/Deleted chat room
This commit is contained in:
parent
254119a100
commit
4a786dd481
1 changed files with 9 additions and 2 deletions
|
|
@ -244,7 +244,10 @@ void TimelineListModel::updateTimelines () {
|
|||
|
||||
// Clean terminated chat rooms.
|
||||
allChatRooms.remove_if([](std::shared_ptr<linphone::ChatRoom> chatRoom){
|
||||
return chatRoom->getState() == linphone::ChatRoom::State::Terminated || chatRoom->getState() == linphone::ChatRoom::State::Deleted;
|
||||
bool toRemove = chatRoom->getState() == linphone::ChatRoom::State::Terminated || chatRoom->getState() == linphone::ChatRoom::State::Deleted;
|
||||
if( toRemove)
|
||||
chatRoom->markAsRead();
|
||||
return toRemove;
|
||||
});
|
||||
|
||||
//Remove no more chat rooms
|
||||
|
|
@ -294,6 +297,7 @@ void TimelineListModel::updateTimelines () {
|
|||
}
|
||||
}
|
||||
}
|
||||
CoreManager::getInstance()->updateUnreadMessageCount();
|
||||
}
|
||||
|
||||
void TimelineListModel::add (std::shared_ptr<TimelineModel> timeline){
|
||||
|
|
@ -349,8 +353,11 @@ void TimelineListModel::onChatRoomStateChanged(const std::shared_ptr<linphone::C
|
|||
}
|
||||
}else if(state == linphone::ChatRoom::State::Deleted || state == linphone::ChatRoom::State::Terminated){
|
||||
auto timeline = getTimeline(chatRoom, false);
|
||||
if(timeline)
|
||||
if(timeline) {
|
||||
if(timeline->getChatRoomModel())
|
||||
timeline->getChatRoomModel()->resetMessageCount();
|
||||
remove(timeline);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue