[Telepathy-commits] [telepathy-gabble/master] merge the ActivityGadgetDiscovered and BuddyGadgetDiscovered signals

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Fri Sep 26 08:43:45 PDT 2008


---
 extensions/OLPC_Gadget.xml           |   10 ++--------
 src/conn-olpc.c                      |   11 +++++++++--
 tests/twisted/olpc/gadget-invite.py  |    3 +--
 tests/twisted/olpc/gadget-publish.py |    3 +--
 4 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/extensions/OLPC_Gadget.xml b/extensions/OLPC_Gadget.xml
index ad714de..e7a1fc9 100644
--- a/extensions/OLPC_Gadget.xml
+++ b/extensions/OLPC_Gadget.xml
@@ -160,15 +160,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</p>
       </tp:possible-errors>
     </method>
 
-    <signal name="BuddyGadgetDiscovered">
+    <signal name="GadgetDiscovered">
       <tp:docstring>
-        Signal emitted when CM discovers the Gadget component managing buddies.
-      </tp:docstring>
-    </signal>
-
-    <signal name="ActivityGadgetDiscovered">
-      <tp:docstring>
-        Signal emitted when CM discovers the Gadget component managing activities.
+        Signal emitted when CM discovers the Gadget component.
       </tp:docstring>
     </signal>
 
diff --git a/src/conn-olpc.c b/src/conn-olpc.c
index d0c281a..8118a55 100644
--- a/src/conn-olpc.c
+++ b/src/conn-olpc.c
@@ -3641,6 +3641,8 @@ disco_item_found_cb (GabbleDisco *disco,
                      GabbleDiscoItem *item,
                      GabbleConnection *conn)
 {
+  gboolean gadget_discovered = FALSE;
+
   if (tp_strdiff (item->category, "collaboration") ||
       tp_strdiff (item->type, "gadget"))
     return;
@@ -3650,14 +3652,19 @@ disco_item_found_cb (GabbleDisco *disco,
   if (g_hash_table_lookup_extended (item->features, NS_OLPC_BUDDY, NULL, NULL))
     {
       DEBUG ("buddy gadget discovered");
-      gabble_svc_olpc_gadget_emit_buddy_gadget_discovered (conn);
+      gadget_discovered = TRUE;
     }
 
   if (g_hash_table_lookup_extended (item->features, NS_OLPC_ACTIVITY, NULL,
         NULL))
     {
       DEBUG ("activity gadget discovered");
-      gabble_svc_olpc_gadget_emit_activity_gadget_discovered (conn);
+      gadget_discovered = TRUE;
+    }
+
+  if (gadget_discovered)
+    {
+      gabble_svc_olpc_gadget_emit_gadget_discovered (conn);
     }
 }
 
diff --git a/tests/twisted/olpc/gadget-invite.py b/tests/twisted/olpc/gadget-invite.py
index 45d1ba3..fe0600e 100644
--- a/tests/twisted/olpc/gadget-invite.py
+++ b/tests/twisted/olpc/gadget-invite.py
@@ -70,8 +70,7 @@ def test(q, bus, conn, stream):
     act_prop_iface = dbus.Interface(conn, 'org.laptop.Telepathy.ActivityProperties')
     buddy_info_iface = dbus.Interface(conn, 'org.laptop.Telepathy.BuddyInfo')
 
-    q.expect_many(EventPattern('dbus-signal', signal='BuddyGadgetDiscovered'),
-            EventPattern('dbus-signal', signal='ActivityGadgetDiscovered'))
+    q.expect('dbus-signal', signal='GadgetDiscovered')
 
     # join a room
     room_handle, room_path = join_channel('myroom at conference.localhost',
diff --git a/tests/twisted/olpc/gadget-publish.py b/tests/twisted/olpc/gadget-publish.py
index 16f2324..a4586ea 100644
--- a/tests/twisted/olpc/gadget-publish.py
+++ b/tests/twisted/olpc/gadget-publish.py
@@ -46,8 +46,7 @@ def test(q, bus, conn, stream):
 
     announce_gadget(q, stream, disco_event.stanza)
 
-    q.expect_many(EventPattern('dbus-signal', signal='BuddyGadgetDiscovered'),
-            EventPattern('dbus-signal', signal='ActivityGadgetDiscovered'))
+    q.expect('dbus-signal', signal='GadgetDiscovered')
 
     props = conn.GetAll(
             'org.laptop.Telepathy.Gadget',
-- 
1.5.6.5




More information about the Telepathy-commits mailing list