changeset 26142:5b64b7d8da39

Added the accepted signal.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Tue, 27 Jan 2009 09:40:24 +0000
parents 1ff5304f6e9d
children f6a98b2b8d92
files libpurple/media.c libpurple/protocols/jabber/jingle/rtp.c
diffstat 2 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media.c	Tue Jan 27 08:46:53 2009 +0000
+++ b/libpurple/media.c	Tue Jan 27 09:40:24 2009 +0000
@@ -118,6 +118,7 @@
 
 enum {
 	ERROR,
+	ACCEPTED,
 	CODECS_CHANGED,
 	NEW_CANDIDATE,
 	READY_NEW,
@@ -200,6 +201,10 @@
 					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
 					 g_cclosure_marshal_VOID__STRING,
 					 G_TYPE_NONE, 1, G_TYPE_STRING);
+	purple_media_signals[ACCEPTED] = g_signal_new("accepted", G_TYPE_FROM_CLASS(klass),
+					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+					 purple_smarshal_VOID__STRING_STRING,
+					 G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING);
 	purple_media_signals[CODECS_CHANGED] = g_signal_new("codecs-changed", G_TYPE_FROM_CLASS(klass),
 					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
 					 g_cclosure_marshal_VOID__STRING,
@@ -1232,6 +1237,8 @@
 			purple_media_emit_ready(media, session, NULL);
 	}
 
+	g_signal_emit(media, purple_media_signals[ACCEPTED],
+			0, NULL, NULL);
 	streams = media->priv->streams;
 
 	for (; streams; streams = g_list_next(streams)) {
--- a/libpurple/protocols/jabber/jingle/rtp.c	Tue Jan 27 08:46:53 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/rtp.c	Tue Jan 27 09:40:24 2009 +0000
@@ -271,6 +271,13 @@
 }
 
 static void
+jingle_rtp_accepted_cb(PurpleMedia *media, gchar *sid, gchar *name,
+		JingleSession *session)
+{
+	purple_debug_info("jingle-rtp", "jingle_rtp_accepted_cb\n");
+}
+
+static void
 jingle_rtp_codecs_changed_cb(PurpleMedia *media, gchar *sid,
 		JingleSession *session)
 {
@@ -367,6 +374,8 @@
 	g_hash_table_insert(js->medias, sid, media);
 
 	/* connect callbacks */
+	g_signal_connect(G_OBJECT(media), "accepted",
+				 G_CALLBACK(jingle_rtp_accepted_cb), session);
 	g_signal_connect(G_OBJECT(media), "codecs-changed",
 				 G_CALLBACK(jingle_rtp_codecs_changed_cb), session);
 	g_signal_connect(G_OBJECT(media), "new-candidate",