# HG changeset patch # User Mike Ruprecht # Date 1233042483 0 # Node ID ac56e5707a7295816a11a8dfd3cd00388188ed91 # Parent 128a3175668e37dd6cf4d0012385f63dc5fb6482 Added purple_media_end and removed the purple_media_got_hangup. diff -r 128a3175668e -r ac56e5707a72 libpurple/media.c --- a/libpurple/media.c Sat Jan 24 12:01:34 2009 +0000 +++ b/libpurple/media.c Tue Jan 27 07:48:03 2009 +0000 @@ -1238,9 +1238,7 @@ g_signal_emit(media, purple_media_signals[STATE_CHANGED], 0, PURPLE_MEDIA_STATE_CHANGED_HANGUP, NULL, NULL); - g_signal_emit(media, purple_media_signals[STATE_CHANGED], - 0, PURPLE_MEDIA_STATE_CHANGED_END, - NULL, NULL); + purple_media_end(media, NULL, NULL); } void @@ -1249,17 +1247,17 @@ g_signal_emit(media, purple_media_signals[STATE_CHANGED], 0, PURPLE_MEDIA_STATE_CHANGED_REJECTED, NULL, NULL); - g_signal_emit(media, purple_media_signals[STATE_CHANGED], - 0, PURPLE_MEDIA_STATE_CHANGED_END, - NULL, NULL); + purple_media_end(media, NULL, NULL); } void -purple_media_got_hangup(PurpleMedia *media) +purple_media_end(PurpleMedia *media, + const gchar *session_id, const gchar *participant) { - g_signal_emit(media, purple_media_signals[STATE_CHANGED], - 0, PURPLE_MEDIA_STATE_CHANGED_END, - NULL, NULL); + if (session_id == NULL && participant == NULL) + g_signal_emit(media, purple_media_signals[STATE_CHANGED], + 0, PURPLE_MEDIA_STATE_CHANGED_END, + NULL, NULL); } GList* diff -r 128a3175668e -r ac56e5707a72 libpurple/media.h --- a/libpurple/media.h Sat Jan 24 12:01:34 2009 +0000 +++ b/libpurple/media.h Tue Jan 27 07:48:03 2009 +0000 @@ -401,11 +401,14 @@ void purple_media_hangup(PurpleMedia *media); /** - * Set the media session to the got_hangup state. + * Ends all streams that match the given parameters * - * @param media The media object to set the state on. + * @param media The media object with which to end streams. + * @param session_id The session to end streams on. + * @param participant The participant to end streams with. */ -void purple_media_got_hangup(PurpleMedia *media); +void purple_media_end(PurpleMedia *media, const gchar *session_id, + const gchar *participant); /** * Enumerates a list of devices. diff -r 128a3175668e -r ac56e5707a72 libpurple/protocols/jabber/google.c --- a/libpurple/protocols/jabber/google.c Sat Jan 24 12:01:34 2009 +0000 +++ b/libpurple/protocols/jabber/google.c Tue Jan 27 07:48:03 2009 +0000 @@ -446,13 +446,13 @@ static void google_session_handle_reject(JabberStream *js, GoogleSession *session, xmlnode *packet, xmlnode *sess) { - purple_media_got_hangup(session->media); + purple_media_end(session->media, NULL, NULL); } static void google_session_handle_terminate(JabberStream *js, GoogleSession *session, xmlnode *packet, xmlnode *sess) { - purple_media_got_hangup(session->media); + purple_media_end(session->media, NULL, NULL); } static void diff -r 128a3175668e -r ac56e5707a72 libpurple/protocols/jabber/jingle/rtp.c --- a/libpurple/protocols/jabber/jingle/rtp.c Sat Jan 24 12:01:34 2009 +0000 +++ b/libpurple/protocols/jabber/jingle/rtp.c Tue Jan 27 07:48:03 2009 +0000 @@ -594,7 +594,7 @@ if (media != NULL) { gchar *sid = jingle_session_get_sid(session); - purple_media_got_hangup(media); + purple_media_end(media, NULL, NULL); g_hash_table_remove(jingle_session_get_js( session)->medias, sid); g_free(sid);