From 9a98d6a6791e01c7947ed8f5f66ac60f83665ea0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Tue, 14 Jun 2022 15:03:40 -0400
Subject: [PATCH] misc: minor cleanup

Change-Id: Ibebe3511681d869d3e2688ce9154df029e4d088c
---
 src/manager.cpp         | 12 ++++++++----
 src/manager.h           |  4 +---
 src/media/rtp_session.h |  7 -------
 3 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/src/manager.cpp b/src/manager.cpp
index c26e6ba33b..dbe0fa338e 100644
--- a/src/manager.cpp
+++ b/src/manager.cpp
@@ -1008,8 +1008,7 @@ Manager::unregisterAccounts()
 std::string
 Manager::outgoingCall(const std::string& account_id,
                       const std::string& to,
-                      const std::vector<DRing::MediaMap>& mediaList,
-                      std::shared_ptr<Conference> conference)
+                      const std::vector<DRing::MediaMap>& mediaList)
 {
     JAMI_DBG() << "try outgoing call to '" << to << "'"
                << " with account '" << account_id << "'";
@@ -1485,7 +1484,7 @@ Manager::createConfFromParticipantList(const std::string& accountId,
         pimpl_->unsetCurrentCall();
 
         // Create call
-        auto callId = outgoingCall(account, tostr, {}, conf);
+        auto callId = outgoingCall(account, tostr, {});
         if (callId.empty())
             continue;
 
@@ -1564,10 +1563,15 @@ Manager::joinConference(const std::string& accountId,
                         const std::string& confId2)
 {
     auto account = getAccount(accountId);
+    auto account2 = getAccount(account2Id);
     if (not account) {
         JAMI_ERR("Can't find account: %s", accountId.c_str());
         return false;
     }
+    if (not account2) {
+        JAMI_ERR("Can't find account: %s", account2Id.c_str());
+        return false;
+    }
 
     auto conf = account->getConference(confId1);
     if (not conf) {
@@ -1575,7 +1579,7 @@ Manager::joinConference(const std::string& accountId,
         return false;
     }
 
-    auto conf2 = account->getConference(confId2);
+    auto conf2 = account2->getConference(confId2);
     if (not conf2) {
         JAMI_ERR("Not a valid conference ID: %s", confId2.c_str());
         return false;
diff --git a/src/manager.h b/src/manager.h
index f4138b3cc7..585c1fbd6d 100644
--- a/src/manager.h
+++ b/src/manager.h
@@ -149,13 +149,11 @@ public:
      * @param callee the callee's ID/URI. Depends on the account type.
      * Refer to placeCall/placeCallWithMedia documentations.
      * @param mediaList a list of medias to include
-     * @param confId the conference ID if any
      * @return the call ID on success, empty string otherwise
      */
     std::string outgoingCall(const std::string& accountId,
                              const std::string& callee,
-                             const std::vector<DRing::MediaMap>& mediaList = {},
-                             std::shared_ptr<Conference> conference = {});
+                             const std::vector<DRing::MediaMap>& mediaList = {});
 
     /**
      * Functions which occur with a user's action
diff --git a/src/media/rtp_session.h b/src/media/rtp_session.h
index 453befe8cd..1f6bb75429 100644
--- a/src/media/rtp_session.h
+++ b/src/media/rtp_session.h
@@ -64,13 +64,6 @@ public:
         receive_ = receive;
     }
 
-    bool isReceiving() const noexcept
-    {
-        return receive_.enabled
-               && (receive_.direction_ == MediaDirection::RECVONLY
-                   || receive_.direction_ == MediaDirection::SENDRECV);
-    }
-
     void setMtu(uint16_t mtu) { mtu_ = mtu; }
 
     void setSuccessfulSetupCb(const std::function<void(MediaType, bool)>& cb)
-- 
GitLab