pidgin: 1256de56: disapproval of revision '8a80f271858548f...

qulogic at pidgin.im qulogic at pidgin.im
Sat Feb 7 22:05:27 EST 2009


-----------------------------------------------------------------
Revision: 1256de56bf55d28698fb946db0dc7fc965f4713b
Ancestor: 8a80f271858548f73cac50625660e87df1970bcc
Author: qulogic at pidgin.im
Date: 2009-02-08T00:23:13
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/1256de56bf55d28698fb946db0dc7fc965f4713b

Modified files:
        libpurple/protocols/jabber/data.c
        libpurple/protocols/jabber/data.h
        libpurple/protocols/jabber/google.c
        libpurple/protocols/jabber/google.h
        libpurple/protocols/jabber/iq.c
        libpurple/protocols/jabber/ping.c
        libpurple/protocols/jabber/ping.h
        libpurple/protocols/jabber/si.c
        libpurple/protocols/jabber/si.h

ChangeLog: 

disapproval of revision '8a80f271858548f73cac50625660e87df1970bcc'
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/data.c	b31d350c17f5f2d4cd57864e4bd5392f3b9aa95c
+++ libpurple/protocols/jabber/data.c	479b5c3440f041763c657afda16047f8880745eb
@@ -200,9 +200,11 @@ void
 }
 
 void
