From ac1c821cc2e81ee705ad428ec4bdd6e37ab48011 Mon Sep 17 00:00:00 2001 From: agsantos <aline.gondimsantos@savoirfairelinux.com> Date: Wed, 8 Jul 2020 15:02:19 -0400 Subject: [PATCH] plugin: toggle callmediahandler with callID Change-Id: Ieba982cf9988b7837328fba81d597f23b068ea1f --- src/newcallmodel.cpp | 5 ----- src/pluginmodel.cpp | 41 ++++++++++++++++++++--------------------- 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/src/newcallmodel.cpp b/src/newcallmodel.cpp index 9b75b170..ec7a1912 100644 --- a/src/newcallmodel.cpp +++ b/src/newcallmodel.cpp @@ -770,11 +770,6 @@ NewCallModelPimpl::slotCallStateChanged(const QString& callId, const QString& st if (call->status == call::Status::ENDED) { emit linked.callEnded(callId); - // NOTE: this line stops all mediaHandlers after the end of any call. - // The mediaHandler will be linked with the callID soon and each mediaHandler - // will be activated/deactivated with respect to the callID. - // This modification will allow to remove the next line. - PluginModel().toggleCallMediaHandler(""); } else if (call->status == call::Status::IN_PROGRESS) { if (previousStatus == call::Status::INCOMING_RINGING || previousStatus == call::Status::OUTGOING_RINGING) { diff --git a/src/pluginmodel.cpp b/src/pluginmodel.cpp index a3ad2461..11bd518a 100644 --- a/src/pluginmodel.cpp +++ b/src/pluginmodel.cpp @@ -1,20 +1,20 @@ -/**************************************************************************** - * Copyright (C) 2018-2020 Savoir-faire Linux Inc. * - * Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com> * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see <http://www.gnu.org/licenses/>. * - ***************************************************************************/ +/** + * Copyright (C) 2020 Savoir-faire Linux Inc. + * Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ #include "api/pluginmodel.h" // Std @@ -136,10 +136,9 @@ void PluginModel::toggleCallMediaHandler(const QString& id) { MapStringString toggleInfo = PluginManager::instance().getCallMediaHandlerStatus(); - if (toggleInfo["state"] == "true"){ - PluginManager::instance().toggleCallMediaHandler(toggleInfo["name"], false); - } - if (!id.isEmpty() && id != toggleInfo["name"]) { + if (toggleInfo["name"] == id){ + PluginManager::instance().toggleCallMediaHandler(id, false); + } else { PluginManager::instance().toggleCallMediaHandler(id, true); } } -- GitLab