[Telepathy-commits] [telepathy-gabble/master] conn-olpc: fix unsubscribe to Gadget

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Fri Sep 26 10:02:51 PDT 2008


20080730074523-7fe3f-649ca3ab94316384ab3a279256b254b470cb82fa.gz
---
 src/conn-olpc.c                      |    6 +++---
 tests/twisted/olpc/gadget-publish.py |    6 ++++++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/conn-olpc.c b/src/conn-olpc.c
index 2e43a6a..ac3fd72 100644
--- a/src/conn-olpc.c
+++ b/src/conn-olpc.c
@@ -4267,7 +4267,7 @@ olpc_gadget_publish (GabbleSvcOLPCGadget *iface,
           return;
         }
 
-      if (!send_presence_to_gadget (conn, LM_MESSAGE_SUB_TYPE_SUBSCRIBED,
+      if (!send_presence_to_gadget (conn, LM_MESSAGE_SUB_TYPE_UNSUBSCRIBED,
             &error))
         {
           dbus_g_method_return_error (context, error);
@@ -4277,8 +4277,8 @@ olpc_gadget_publish (GabbleSvcOLPCGadget *iface,
     }
   else
     {
-      /* FIXME */
-      if (!send_presence_to_gadget (conn, LM_MESSAGE_SUB_TYPE_SUBSCRIBE,
+      /* FIXME: remove from roster ? */
+      if (!send_presence_to_gadget (conn, LM_MESSAGE_SUB_TYPE_UNSUBSCRIBE,
             &error))
         {
           dbus_g_method_return_error (context, error);
diff --git a/tests/twisted/olpc/gadget-publish.py b/tests/twisted/olpc/gadget-publish.py
index 5cc9f7d..d221596 100644
--- a/tests/twisted/olpc/gadget-publish.py
+++ b/tests/twisted/olpc/gadget-publish.py
@@ -50,6 +50,12 @@ def test(q, bus, conn, stream):
             EventPattern('stream-presence', presence_type='subscribed'),
             EventPattern('dbus-return', method='Publish'))
 
+    call_async(q, gadget_iface, 'Publish', False)
+
+    q.expect_many(
+            EventPattern('stream-presence', presence_type='unsubscribe'),
+            EventPattern('stream-presence', presence_type='unsubscribed'),
+            EventPattern('dbus-return', method='Publish'))
 
 if __name__ == '__main__':
     exec_test(test)
-- 
1.5.6.5




More information about the Telepathy-commits mailing list