-jabber_data_parse(JabberStream *js, xmlnode *data_node, const char *who, const char *id)
+jabber_data_parse(JabberStream *js, xmlnode *packet)
 {
 	JabberIq *result = NULL;
+	const char *who = xmlnode_get_attrib(packet, "from");
+	xmlnode *data_node = xmlnode_get_child(packet, "data");
 	const JabberData *data =
 		jabber_data_find_local_by_cid(xmlnode_get_attrib(data_node, "cid"));
 
@@ -211,12 +213,12 @@ jabber_data_parse(JabberStream *js, xmln
 
 		result = jabber_iq_new(js, JABBER_IQ_ERROR);
 		xmlnode_set_attrib(result->node, "to", who);
-		xmlnode_set_attrib(result->node, "id", id);
+		xmlnode_set_attrib(result->node, "id", xmlnode_get_attrib(packet, "id"));
 		xmlnode_insert_child(result->node, item_not_found);
 	} else {
 		result = jabber_iq_new(js, JABBER_IQ_RESULT);
 		xmlnode_set_attrib(result->node, "to", who);
-		xmlnode_set_attrib(result->node, "id", id);
+		xmlnode_set_attrib(result->node, "id", xmlnode_get_attrib(packet, "id"));
 		xmlnode_insert_child(result->node,
 							 jabber_data_get_xml_definition(data));
 	}
============================================================
--- libpurple/protocols/jabber/data.h	ccc56e2e70e42d453eb4ad5932d1595345e0d7c6
+++ libpurple/protocols/jabber/data.h	4e41b1878db90fbb1cd27d32fa73d7d2bee9be5e
@@ -65,8 +65,7 @@ void jabber_data_associate_remote(Jabber
 void jabber_data_associate_remote(JabberData *data);
 
 /* handles iq requests */
-void jabber_data_parse(JabberStream *js, xmlnode *data_node,
-                       const char *who, const char *id);
+void jabber_data_parse(JabberStream *js, xmlnode *packet);
 
 void jabber_data_init(void);
 void jabber_data_uninit(void);
============================================================
--- libpurple/protocols/jabber/google.c	a1b31b5647c3b999fe092afa58d4c79930c3cce2
+++ libpurple/protocols/jabber/google.c	f0624dcce3f7675f95224023738a5bc83d8f8fbb
@@ -144,8 +144,9 @@ void
 }
 
 void
-jabber_gmail_poke(JabberStream *js, const char *type)
+jabber_gmail_poke(JabberStream *js, xmlnode *packet)
 {
+	const char *type;
 	xmlnode *query;
 	JabberIq *iq;
 
@@ -153,8 +154,11 @@ jabber_gmail_poke(JabberStream *js, cons
 	if (!purple_account_get_check_mail(js->gc->account))
 		return;
 
+	type = xmlnode_get_attrib(packet, "type");
+
+
 	/* Is this an initial incoming mail notification? If so, send a request for more info */
-	if (strcmp(type, "set"))
+	if (strcmp(type, "set") || !xmlnode_get_child(packet, "new-mail"))
 		return;
 
 	purple_debug(PURPLE_DEBUG_MISC, "jabber",
============================================================
--- libpurple/protocols/jabber/google.h	72bedbbf105fcad0d6be1f6f37176229dd661957
+++ libpurple/protocols/jabber/google.h	07da034a30ee0cda826d180de291cf48ed3b8126
@@ -27,7 +27,7 @@ void jabber_gmail_init(JabberStream *js)
 #include "jabber.h"
 
 void jabber_gmail_init(JabberStream *js);
-void jabber_gmail_poke(JabberStream *js, const char *type);
+void jabber_gmail_poke(JabberStream *js, xmlnode *node);
 
 void jabber_google_roster_init(JabberStream *js);
 void jabber_google_roster_outgoing(JabberStream *js, xmlnode *query, xmlnode *item);
============================================================
--- libpurple/protocols/jabber/iq.c	4ca7540f6491fcb265dc05a7626a973a8ed05d65
+++ libpurple/protocols/jabber/iq.c	f5aad0682a60133a2e72d09670855a31de4ac71a
@@ -309,7 +309,7 @@ void jabber_iq_parse(JabberStream *js, x
 void jabber_iq_parse(JabberStream *js, xmlnode *packet)
 {
 	JabberCallbackData *jcd;
-	xmlnode *child, *query, *error, *x;
+	xmlnode *query, *error, *x;
 	const char *xmlns;
 	const char *type, *id, *from;
 	JabberIqHandler *jih;
@@ -371,25 +371,25 @@ void jabber_iq_parse(JabberStream *js, x
 		}
 	}
 
-	if ((child = xmlnode_get_child_with_namespace(packet, "si", "http://jabber.org/protocol/si"))) {
-		jabber_si_parse(js, child, from, id);
+	if(xmlnode_get_child_with_namespace(packet, "si", "http://jabber.org/protocol/si")) {
+		jabber_si_parse(js, packet);
 		return;
 	}
 
-	if (xmlnode_get_child_with_namespace(packet, "new-mail", "google:mail:notify")) {
-		jabber_gmail_poke(js, type);
+	if(xmlnode_get_child_with_namespace(packet, "new-mail", "google:mail:notify")) {
+		jabber_gmail_poke(js, packet);
 		return;
 	}
 
 	purple_debug_info("jabber", "jabber_iq_parse\n");
 
-	if (xmlnode_get_child_with_namespace(packet, "ping", "urn:xmpp:ping")) {
-		jabber_ping_parse(js, from, id);
+	if(xmlnode_get_child_with_namespace(packet, "ping", "urn:xmpp:ping")) {
+		jabber_ping_parse(js, packet);
 		return;
 	}
 
-	if ((child = xmlnode_get_child_with_namespace(packet, "data", XEP_0231_NAMESPACE))) {
-		jabber_data_parse(js, child, from, id);
+	if (xmlnode_get_child_with_namespace(packet, "data", XEP_0231_NAMESPACE)) {
+		jabber_data_parse(js, packet);
 		return;
 	}
 
============================================================
--- libpurple/protocols/jabber/ping.c	fc83cbf0b836a7ffa2cdbf02b54be53dc15cde10
+++ libpurple/protocols/jabber/ping.c	4815c966a6e9665f6fef0da7c235ed20c310a90d
@@ -30,7 +30,7 @@ void
 #include "iq.h"
 
 void
-jabber_ping_parse(JabberStream *js, const char *from, const char *id)
+jabber_ping_parse(JabberStream *js, xmlnode *packet)
 {
 	JabberIq *iq;
 
@@ -38,9 +38,9 @@ jabber_ping_parse(JabberStream *js, cons
 
 	iq = jabber_iq_new(js, JABBER_IQ_RESULT);
 
-	xmlnode_set_attrib(iq->node, "to", from);
+	xmlnode_set_attrib(iq->node, "to", xmlnode_get_attrib(packet, "from") );
 
-	jabber_iq_set_id(iq, id);
+	jabber_iq_set_id(iq, xmlnode_get_attrib(packet, "id"));
 
 	jabber_iq_send(iq);
 }
============================================================
--- libpurple/protocols/jabber/ping.h	a624d1139f5574c5ab0f3fa85c3ccb698ecf4cef
+++ libpurple/protocols/jabber/ping.h	40882a772ad4d66936f6543ed7b4d3dc09ed264c
@@ -26,8 +26,7 @@ void jabber_ping_parse(JabberStream *js,
 #include "conversation.h"
 
 void jabber_ping_parse(JabberStream *js,
-                       const char *from,
-                       const char *id);
+						xmlnode *packet);
 
 
 gboolean jabber_ping_jid(PurpleConversation *conv, const char *jid);
============================================================
--- libpurple/protocols/jabber/si.c	dbf524d9f05889a868f1ed2d67c3e88f4023841b
+++ libpurple/protocols/jabber/si.c	89f1f349908491771cadac3c2ba0fbf7c247688b
@@ -1182,14 +1182,17 @@ void jabber_si_xfer_send(PurpleConnectio
 		purple_xfer_request(xfer);
 }
 
-void jabber_si_parse(JabberStream *js, xmlnode *si, const char *from, const char *id)
+void jabber_si_parse(JabberStream *js, xmlnode *packet)
 {
 	JabberSIXfer *jsx;
 	PurpleXfer *xfer;
-	xmlnode *file, *feature, *x, *field, *option, *value;
-	const char *stream_id, *filename, *filesize_c, *profile;
+	xmlnode *si, *file, *feature, *x, *field, *option, *value;
+	const char *stream_id, *filename, *filesize_c, *profile, *from;
 	size_t filesize = 0;
 
+	if(!(si = xmlnode_get_child(packet, "si")))
+		return;
+
 	if(!(profile = xmlnode_get_attrib(si, "profile")) ||
 			strcmp(profile, "http://jabber.org/protocol/si/profile/file-transfer"))
 		return;
@@ -1212,7 +1215,7 @@ void jabber_si_parse(JabberStream *js, x
 	if(!(x = xmlnode_get_child_with_namespace(feature, "x", "jabber:x:data")))
 		return;
 
-	if(!from)
+	if(!(from = xmlnode_get_attrib(packet, "from")))
 		return;
 
 	/* if they've already sent us this file transfer with the same damn id
@@ -1253,7 +1256,7 @@ void jabber_si_parse(JabberStream *js, x
 
 	jsx->js = js;
 	jsx->stream_id = g_strdup(stream_id);
-	jsx->iq_id = g_strdup(id);
+	jsx->iq_id = g_strdup(xmlnode_get_attrib(packet, "id"));
 
 	xfer = purple_xfer_new(js->gc->account, PURPLE_XFER_RECEIVE, from);
 	if (xfer)
============================================================
--- libpurple/protocols/jabber/si.h	5bcfccfa6683df98379c9fe4702c78c8bf945a31
+++ libpurple/protocols/jabber/si.h	5efdeacc163a9ff870a2234edc0678540596dc74
@@ -27,7 +27,7 @@ void jabber_bytestreams_parse(JabberStre
 #include "jabber.h"
 
 void jabber_bytestreams_parse(JabberStream *js, xmlnode *packet);
-void jabber_si_parse(JabberStream *js, xmlnode *si, const char *from, const char *id);
+void jabber_si_parse(JabberStream *js, xmlnode *packet);
 PurpleXfer *jabber_si_new_xfer(PurpleConnection *gc, const char *who);
 void jabber_si_xfer_send(PurpleConnection *gc, const char *who, const char *file);
 


More information about the Commits mailing list