From 3c05d64fb5a761aa1c2d30c8cb47d0bbf05659f1 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 2 Jun 2022 14:42:47 +0200 Subject: [PATCH] Remove conference from Timeline --- linphone-app/src/components/chat-room/ChatRoomModel.cpp | 5 +++-- linphone-app/src/components/chat-room/ChatRoomModel.hpp | 3 +-- linphone-app/src/components/timeline/TimelineListModel.cpp | 7 ++++--- linphone-sdk | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.cpp b/linphone-app/src/components/chat-room/ChatRoomModel.cpp index 444f96154..8a65e0890 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModel.cpp +++ b/linphone-app/src/components/chat-room/ChatRoomModel.cpp @@ -586,7 +586,7 @@ ChatMessageModel * ChatRoomModel::getReply()const{ //------------------------------------------------------------------------------------------------ -void ChatRoomModel::deleteChatRoom(){ +void ChatRoomModel::markAsToDelete(){ mDeleteChatRoom = true; } @@ -864,7 +864,8 @@ void ChatRoomModel::initEntries(){ // callhistory is sorted from newest to oldest int count = 0; for (auto callLog = callHistory.begin() ; count < mFirstLastEntriesStep && callLog != callHistory.end() ; ++callLog, ++count ){ - prepareEntries << EntrySorterHelper((*callLog)->getStartDate(), CallEntry, *callLog); + if(!(*callLog)->wasConference()) + prepareEntries << EntrySorterHelper((*callLog)->getStartDate(), CallEntry, *callLog); } } EntrySorterHelper::getLimitedSelection(&entries, prepareEntries, mFirstLastEntriesStep, this); diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.hpp b/linphone-app/src/components/chat-room/ChatRoomModel.hpp index 00c5a164b..f8723fb4b 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModel.hpp +++ b/linphone-app/src/components/chat-room/ChatRoomModel.hpp @@ -160,8 +160,7 @@ public: void clearFilesToSend(); // Tools - - void deleteChatRoom(); + void markAsToDelete(); Q_INVOKABLE void leaveChatRoom (); Q_INVOKABLE void updateParticipants(const QVariantList& participants); void sendMessage (const QString &message); diff --git a/linphone-app/src/components/timeline/TimelineListModel.cpp b/linphone-app/src/components/timeline/TimelineListModel.cpp index f5824d644..b400ed02a 100644 --- a/linphone-app/src/components/timeline/TimelineListModel.cpp +++ b/linphone-app/src/components/timeline/TimelineListModel.cpp @@ -206,9 +206,10 @@ void TimelineListModel::updateTimelines () { CoreManager *coreManager = CoreManager::getInstance(); std::list> allChatRooms = coreManager->getCore()->getChatRooms(); -// Clean terminated chat rooms. +// Clean terminated chat rooms and conferences from timeline. allChatRooms.remove_if([](std::shared_ptr chatRoom){ - bool toRemove = 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 + || (chatRoom->getConferenceAddress() && chatRoom->getHistoryEventsSize() == 0); if( toRemove) chatRoom->markAsRead(); return toRemove; @@ -278,7 +279,7 @@ void TimelineListModel::removeChatRoomModel(QSharedPointer model) auto timeline = itTimeline->objectCast(); if(timeline->mChatRoomModel == model){ if(model) - model->deleteChatRoom(); + model->markAsToDelete(); remove(*itTimeline); return; }else diff --git a/linphone-sdk b/linphone-sdk index d87b868c2..118f804d7 160000 --- a/linphone-sdk +++ b/linphone-sdk @@ -1 +1 @@ -Subproject commit d87b868c2ebdeb9a634dfdfd2325412ff9604100 +Subproject commit 118f804d7d74e04cd4b2a20a53ebf029b5124c02