[Telepathy-commits] [telepathy-gabble/master] gabble_media_stream_constructor: assert that we have a GabbleJingleContent

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Feb 24 10:51:37 PST 2009


Invariant: every GabbleMediaStream has a GabbleJingleContent. In the only
place that currently creates a GabbleMediaStream, this is true.
---
 src/media-stream.c |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/media-stream.c b/src/media-stream.c
index ee0b661..bf3de57 100644
--- a/src/media-stream.c
+++ b/src/media-stream.c
@@ -213,19 +213,18 @@ gabble_media_stream_constructor (GType type, guint n_props,
   bus = tp_get_bus ();
   dbus_g_connection_register_g_object (bus, priv->object_path, obj);
 
-  if (priv->content != NULL)
-    {
-      update_direction (stream, priv->content);
-
-      /* MediaStream is created as soon as GabbleJingleContent is
-       * created, but we want to let it parse the initiation (if
-       * initiated by remote end) before we pick up initial
-       * codecs and candidates.
-       * FIXME: add API for ordering IQs rather than using g_idle_add.
-       */
-      priv->initial_getter_id =
-          g_idle_add (_get_initial_codecs_and_candidates, stream);
-    }
+  g_assert (priv->content != NULL);
+
+  update_direction (stream, priv->content);
+
+  /* MediaStream is created as soon as GabbleJingleContent is
+   * created, but we want to let it parse the initiation (if
+   * initiated by remote end) before we pick up initial
+   * codecs and candidates.
+   * FIXME: add API for ordering IQs rather than using g_idle_add.
+   */
+  priv->initial_getter_id =
+      g_idle_add (_get_initial_codecs_and_candidates, stream);
 
   return obj;
 }
-- 
1.5.6.5




More information about the telepathy-commits mailing list