summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Aurich <darkrain42@pidgin.im>2009-04-03 17:36:24 +0000
committerPaul Aurich <darkrain42@pidgin.im>2009-04-03 17:36:24 +0000
commit2e340e540f8ef5c3fb2cb26ba112eef7301a5cf8 (patch)
treea61a4e09dc56925a2daf606e78d47854c37118c4
parent84cb80bb70849514078a5e97eba789e15e4e2f50 (diff)
downloadpidgin-2e340e540f8ef5c3fb2cb26ba112eef7301a5cf8.tar.gz
Fix merge for ./jingle/
-rw-r--r--libpurple/protocols/jabber/jingle/jingle.c24
-rw-r--r--libpurple/protocols/jabber/jingle/jingle.h3
-rw-r--r--libpurple/protocols/jabber/jingle/rtp.c7
3 files changed, 15 insertions, 19 deletions
diff --git a/libpurple/protocols/jabber/jingle/jingle.c b/libpurple/protocols/jabber/jingle/jingle.c
index eb2ad53099..12b51737bf 100644
--- a/libpurple/protocols/jabber/jingle/jingle.c
+++ b/libpurple/protocols/jabber/jingle/jingle.c
@@ -359,28 +359,21 @@ jingle_get_action_type(const gchar *action)
}
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 @@ jingle_parse(JabberStream *js, xmlnode *packet)
/* 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 --git a/libpurple/protocols/jabber/jingle/jingle.h b/libpurple/protocols/jabber/jingle/jingle.h
index 09500270b0..df706029b0 100644
--- a/libpurple/protocols/jabber/jingle/jingle.h
+++ b/libpurple/protocols/jabber/jingle/jingle.h
@@ -69,7 +69,8 @@ JingleActionType jingle_get_action_type(const gchar *action);
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 --git a/libpurple/protocols/jabber/jingle/rtp.c b/libpurple/protocols/jabber/jingle/rtp.c
index 0363ac0138..24ad060c8f 100644
--- a/libpurple/protocols/jabber/jingle/rtp.c
+++ b/libpurple/protocols/jabber/jingle/rtp.c
@@ -438,12 +438,13 @@ jingle_rtp_new_candidate_cb(PurpleMedia *media, gchar *sid, gchar *name, PurpleM
}
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;