# HG changeset patch # User Mike Ruprecht # Date 1233094681 0 # Node ID f6a98b2b8d9239e04aefc74894a5ef74518dbc63 # Parent 5b64b7d8da39b6a72ef0b2afd6731923cd213907 Add the accepted signal and make the accept button go away immediately. diff -r 5b64b7d8da39 -r f6a98b2b8d92 libpurple/media.c --- a/libpurple/media.c Tue Jan 27 09:40:24 2009 +0000 +++ b/libpurple/media.c Tue Jan 27 22:18:01 2009 +0000 @@ -1893,6 +1893,15 @@ 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); diff -r 5b64b7d8da39 -r f6a98b2b8d92 libpurple/media.h --- a/libpurple/media.h Tue Jan 27 09:40:24 2009 +0000 +++ b/libpurple/media.h Tue Jan 27 22:18:01 2009 +0000 @@ -600,6 +600,18 @@ 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 diff -r 5b64b7d8da39 -r f6a98b2b8d92 pidgin/gtkmedia.c --- a/pidgin/gtkmedia.c Tue Jan 27 09:40:24 2009 +0000 +++ b/pidgin/gtkmedia.c Tue Jan 27 22:18:01 2009 +0000 @@ -357,6 +357,14 @@ 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 @@ 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 @@ 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;