Remove video conference chat rooms from timeline (not implemented yet)

This commit is contained in:
Julien Wadel 2022-09-06 11:40:11 +02:00
parent e96c2044da
commit e5d5a9c0e8
4 changed files with 14 additions and 5 deletions

View file

@ -166,7 +166,7 @@ ContactModel *CallModel::getContactModel() const{
}
ChatRoomModel * CallModel::getChatRoomModel(){
if(mCall && mCall->getCallLog()->getCallId() != "" ){
if(mCall && mCall->getCallLog()->getCallId() != "" && !isConference()){// No chat rooms for conference (TODO)
auto currentParams = mCall->getCurrentParams();
bool isEncrypted = currentParams->getMediaEncryption() != linphone::MediaEncryption::None;
SettingsModel * settingsModel = CoreManager::getInstance()->getSettingsModel();

View file

@ -409,6 +409,10 @@ bool ChatRoomModel::haveEncryption() const{
return mChatRoom && mChatRoom->getCurrentParams()->getEncryptionBackend() != linphone::ChatRoomEncryptionBackend::None;
}
bool ChatRoomModel::haveConferenceAddress() const{
return mChatRoom && (mChatRoom->getConferenceAddress() || getFullPeerAddress().toLower().contains("conf-id"));
}
bool ChatRoomModel::markAsReadEnabled() const{
return mMarkAsReadEnabled;
}

View file

@ -121,6 +121,7 @@ public:
long getEphemeralLifetime() const;
bool canBeEphemeral();
bool haveEncryption() const;
bool haveConferenceAddress() const;
bool markAsReadEnabled() const;
Q_INVOKABLE bool isSecure() const;
int getSecurityLevel() const;

View file

@ -264,10 +264,14 @@ void TimelineListModel::updateTimelines () {
}
void TimelineListModel::add (QSharedPointer<TimelineModel> timeline){
connect(timeline->getChatRoomModel(), &ChatRoomModel::lastUpdateTimeChanged, this, &TimelineListModel::updated);
ProxyListModel::add(timeline);
emit layoutChanged();
emit countChanged();
auto chatRoomModel = timeline->getChatRoomModel();
auto chatRoom = chatRoomModel->getChatRoom();
if( !chatRoomModel->haveConferenceAddress() || chatRoom->getHistoryEventsSize() != 0) {
connect(chatRoomModel, &ChatRoomModel::lastUpdateTimeChanged, this, &TimelineListModel::updated);
ProxyListModel::add(timeline);
emit layoutChanged();
emit countChanged();
}
}
void TimelineListModel::removeChatRoomModel(QSharedPointer<ChatRoomModel> model){