]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-call-handler.c
add myself to AUTHORS
[empathy.git] / libempathy / empathy-call-handler.c
index 72c317b7f7a6a4661f967e2b35e3382f9278f772..3be5eda0808475446fcfa48d7ecc481c954e8eb0 100644 (file)
@@ -23,6 +23,7 @@
 #include <stdlib.h>
 
 #include <telepathy-glib/util.h>
+#include <telepathy-glib/interfaces.h>
 
 #include <telepathy-farsight/channel.h>
 #include <telepathy-farsight/stream.h>
@@ -41,6 +42,7 @@ enum {
   SINK_PAD_ADDED,
   REQUEST_RESOURCE,
   CLOSED,
+  STREAM_CLOSED,
   LAST_SIGNAL
 };
 
@@ -253,6 +255,12 @@ empathy_call_handler_class_init (EmpathyCallHandlerClass *klass)
       g_cclosure_marshal_VOID__VOID,
       G_TYPE_NONE,
       0);
+
+  signals[STREAM_CLOSED] =
+    g_signal_new ("stream-closed", G_TYPE_FROM_CLASS (klass),
+      G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+      g_cclosure_marshal_VOID__OBJECT,
+      G_TYPE_NONE, 1, TF_TYPE_STREAM);
 }
 
 /**
@@ -349,6 +357,13 @@ empathy_call_handler_tf_stream_request_resource_cb (TfStream *stream,
   return ret;
 }
 
+static void
+empathy_call_handler_tf_stream_closed_cb (TfStream *stream,
+  EmpathyCallHandler *handler)
+{
+  g_signal_emit (handler, signals[STREAM_CLOSED], 0, stream);
+}
+
 static void
 empathy_call_handler_tf_channel_stream_created_cb (TfChannel *tfchannel,
   TfStream *stream, EmpathyCallHandler *handler)
@@ -361,6 +376,8 @@ empathy_call_handler_tf_channel_stream_created_cb (TfChannel *tfchannel,
   g_signal_connect (stream, "request-resource",
       G_CALLBACK (empathy_call_handler_tf_stream_request_resource_cb),
         handler);
+  g_signal_connect (stream, "closed",
+      G_CALLBACK (empathy_call_handler_tf_stream_closed_cb), handler);
 
   g_object_get (stream, "media-type", &media_type,
     "sink-pad", &spad, NULL);
@@ -438,6 +455,7 @@ empathy_call_handler_request_cb (EmpathyDispatchOperation *operation,
     empathy_dispatch_operation_get_channel_wrapper (operation));
 
   g_object_ref (priv->call);
+  g_object_notify (G_OBJECT (self), "tp-call");
 
   empathy_call_handler_start_tpfs (self);