# HG changeset patch # User Paul Aurich # Date 1238780184 0 # Node ID 3c684403ea10e8dccc24df874d025c962bc765dc # Parent 91583903b478b903259df49dba41cdcd9abef874 Fix merge for ./jingle/ diff -r 91583903b478 -r 3c684403ea10 libpurple/protocols/jabber/jingle/jingle.c --- a/libpurple/protocols/jabber/jingle/jingle.c Fri Apr 03 17:15:40 2009 +0000 +++ b/libpurple/protocols/jabber/jingle/jingle.c Fri Apr 03 17:36:24 2009 +0000 @@ -359,28 +359,21 @@ } void -jingle_parse(JabberStream *js, xmlnode *packet) +jingle_parse(JabberStream *js, const char *from, JabberIqType type, + const char *id, xmlnode *jingle) { - const gchar *type = xmlnode_get_attrib(packet, "type"); - xmlnode *jingle; const gchar *action; const gchar *sid; JingleActionType action_type; JingleSession *session; - if (!type || strcmp(type, "set")) { - /* send iq error here */ - return; - } - - /* is this a Jingle package? */ - if (!(jingle = xmlnode_get_child(packet, "jingle"))) { - /* send iq error here */ + if (type != JABBER_IQ_SET) { + /* TODO: send iq error here */ return; } if (!(action = xmlnode_get_attrib(jingle, "action"))) { - /* send iq error here */ + /* TODO: send iq error here */ return; } @@ -409,9 +402,10 @@ /* send iq error */ return; } else { - session = jingle_session_create(js, sid, - xmlnode_get_attrib(packet, "to"), - xmlnode_get_attrib(packet, "from"), FALSE); + char *own_jid = g_strdup_printf("%s@%s/%s", js->user->node, + js->user->domain, js->user->resource); + session = jingle_session_create(js, sid, own_jid, from, FALSE); + g_free(own_jid); } } diff -r 91583903b478 -r 3c684403ea10 libpurple/protocols/jabber/jingle/jingle.h --- a/libpurple/protocols/jabber/jingle/jingle.h Fri Apr 03 17:15:40 2009 +0000 +++ b/libpurple/protocols/jabber/jingle/jingle.h Fri Apr 03 17:36:24 2009 +0000 @@ -69,7 +69,8 @@ GType jingle_get_type(const gchar *type); -void jingle_parse(JabberStream *js, xmlnode *packet); +void jingle_parse(JabberStream *js, const char *from, JabberIqType type, + const char *id, xmlnode *child); void jingle_terminate_sessions(JabberStream *js); diff -r 91583903b478 -r 3c684403ea10 libpurple/protocols/jabber/jingle/rtp.c --- a/libpurple/protocols/jabber/jingle/rtp.c Fri Apr 03 17:15:40 2009 +0000 +++ b/libpurple/protocols/jabber/jingle/rtp.c Fri Apr 03 17:36:24 2009 +0000 @@ -438,12 +438,13 @@ } static void -jingle_rtp_initiate_ack_cb(JabberStream *js, xmlnode *packet, gpointer data) +jingle_rtp_initiate_ack_cb(JabberStream *js, const char *from, + JabberIqType type, const char *id, + xmlnode *packet, gpointer data) { JingleSession *session = data; - if (!strcmp(xmlnode_get_attrib(packet, "type"), "error") || - xmlnode_get_child(packet, "error")) { + if (type == JABBER_IQ_ERROR || xmlnode_get_child(packet, "error")) { purple_media_end(jingle_rtp_get_media(session), NULL, NULL); g_object_unref(session); return;