diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 78cf16a5f0bd1f26a56041a4b772df7ad1c2ded6..3018b065e84d7516d11df575a1d6fbcb04008bee 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -65,6 +65,8 @@ list (APPEND Source_Files "${CMAKE_CURRENT_SOURCE_DIR}/utf8_utils.h" "${CMAKE_CURRENT_SOURCE_DIR}/uri.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/uri.h" + "${CMAKE_CURRENT_SOURCE_DIR}/vcard.h" + "${CMAKE_CURRENT_SOURCE_DIR}/vcard.cpp" ) if(MSVC) diff --git a/src/Makefile.am b/src/Makefile.am index cc3540ba10976221a71f85f02dcab666ab67bb8d..95bfbb0c10d6e3c3663ebaf26048bf78ef7ef8e8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -90,6 +90,7 @@ libring_la_SOURCES = \ ip_utils.h \ ip_utils.cpp \ utf8_utils.cpp \ + vcard.cpp \ ice_transport.cpp \ ice_transport.h \ threadloop.h \ diff --git a/src/manager.cpp b/src/manager.cpp index 006656411a657d381337516ae39c98340417cac8..717d5499ac9068fc6fca3f08f6840476fae9f7ac 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -1088,9 +1088,6 @@ Manager::answerCall(Call& call, const std::vector<DRing::MediaMap>& mediaList) bool Manager::hangupCall(const std::string&, const std::string& callId) { - // store the current call id - const auto& currentCallId(getCurrentCallId()); - stopTone(); pimpl_->removeWaitingCall(callId); diff --git a/src/meson.build b/src/meson.build index a9c22749772733524ac91393426356498dfafbfa..dc1369710c1b183b64b3dfb511d6ccc7933eed38 100644 --- a/src/meson.build +++ b/src/meson.build @@ -123,7 +123,8 @@ libjami_sources = files( 'string_utils.cpp', 'threadloop.cpp', 'uri.cpp', - 'utf8_utils.cpp' + 'utf8_utils.cpp', + 'vcard.cpp' ) if host_machine.system() == 'windows' libjami_sources += files('winsyslog.c') diff --git a/src/sip/sipcall.cpp b/src/sip/sipcall.cpp index a7fa107e3c9095f2754626019249231ed3bf7643..eab843037dc9539da11614698c305aa2058dc942 100644 --- a/src/sip/sipcall.cpp +++ b/src/sip/sipcall.cpp @@ -1595,7 +1595,7 @@ SIPCall::sendKeyframe(int streamIdx) if (streamIdx == -1) { for (const auto& videoRtp : sthis->getRtpSessionList(MediaType::MEDIA_VIDEO)) std::static_pointer_cast<video::VideoRtpSession>(videoRtp)->forceKeyFrame(); - } else if (streamIdx > -1 && streamIdx < sthis->rtpStreams_.size()) { + } else if (streamIdx > -1 && streamIdx < static_cast<int>(sthis->rtpStreams_.size())) { // Apply request for wanted stream auto& stream = sthis->rtpStreams_[streamIdx]; if (stream.rtpSession_ @@ -2998,7 +2998,7 @@ SIPCall::setRotation(int streamIdx, int rotation) if (streamIdx == -1) { for (const auto& videoRtp : getRtpSessionList(MediaType::MEDIA_VIDEO)) std::static_pointer_cast<video::VideoRtpSession>(videoRtp)->setRotation(rotation); - } else if (streamIdx > -1 && streamIdx < rtpStreams_.size()) { + } else if (streamIdx > -1 && streamIdx < static_cast<int>(rtpStreams_.size())) { // Apply request for wanted stream auto& stream = rtpStreams_[streamIdx]; if (stream.rtpSession_ && stream.rtpSession_->getMediaType() == MediaType::MEDIA_VIDEO) diff --git a/src/vcard.cpp b/src/vcard.cpp new file mode 100644 index 0000000000000000000000000000000000000000..779f64a4dc46e5628d2239c2766a24aced6bba92 --- /dev/null +++ b/src/vcard.cpp @@ -0,0 +1,45 @@ +/**************************************************************************** + * Copyright (C) 2017-2022 Savoir-faire Linux Inc. * + * Author: Sébastien Blin <sebastien.blin@savoirfairelinux.com> * + * Author : Alexandre Lision <alexandre.lision@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 "vcard.h" +#include "string_utils.h" + +namespace vCard { + +namespace utils { + +std::map<std::string, std::string> +toMap(std::string_view content) +{ + std::map<std::string, std::string> vCard; + + std::string_view line; + while (jami::getline(content, line)) { + if (line.size()) { + const auto dblptPos = line.find(':'); + if (dblptPos == std::string::npos) + continue; + vCard.emplace(line.substr(0, dblptPos), line.substr(dblptPos + 1)); + } + } + return vCard; +} +} // namespace utils + +} // namespace vCard diff --git a/src/vcard.h b/src/vcard.h index 9e9f1d33e4c8d34959afbd4e89a2d9fe43ac86ec..4a91a22111b79d8f408339d68a63dc45b47d6298 100644 --- a/src/vcard.h +++ b/src/vcard.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (C) 2017-2020 Savoir-faire Linux Inc. * + * Copyright (C) 2017-2022 Savoir-faire Linux Inc. * * Author: Sébastien Blin <sebastien.blin@savoirfairelinux.com> * * Author : Alexandre Lision <alexandre.lision@savoirfairelinux.com> * * * @@ -22,8 +22,6 @@ #include <string_view> #include <map> -#include "string_utils.h" - namespace vCard { constexpr static const char* PROFILE_VCF = "x-jami/jami.profile.vcard"; @@ -82,22 +80,7 @@ namespace utils { * @param content payload * @return the vCard representation */ -static std::map<std::string, std::string> -toMap(std::string_view content) -{ - std::map<std::string, std::string> vCard; - - std::string_view line; - while (jami::getline(content, line)) { - if (line.size()) { - const auto dblptPos = line.find(':'); - if (dblptPos == std::string::npos) - continue; - vCard.emplace(line.substr(0, dblptPos), line.substr(dblptPos + 1)); - } - } - return vCard; -} +std::map<std::string, std::string> toMap(std::string_view content); } // namespace utils } // namespace vCard