Remove deprecated proxy while accepting a call.

Fix filtering non-empty terminated chat rooms.
Recreate a new chat room if trying to create one that already exist in terminated state.
Fix creating an unscheduled video conference.
Remove description form from unscheduled video conference.
Fix white color on call quality.
This commit is contained in:
Julien Wadel 2022-06-13 12:32:21 +02:00
parent 39ca09d353
commit b39f7b014c
13 changed files with 45 additions and 28 deletions

View file

@ -3369,7 +3369,7 @@ Clicca: <a href="%1">%1</a>
<message>
<source>cancelButton</source>
<extracomment>&apos;Cancel&apos; : Cancel button.</extracomment>
<translation type="unfinished"></translation>
<translation type="unfinished">ANNULLA</translation>
</message>
<message>
<source>startButton</source>

View file

@ -501,10 +501,9 @@ void CallModel::accept (bool withVideo) {
params->enableVideo(withVideo);
setRecordFile(params);
auto localAddress = mCall->getCallLog()->getLocalAddress();
std::list<std::shared_ptr<linphone::ProxyConfig>> proxies = core->getProxyConfigList() ;
for(auto proxy : proxies){
if(proxy->getIdentityAddress()->weakEqual(localAddress)) {
params->setProxyConfig(proxy);
for(auto account : core->getAccountList()){
if( account->getParams()->getIdentityAddress()->weakEqual(localAddress)){
params->setAccount(account);
break;
}
}

View file

@ -323,11 +323,16 @@ QVariantMap CallsListModel::createChatRoom(const QString& subject, const int& se
chatRoom = core->searchChatRoom(params, localAddress
, nullptr
, chatRoomParticipants);
if(chatRoom && ChatRoomModel::isTerminated(chatRoom))
chatRoom = nullptr;
params->setSubject(subject != ""?Utils::appStringToCoreString(subject):"Dummy Subject");
if(!chatRoom)
chatRoom = core->searchChatRoom(params, localAddress
, nullptr
, chatRoomParticipants);
if(chatRoom && ChatRoomModel::isTerminated(chatRoom))
chatRoom = nullptr;
}else
params->setSubject(subject != ""?Utils::appStringToCoreString(subject):"Dummy Subject");
if( !chatRoom) {

View file

@ -849,6 +849,10 @@ int ChatRoomModel::loadTillMessage(ChatMessageModel * message){
return -1;
}
bool ChatRoomModel::isTerminated(const std::shared_ptr<linphone::ChatRoom>& chatRoom){
return chatRoom->getState() == linphone::ChatRoom::State::Terminated || chatRoom->getState() == linphone::ChatRoom::State::Deleted;
}
void ChatRoomModel::initEntries(){
if( mList.size() > mLastEntriesStep)
resetData();

View file

@ -173,6 +173,7 @@ public:
void callEnded(std::shared_ptr<linphone::Call> call);
void updateNewMessageNotice(const int& count);
Q_INVOKABLE int loadTillMessage(ChatMessageModel * message);// Load all entries till message and return its index. -1 if not found.
static bool isTerminated(const std::shared_ptr<linphone::ChatRoom>& chatRoom);
QDateTime mLastUpdateTime;
int mUnreadMessagesCount = 0;

View file

@ -52,6 +52,9 @@ void ConferenceListener::onParticipantRemoved(const std::shared_ptr<linphone::Co
void ConferenceListener::onParticipantDeviceAdded(const std::shared_ptr<linphone::Conference> & conference, const std::shared_ptr<const linphone::ParticipantDevice> & participantDevice){
qDebug() << "onParticipantDeviceAdded";
qDebug() << "Me devices : " << conference->getMe()->getDevices().size();
if( conference->getMe()->getDevices().size() > 1)
for(auto d : conference->getMe()->getDevices())
qDebug() << "\t--> " << d->getAddress()->asString().c_str();
emit participantDeviceAdded(participantDevice);
}
void ConferenceListener::onParticipantDeviceRemoved(const std::shared_ptr<linphone::Conference> & conference, const std::shared_ptr<const linphone::ParticipantDevice> & participantDevice){

View file

@ -221,6 +221,18 @@ void ConferenceInfoModel::setTimeZoneModel(TimeZoneModel * model){
void ConferenceInfoModel::setIsScheduled(const bool& on){
if( mIsScheduled != on){
mIsScheduled = on;
if(!mIsScheduled){
mConferenceInfo->setDateTime(0);
mConferenceInfo->setDuration(0);
}else{
mTimeZone = QTimeZone::systemTimeZone();
QDateTime currentDateTime = QDateTime::currentDateTime();
QDateTime utc = currentDateTime.addSecs( -mTimeZone.offsetFromUtc(currentDateTime));
mConferenceInfo->setDateTime(utc.toMSecsSinceEpoch() / 1000);
mConferenceInfo->setDuration(1200);
}
emit dateTimeChanged();
emit durationChanged();
emit isScheduledChanged();
}
}
@ -232,23 +244,15 @@ void ConferenceInfoModel::createConference(const int& securityLevel, const int&
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
static std::shared_ptr<linphone::Conference> conference;
qInfo() << "Conference creation of " << getSubject() << " at " << securityLevel << " security, organized by " << getOrganizer();
qInfo() << "Participants:";
for(auto p : mConferenceInfo->getParticipants())
qInfo() << "\t" << p->asString().c_str();
if( isScheduled()){
mConferenceScheduler = ConferenceScheduler::create();
connect(mConferenceScheduler.get(), &ConferenceScheduler::invitationsSent, this, &ConferenceInfoModel::onInvitationsSent);
connect(mConferenceScheduler.get(), &ConferenceScheduler::stateChanged, this, &ConferenceInfoModel::onStateChanged);
mConferenceScheduler->getConferenceScheduler()->setInfo(mConferenceInfo);
}else{
auto conferenceParameters = core->createConferenceParams(nullptr);
conferenceParameters->enableAudio(true);
conferenceParameters->enableVideo(true);
conferenceParameters->setDescription(mConferenceInfo->getDescription());
conferenceParameters->setSubject(mConferenceInfo->getSubject());
conferenceParameters->setStartTime(0);
conferenceParameters->setEndTime(0);
conferenceParameters->enableLocalParticipant(true);
conference = core->createConferenceWithParams(conferenceParameters);
}
mConferenceScheduler = ConferenceScheduler::create();
connect(mConferenceScheduler.get(), &ConferenceScheduler::invitationsSent, this, &ConferenceInfoModel::onInvitationsSent);
connect(mConferenceScheduler.get(), &ConferenceScheduler::stateChanged, this, &ConferenceInfoModel::onStateChanged);
mConferenceScheduler->getConferenceScheduler()->setInfo(mConferenceInfo);
}
//-------------------------------------------------------------------------------------------------

View file

@ -38,6 +38,8 @@ QSharedPointer<ConferenceScheduler> ConferenceScheduler::create( QObject *parent
ConferenceScheduler::ConferenceScheduler (QObject * parent) : QObject(parent){
App::getInstance()->getEngine()->setObjectOwnership(this, QQmlEngine::CppOwnership);// Avoid QML to destroy it when passing by Q_INVOKABLE
mConferenceScheduler = CoreManager::getInstance()->getCore()->createConferenceScheduler();
qDebug() << "Create Scheduler with this account : " << CoreManager::getInstance()->getCore()->getDefaultAccount()->getContactAddress()->asString().c_str();
mConferenceScheduler->setAccount(CoreManager::getInstance()->getCore()->getDefaultAccount());
mConferenceSchedulerListener = std::make_shared<ConferenceSchedulerListener>();
connectTo(mConferenceSchedulerListener.get());
mConferenceScheduler->addListener(mConferenceSchedulerListener);

View file

@ -208,11 +208,9 @@ void TimelineListModel::updateTimelines () {
// Clean terminated chat rooms and conferences from timeline.
allChatRooms.remove_if([](std::shared_ptr<linphone::ChatRoom> chatRoom){
bool toRemove = chatRoom->getState() == linphone::ChatRoom::State::Terminated || chatRoom->getState() == linphone::ChatRoom::State::Deleted
|| (chatRoom->getConferenceAddress() && chatRoom->getHistoryEventsSize() == 0);
if( toRemove)
if( ChatRoomModel::isTerminated(chatRoom) && chatRoom->getUnreadMessagesCount() > 0)
chatRoom->markAsRead();
return toRemove;
return chatRoom->getConferenceAddress() && chatRoom->getHistoryEventsSize() == 0;
});
//Remove no more chat rooms

View file

@ -150,7 +150,7 @@ ChatRoomModel *TimelineModel::getChatRoomModel() const{
}
void TimelineModel::setSelected(const bool& selected){
if(selected != mSelected){
if(mChatRoomModel && selected != mSelected){
mSelected = selected;
if(mSelected){
qInfo() << "Chat room selected : Subject :" << mChatRoomModel->getSubject()

View file

@ -362,6 +362,7 @@ DialogPlus {
Layout.fillHeight: true
Layout.rightMargin: 15
spacing:5
visible: scheduledSwitch.checked
Text{
Layout.fillWidth: true
Layout.preferredHeight: 20

View file

@ -118,7 +118,7 @@ QtObject {
property color backgroundHiddenPartDisabledColor : ColorsList.addImageColor(sectionName+'_'+name+'_hidden_bg_d', icon, 'me_d_b_inv_bg').color
property color backgroundHiddenPartHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_hidden_bg_h', icon, 'me_h_b_inv_bg').color
property color backgroundHiddenPartPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_hidden_bg_p', icon, 'me_p_b_inv_bg').color
property color foregroundHiddenPartNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_hidden_fg_n', icon, 'me_n_b_inv_fg').color
property color foregroundHiddenPartNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_hidden_fg_n', icon, 'me_h_b_inv_fg').color
property color foregroundHiddenPartDisabledColor : ColorsList.addImageColor(sectionName+'_'+name+'_hidden_fg_d', icon, 'me_d_b_inv_fg').color
property color foregroundHiddenPartHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_hidden_fg_h', icon, 'me_h_b_inv_fg').color
property color foregroundHiddenPartPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_hidden_fg_p', icon, 'me_p_b_inv_fg').color

View file

@ -118,7 +118,7 @@ QtObject {
property color backgroundHiddenPartDisabledColor : ColorsList.addImageColor(sectionName+'_'+name+'_hidden_bg_d', icon, 'me_d_b_inv_bg').color
property color backgroundHiddenPartHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_hidden_bg_h', icon, 'me_h_b_inv_bg').color
property color backgroundHiddenPartPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_hidden_bg_p', icon, 'me_p_b_inv_bg').color
property color foregroundHiddenPartNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_hidden_fg_n', icon, 'me_n_b_inv_fg').color
property color foregroundHiddenPartNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_hidden_fg_n', icon, 'me_h_b_inv_fg').color
property color foregroundHiddenPartDisabledColor : ColorsList.addImageColor(sectionName+'_'+name+'_hidden_fg_d', icon, 'me_d_b_inv_fg').color
property color foregroundHiddenPartHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_hidden_fg_h', icon, 'me_h_b_inv_fg').color
property color foregroundHiddenPartPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_hidden_fg_p', icon, 'me_p_b_inv_fg').color