[ekiga] Hooked the local roster code to the IFF code



commit b459aff785e6ca98cb253265e458c59ea81ef8c5
Author: Julien Puydt <jpuydt gnome org>
Date:   Thu Jul 2 14:57:24 2009 +0200

    Hooked the local roster code to the IFF code
    
    For now it only answers "unknown", but it's connected to
    the engine.

 lib/engine/components/local-roster/Makefile.am     |    3 ++-
 lib/engine/components/local-roster/local-heap.cpp  |    7 +++++++
 lib/engine/components/local-roster/local-heap.h    |    9 ++++++++-
 .../components/local-roster/local-roster-main.cpp  |    5 ++++-
 4 files changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/lib/engine/components/local-roster/Makefile.am b/lib/engine/components/local-roster/Makefile.am
index bc442c3..0ee2dc1 100644
--- a/lib/engine/components/local-roster/Makefile.am
+++ b/lib/engine/components/local-roster/Makefile.am
@@ -7,8 +7,9 @@ AM_CPPFLAGS = $(XML_CFLAGS) $(SIGC_CFLAGS) $(GLIB_CFLAGS)
 INCLUDES = \
 	-I$(top_srcdir)/lib/gmconf	 		\
 	-I$(top_srcdir)/lib/engine/framework 		\
-	-I$(top_srcdir)/lib/engine/addressbook	\
+	-I$(top_srcdir)/lib/engine/addressbook		\
 	-I$(top_srcdir)/lib/engine/account		\
+	-I$(top_srcdir)/lib/engine/friend-or-foe	\
 	-I$(top_srcdir)/lib/engine/presence
 
 liblocal_roster_la_SOURCES = \
diff --git a/lib/engine/components/local-roster/local-heap.cpp b/lib/engine/components/local-roster/local-heap.cpp
index 72f8d65..c4fbc6d 100644
--- a/lib/engine/components/local-roster/local-heap.cpp
+++ b/lib/engine/components/local-roster/local-heap.cpp
@@ -454,3 +454,10 @@ Local::Heap::rename_group_form_submitted (std::string old_name,
     visit_presentities (sigc::mem_fun (helper, &rename_group_form_submitted_helper::rename_group));
   }
 }
+
+Ekiga::FriendOrFoe::Identification
+Local::Heap::decide (const std::string /*domain*/,
+		     const std::string token) const
+{
+  return Ekiga::FriendOrFoe::Unknown;
+}
diff --git a/lib/engine/components/local-roster/local-heap.h b/lib/engine/components/local-roster/local-heap.h
index e50724d..a21638d 100644
--- a/lib/engine/components/local-roster/local-heap.h
+++ b/lib/engine/components/local-roster/local-heap.h
@@ -38,6 +38,7 @@
 #define __LOCAL_HEAP_H__
 
 #include "heap-impl.h"
+#include "friend-or-foe.h"
 #include "local-presentity.h"
 
 
@@ -62,7 +63,9 @@ namespace Local
    * When required, the Heap content is being saved in a GmConf entry.
    * Alternatively, it could be saved elsewhere.
    */
-  class Heap : public Ekiga::HeapImpl<Presentity>
+  class Heap:
+    public Ekiga::HeapImpl<Presentity>,
+    public Ekiga::FriendOrFoe::Helper
   {
   public:
 
@@ -114,6 +117,10 @@ namespace Local
      */
     const std::set<std::string> existing_groups ();
 
+    /** Implementation of the IFF api
+     */
+    Ekiga::FriendOrFoe::Identification decide (const std::string domain,
+					       const std::string token) const;
 
     /** This function should be called when a new presentity has
      * to be added to the Heap. It uses a form with the known
diff --git a/lib/engine/components/local-roster/local-roster-main.cpp b/lib/engine/components/local-roster/local-roster-main.cpp
index 8d35f69..d698847 100644
--- a/lib/engine/components/local-roster/local-roster-main.cpp
+++ b/lib/engine/components/local-roster/local-roster-main.cpp
@@ -37,6 +37,7 @@
 
 #include "local-roster-main.h"
 #include "presence-core.h"
+#include "friend-or-foe.h"
 #include "local-cluster.h"
 
 struct LOCALROSTERSpark: public Ekiga::Spark
@@ -50,11 +51,13 @@ struct LOCALROSTERSpark: public Ekiga::Spark
   {
     Ekiga::ServicePtr service = core.get ("local-cluster");
     gmref_ptr<Ekiga::PresenceCore> presence_core = core.get ("presence-core");
+    gmref_ptr<Ekiga::FriendOrFoe> iff = core.get ("friend-or-foe");
 
-    if (presence_core && !service) {
+    if (presence_core && iff && !service) {
 
       gmref_ptr<Local::Cluster> cluster (new Local::Cluster (core));
       core.add (cluster);
+      iff->add_helper (cluster->get_heap ());
       presence_core->add_cluster (cluster);
       result = true;
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]