pidgin.2.4.3: fc4ead56: temporary workaround for too many OIMs, ...

khc at pidgin.im khc at pidgin.im
Thu Jun 19 02:50:49 EDT 2008


-----------------------------------------------------------------
Revision: fc4ead560d02c80793595f57590f7cbbfc7826eb
Ancestor: ab541bcfd0bf3b9fd3510ae22c7aefb37b96092a
Author: khc at pidgin.im
Date: 2008-06-19T06:46:15
Branch: im.pidgin.pidgin.2.4.3
URL: http://d.pidgin.im/viewmtn/revision/info/fc4ead560d02c80793595f57590f7cbbfc7826eb

Modified files:
        libpurple/protocols/msn/oim.c

ChangeLog: 

temporary workaround for too many OIMs, References #5984

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/oim.c	d8c33f9c226561cbcf5ee1c98e6a989ebca5250b
+++ libpurple/protocols/msn/oim.c	a93a7644b8a755f44eff4f534de9ec1dc26f68bb
@@ -462,22 +462,19 @@ msn_oim_get_read_cb(MsnSoapMessage *requ
 	}
 }
 
-/* parse the oim XML data 
- * and post it to the soap server to get the Offline Message
- * */
-void
-msn_parse_oim_msg(MsnOim *oim,const char *xmlmsg)
+static void
+msn_parse_oim_xml(MsnOim *oim, xmlnode *node)
 {
-	xmlnode *node, *mNode;
+ 	xmlnode *mNode;
 	xmlnode *iu_node;
 	MsnSession *session = oim->session;
 
-	purple_debug_info("MSNP14:OIM", "%s\n", xmlmsg);
+ 	g_return_if_fail(node != NULL);
 
-	node = xmlnode_from_str(xmlmsg, -1);
 	if (strcmp(node->name, "MD") != 0) {
+ 		char *xmlmsg = xmlnode_to_str(node, NULL);
 		purple_debug_info("msnoim", "WTF is this? %s\n", xmlmsg);
-		xmlnode_free(node);
+		g_free(xmlmsg);
 		return;
 	}
 
@@ -528,8 +525,27 @@ msn_parse_oim_msg(MsnOim *oim,const char
 		g_free(rtime);
 		g_free(nickname);
 	}
+}
 
-	xmlnode_free(node);
+/* parse the oim XML data
+ * and post it to the soap server to get the Offline Message
+ * */
+void
+msn_parse_oim_msg(MsnOim *oim,const char *xmlmsg)
+{
+	xmlnode *node;
+
+	purple_debug_info("MSNP14:OIM", "%s\n", xmlmsg);
+
+	if (!strcmp(xmlmsg, "too-large")) {
+		/* Too many OIM's to send via NS, so we need to request them
+		 * via SOAP. */
+		purple_debug_info("msnoim", "too many OIMs, not supported yet\n");
+	} else {
+		node = xmlnode_from_str(xmlmsg, -1);
+		msn_parse_oim_xml(oim, node);
+		xmlnode_free(node);
+	}
 }
 
 /*Post to get the Offline Instant Message*/


More information about the Commits mailing list