[Telepathy-commits] [telepathy-gabble/master] Now that we depend on telepathy-glib >= 0.7.6 anyway, we might as well implement CallState. However, omit it from GetInterfaces() to avoid making clients think we have a proper implementation

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Aug 19 10:52:16 PDT 2008


20080509123709-53eee-774f7ed592265396e659a5e67475a7e1e04e04cf.gz
---
 src/gabble-media-channel.c |   21 +++++----------------
 1 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/src/gabble-media-channel.c b/src/gabble-media-channel.c
index ce0a438..90fb6c0 100644
--- a/src/gabble-media-channel.c
+++ b/src/gabble-media-channel.c
@@ -59,16 +59,7 @@
       G_TYPE_UINT, \
       G_TYPE_INVALID))
 
-#ifdef WITH_CALL_STATE
-#error Before enabling CallState, update configure.ac to require tp-glib 0.7.6
 static void call_state_iface_init (gpointer, gpointer);
-#define MAYBE_CALL_STATE() \
-    G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_CALL_STATE, \
-      call_state_iface_init);
-#else
-#define MAYBE_CALL_STATE() G_STMT_START { } G_STMT_END
-#endif
-
 static void channel_iface_init (gpointer, gpointer);
 static void hold_iface_init (gpointer, gpointer);
 static void media_signalling_iface_init (gpointer, gpointer);
@@ -77,7 +68,8 @@ static void streamed_media_iface_init (gpointer, gpointer);
 G_DEFINE_TYPE_WITH_CODE (GabbleMediaChannel, gabble_media_channel,
     G_TYPE_OBJECT,
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init);
-    MAYBE_CALL_STATE ();
+    G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_CALL_STATE,
+      call_state_iface_init);
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP,
       tp_group_mixin_iface_init);
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_HOLD,
@@ -712,9 +704,10 @@ gabble_media_channel_get_interfaces (TpSvcChannel *iface,
                                      DBusGMethodInvocation *context)
 {
   const gchar *interfaces[] = {
-#ifdef WITH_CALL_STATE
+      /* FIXME: our implementation of CallState is a stub, so it doesn't
+      appear in GetInterfaces' output to avoid confusing clients
       TP_IFACE_CHANNEL_INTERFACE_CALL_STATE,
-#endif
+      */
       TP_IFACE_CHANNEL_INTERFACE_GROUP,
       TP_IFACE_CHANNEL_INTERFACE_HOLD,
       TP_IFACE_CHANNEL_INTERFACE_MEDIA_SIGNALLING,
@@ -1713,7 +1706,6 @@ _gabble_media_channel_caps_to_typeflags (GabblePresenceCapabilities caps)
   return typeflags;
 }
 
-#ifdef WITH_CALL_STATE
 static void
 gabble_media_channel_get_call_states (TpSvcChannelInterfaceCallState *iface,
                                       DBusGMethodInvocation *context)
@@ -1726,7 +1718,6 @@ gabble_media_channel_get_call_states (TpSvcChannelInterfaceCallState *iface,
       states);
   g_hash_table_destroy (states);
 }
-#endif
 
 static void
 gabble_media_channel_get_hold_state (TpSvcChannelInterfaceHold *iface,
@@ -1837,7 +1828,6 @@ media_signalling_iface_init (gpointer g_iface, gpointer iface_data)
 #undef IMPLEMENT
 }
 
-#ifdef WITH_CALL_STATE
 static void
 call_state_iface_init (gpointer g_iface,
                        gpointer iface_data G_GNUC_UNUSED)
@@ -1849,7 +1839,6 @@ call_state_iface_init (gpointer g_iface,
   IMPLEMENT(get_call_states);
 #undef IMPLEMENT
 }
-#endif
 
 static void
 hold_iface_init (gpointer g_iface,
-- 
1.5.6.3




More information about the Telepathy-commits mailing list