diff libpurple/protocols/jabber/iq.c @ 23807:ff29208e03ef

propagate from branch 'im.pidgin.pidgin' (head 75f0460d3679231b61d572e76fe02534a597c6b5) to branch 'im.pidgin.pidgin.vv' (head 7872d32a910cd4c1fbc3e2457295e4c1d40188f5)
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 27 May 2008 06:27:46 +0000
parents c6ba0a7028f4 92e71f6e10d4
children 10f5a529d2a6
line wrap: on
line diff
--- a/libpurple/protocols/jabber/iq.c	Tue May 27 04:11:04 2008 +0000
+++ b/libpurple/protocols/jabber/iq.c	Tue May 27 06:27:46 2008 +0000
@@ -313,7 +313,7 @@
 	const char *xmlns;
 	const char *type, *id, *from;
 	JabberIqHandler *jih;
-
+	
 	query = xmlnode_get_child(packet, "query");
 	type = xmlnode_get_attrib(packet, "type");
 	from = xmlnode_get_attrib(packet, "from");
@@ -337,6 +337,11 @@
 			return;
 		}
 	}
+	
+	if (xmlnode_get_child_with_namespace(packet, "session", "http://www.google.com/session")) {
+		jabber_google_session_parse(js, packet);
+		return;
+	}
 
 	if(xmlnode_get_child_with_namespace(packet, "si", "http://jabber.org/protocol/si")) {
 		jabber_si_parse(js, packet);
@@ -348,12 +353,37 @@
 		return;
 	}
 	
-	purple_debug_info("jabber", "jabber_iq_parse\n");
-
 	if(xmlnode_get_child_with_namespace(packet, "ping", "urn:xmpp:ping")) {
 		jabber_ping_parse(js, packet);
 		return;
 	}
+	
+#ifdef USE_FARSIGHT
+	/* handle session initiate XEP 0167 */
+	if (type && !strcmp(type, "set")) {
+		/* is this a Jingle package? */
+		xmlnode *jingle = xmlnode_get_child(packet, "jingle");
+		if (jingle) {
+			const char *action = xmlnode_get_attrib(jingle, "action");
+			purple_debug_info("jabber", "got Jingle package action = %s\n",
+							  action);
+			if (!strcmp(action, "session-initiate")) {
+				jabber_handle_session_initiate(js, packet);
+			} else if (!strcmp(action, "session-accept")
+					   || !strcmp(action, "content-accept")) {
+				jabber_handle_session_accept(js, packet);
+			} else if (!strcmp(action, "session-terminate")) {
+				jabber_handle_session_terminate(js, packet);
+			} else if (!strcmp(action, "transport-info")) {
+				jabber_handle_session_candidates(js, packet);
+			} else if (!strcmp(action, "content-replace")) {
+				jabber_handle_session_content_replace(js, packet);
+			}
+
+			return;
+		}
+	}
+#endif
 
 	/* If we get here, send the default error reply mandated by XMPP-CORE */
 	if(type && (!strcmp(type, "set") || !strcmp(type, "get"))) {