pidgin.vv: 7848b6ac: Add the accepted signal and make the acc...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Tue Jan 27 18:05:29 EST 2009


-----------------------------------------------------------------
Revision: 7848b6ac84570c00ecd801a2123b9d6dba760a19
Ancestor: 40dead6ac2846cad611d977d52f3e506e422aafc
Author: maiku at soc.pidgin.im
Date: 2009-01-27T22:18:01
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/7848b6ac84570c00ecd801a2123b9d6dba760a19

Modified files:
        libpurple/media.c libpurple/media.h pidgin/gtkmedia.c

ChangeLog: 

Add the accepted signal and make the accept button go away immediately.

-------------- next part --------------
============================================================
--- libpurple/media.c	d838b233311e0bc79997f3995653f42ce699b3a6
+++ libpurple/media.c	18aa07d3d24a72dcb4670dbfad6127612b52804e
@@ -1893,6 +1893,15 @@ purple_media_codecs_ready(PurpleMedia *m
 	return ret;
 }
 
+gboolean
+purple_media_accepted(PurpleMedia *media, const gchar *sess_id,
+		const gchar *participant)
+{
+	PurpleMediaSession *session =
+			purple_media_get_session(media, sess_id);
+	return session->accepted;
+}
+
 void purple_media_mute(PurpleMedia *media, gboolean active)
 {
 	GList *sessions = g_hash_table_get_values(media->priv->sessions);
============================================================
--- libpurple/media.h	3dca047193a4ee3369c9c374161b1363445f8aa4
+++ libpurple/media.h	ef1272970939b78d4d0bb6a748333c9e543c501b
@@ -600,6 +600,18 @@ gboolean purple_media_codecs_ready(Purpl
 gboolean purple_media_codecs_ready(PurpleMedia *media, const gchar *sess_id);
 
 /**
+ * Gets whether a streams selected have been accepted.
+ *
+ * @param media The media object to find the session in.
+ * @param sess_id The session id of the session to check.
+ * @param participant The participant to check.
+ *
+ * @return @c TRUE The selected streams have been accepted, or @c FALSE otherwise.
+ */
+gboolean purple_media_accepted(PurpleMedia *media, const gchar *sess_id,
+		const gchar *participant);
+
+/**
  * Mutes or unmutes all the audio local audio sources.
  *
  * @param media The media object to mute or unmute
============================================================
--- pidgin/gtkmedia.c	b7f64c774bac6835c2574f54e4f2269ac76dc007
+++ pidgin/gtkmedia.c	9e4e4388b60fe21ee73f140a0ea9a4f79f172caa
@@ -357,6 +357,14 @@ pidgin_media_error_cb(PidginMedia *media
 	g_signal_emit(gtkmedia, pidgin_media_signals[ERROR], 0, error);
 }
 
+static void
+pidgin_media_accepted_cb(PurpleMedia *media, const gchar *session_id,
+		const gchar *participant, PidginMedia *gtkmedia)
+{
+	pidgin_media_set_state(gtkmedia, PIDGIN_MEDIA_ACCEPTED);
+	pidgin_media_emit_message(gtkmedia, _("Call in progress."));
+}
+
 static gboolean
 plug_delete_event_cb(GtkWidget *widget, gpointer data)
 {
@@ -582,9 +590,6 @@ pidgin_media_state_changed_cb(PurpleMedi
 		GstElement *audiosendbin = NULL, *audiorecvbin = NULL;
 		GstElement *videosendbin = NULL, *videorecvbin = NULL;
 
-		pidgin_media_emit_message(gtkmedia, _("Call in progress."));
-		pidgin_media_set_state(gtkmedia, PIDGIN_MEDIA_ACCEPTED);
-
 		purple_media_get_elements(media, &audiosendbin, &audiorecvbin,
 					  &videosendbin, &videorecvbin);
 
@@ -625,6 +630,8 @@ pidgin_media_set_property (GObject *obje
 
 			g_signal_connect(G_OBJECT(media->priv->media), "error",
 				G_CALLBACK(pidgin_media_error_cb), media);
+			g_signal_connect(G_OBJECT(media->priv->media), "accepted",
+				G_CALLBACK(pidgin_media_accepted_cb), media);
 			g_signal_connect(G_OBJECT(media->priv->media), "state-changed",
 				G_CALLBACK(pidgin_media_state_changed_cb), media);
 			break;


More information about the Commits mailing list