mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-18 04:38:29 +00:00
Remove empty chatrooms from list if Terminated and empty. This avoid seeing "magic" chatrooms.
This commit is contained in:
parent
b55053f421
commit
90f76471f9
2 changed files with 10 additions and 5 deletions
|
|
@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
## 5.3.4 - 2026-03-31
|
||||
|
||||
### Fixed
|
||||
- Remove old "conf-id" filtering for chat rooms
|
||||
- Remove old "conf-id" filtering for chat rooms.
|
||||
- Remove empty chatrooms if Terminated.
|
||||
|
||||
### Changed
|
||||
- Update SDK to 5.4.102
|
||||
|
|
|
|||
|
|
@ -260,7 +260,8 @@ void TimelineListModel::updateTimelines () {
|
|||
allChatRooms.remove_if([](std::shared_ptr<linphone::ChatRoom> chatRoom){
|
||||
if( ChatRoomModel::isTerminated(chatRoom) && chatRoom->getUnreadMessagesCount() > 0)
|
||||
chatRoom->markAsRead();
|
||||
if(chatRoom->getState() == linphone::ChatRoom::State::Deleted)
|
||||
if(chatRoom->getState() == linphone::ChatRoom::State::Deleted
|
||||
|| (chatRoom->getState() == linphone::ChatRoom::State::Terminated && chatRoom->getHistorySize() == 0))
|
||||
return true;
|
||||
return false;
|
||||
});
|
||||
|
|
@ -411,9 +412,12 @@ 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->getChatRoomModel())
|
||||
timeline->getChatRoomModel()->resetMessageCount();
|
||||
if(state == linphone::ChatRoom::State::Deleted){
|
||||
auto chatRoomModel = timeline->getChatRoomModel();
|
||||
if(chatRoomModel)
|
||||
chatRoomModel->resetMessageCount();
|
||||
if(state == linphone::ChatRoom::State::Deleted
|
||||
|| (state == linphone::ChatRoom::State::Terminated && chatRoomModel && chatRoomModel->getChatRoom()->getHistorySize() == 0)
|
||||
){
|
||||
remove(timeline);// This will call removeRows()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue