[ekiga] Made the Ekiga::CallCore use the friend-or-foe code to reject calls
- From: Julien Puydt <jpuydt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] Made the Ekiga::CallCore use the friend-or-foe code to reject calls
- Date: Mon, 23 Jun 2014 15:48:49 +0000 (UTC)
commit a18e0efd84f8f53eef876e218833f81f1ffaf1ab
Author: Julien Puydt <julien puydt laposte net>
Date: Sun Jun 22 10:44:04 2014 +0200
Made the Ekiga::CallCore use the friend-or-foe code to reject calls
lib/engine/engine.cpp | 4 ++--
lib/engine/protocol/call-core.cpp | 18 +++++++++++++++++-
lib/engine/protocol/call-core.h | 6 ++++--
3 files changed, 23 insertions(+), 5 deletions(-)
---
diff --git a/lib/engine/engine.cpp b/lib/engine/engine.cpp
index 75a2cb6..eaa3d3f 100644
--- a/lib/engine/engine.cpp
+++ b/lib/engine/engine.cpp
@@ -99,16 +99,16 @@ engine_init (Ekiga::ServiceCorePtr service_core,
Ekiga::ServicePtr notification_core(new Ekiga::NotificationCore);
service_core->add (notification_core);
+ boost::shared_ptr<Ekiga::FriendOrFoe> friend_or_foe (new Ekiga::FriendOrFoe);
boost::shared_ptr<Ekiga::AccountCore> account_core (new Ekiga::AccountCore);
boost::shared_ptr<Ekiga::ContactCore> contact_core (new Ekiga::ContactCore);
- boost::shared_ptr<Ekiga::CallCore> call_core (new Ekiga::CallCore);
+ boost::shared_ptr<Ekiga::CallCore> call_core (new Ekiga::CallCore (friend_or_foe));
boost::shared_ptr<Ekiga::ChatCore> chat_core (new Ekiga::ChatCore);
boost::shared_ptr<Ekiga::VideoOutputCore> videooutput_core (new Ekiga::VideoOutputCore);
boost::shared_ptr<Ekiga::VideoInputCore> videoinput_core (new Ekiga::VideoInputCore (*service_core,
videooutput_core));
boost::shared_ptr<Ekiga::AudioOutputCore> audiooutput_core (new Ekiga::AudioOutputCore (*service_core));
boost::shared_ptr<Ekiga::AudioInputCore> audioinput_core (new Ekiga::AudioInputCore(*service_core));
boost::shared_ptr<Ekiga::HalCore> hal_core (new Ekiga::HalCore);
- boost::shared_ptr<Ekiga::FriendOrFoe> friend_or_foe (new Ekiga::FriendOrFoe);
boost::shared_ptr<Gmconf::PersonalDetails> details(new Gmconf::PersonalDetails);
boost::shared_ptr<Ekiga::PresenceCore> presence_core(new Ekiga::PresenceCore (details));
diff --git a/lib/engine/protocol/call-core.cpp b/lib/engine/protocol/call-core.cpp
index 9b0ad4c..4002251 100644
--- a/lib/engine/protocol/call-core.cpp
+++ b/lib/engine/protocol/call-core.cpp
@@ -40,6 +40,12 @@
using namespace Ekiga;
+CallCore::CallCore (boost::shared_ptr<Ekiga::FriendOrFoe> iff_):
+ iff(iff_)
+{
+ nr_ready = 0;
+}
+
void CallCore::add_manager (boost::shared_ptr<CallManager> manager)
{
managers.insert (manager);
@@ -86,8 +92,18 @@ bool CallCore::dial (const std::string uri)
}
-void CallCore::add_call (boost::shared_ptr<Call> call, boost::shared_ptr<CallManager> manager)
+void
+CallCore::add_call (boost::shared_ptr<Call> call,
+ boost::shared_ptr<CallManager> manager)
{
+ Ekiga::FriendOrFoe::Identification id = iff->decide ("call", call->get_remote_uri ());
+
+ if (id == Ekiga::FriendOrFoe::Foe) {
+
+ call->hang_up ();
+ return;
+ }
+
boost::shared_ptr<Ekiga::scoped_connections> conns(new Ekiga::scoped_connections);
conns->add (call->ringing.connect (boost::bind (&CallCore::on_ringing_call, this, call, manager)));
diff --git a/lib/engine/protocol/call-core.h b/lib/engine/protocol/call-core.h
index 8f38f9c..3dd6b98 100644
--- a/lib/engine/protocol/call-core.h
+++ b/lib/engine/protocol/call-core.h
@@ -41,6 +41,8 @@
#include "chain-of-responsibility.h"
#include "services.h"
#include "scoped-connections.h"
+
+#include "friend-or-foe/friend-or-foe.h"
#include "call.h"
#include "call-manager.h"
#include "call-protocol-manager.h"
@@ -72,7 +74,7 @@ namespace Ekiga
/** The constructor
*/
- CallCore () { nr_ready = 0; }
+ CallCore (boost::shared_ptr<Ekiga::FriendOrFoe> iff);
/*** Service Implementation ***/
@@ -180,7 +182,7 @@ namespace Ekiga
void on_call_removed (boost::shared_ptr<Call> call);
-
+ boost::shared_ptr<Ekiga::FriendOrFoe> iff;
std::set<boost::shared_ptr<CallManager> > managers;
std::map<std::string, boost::shared_ptr<Ekiga::scoped_connections> > call_connections;
unsigned nr_ready;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]