pidgin.vv: 15a7434b: Use the state-changed signal.
maiku at soc.pidgin.im
maiku at soc.pidgin.im
Mon Jan 5 05:35:40 EST 2009
-----------------------------------------------------------------
Revision: 15a7434b0496ba7ba0f67f142d3f22f0bd1fd8b3
Ancestor: 0172cf13d2ad06b098c9807836797ae0087ac913
Author: maiku at soc.pidgin.im
Date: 2009-01-05T09:48:39
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/15a7434b0496ba7ba0f67f142d3f22f0bd1fd8b3
Modified files:
libpurple/protocols/jabber/jingle/rtp.c
ChangeLog:
Use the state-changed signal.
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/rtp.c 04309b54c16143dfdcf4a1c9e6bfc9c647eecec8
+++ libpurple/protocols/jabber/jingle/rtp.c cdbb19dcad967c4e565a2f1e3a656ed62a1ad0a9
@@ -264,16 +264,6 @@ static void
}
static void
-jingle_rtp_hangup_cb(PurpleMedia *media, JingleSession *session)
-{
- gchar *sid = jingle_session_get_sid(session);
- jabber_iq_send(jingle_session_to_packet(session, JINGLE_SESSION_TERMINATE));
- g_hash_table_remove(jingle_session_get_js(session)->medias, sid);
- g_free(sid);
- g_object_unref(session);
-}
-
-static void
jingle_rtp_new_candidate_cb(PurpleMedia *media, gchar *sid, gchar *name, FsCandidate *candidate, JingleSession *session)
{
purple_debug_info("jingle-rtp", "jingle_rtp_new_candidate_cb\n");
@@ -334,6 +324,16 @@ jingle_rtp_state_changed_cb(PurpleMedia
gchar *sid, gchar *name, JingleSession *session)
{
purple_debug_info("jingle-rtp", "state-changed: type %d id: %s name: %s\n", type, sid, name);
+
+ if (sid == NULL && name == NULL &&
+ jingle_session_is_initiator(session) == TRUE) {
+ gchar *sid = jingle_session_get_sid(session);
+ jabber_iq_send(jingle_session_to_packet(session,
+ JINGLE_SESSION_TERMINATE));
+ g_hash_table_remove(jingle_session_get_js(session)->medias, sid);
+ g_free(sid);
+ g_object_unref(session);
+ }
}
static PurpleMedia *
@@ -363,10 +363,6 @@ jingle_rtp_create_media(JingleContent *c
g_hash_table_insert(js->medias, sid, media);
/* connect callbacks */
- g_signal_connect(G_OBJECT(media), "reject",
- G_CALLBACK(jingle_rtp_hangup_cb), session);
- g_signal_connect(G_OBJECT(media), "hangup",
- G_CALLBACK(jingle_rtp_hangup_cb), session);
g_signal_connect(G_OBJECT(media), "new-candidate",
G_CALLBACK(jingle_rtp_new_candidate_cb), session);
g_signal_connect(G_OBJECT(media), "candidates-prepared",
More information about the Commits
mailing list