# HG changeset patch # User Paul Aurich # Date 1268176306 0 # Node ID 32fe87f58d06fe05a3d880813ca5f6ab78d785b5 # Parent 618c4165d4f8739b15f29450e82c00d041378b24 jabber: Backward compatibility in case any servers advertise other random 0.## versions diff -r 618c4165d4f8 -r 32fe87f58d06 libpurple/protocols/jabber/parser.c --- a/libpurple/protocols/jabber/parser.c Tue Mar 09 23:09:54 2010 +0000 +++ b/libpurple/protocols/jabber/parser.c Tue Mar 09 23:11:46 2010 +0000 @@ -55,7 +55,6 @@ js->protocol_version.major = atoi(attrib); js->protocol_version.minor = dot ? atoi(dot + 1) : 0; - g_free(attrib); /* TODO: Check this against the spec; I'm not sure if the check * against minor is accurate. @@ -64,6 +63,12 @@ purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE, _("XMPP Version Mismatch")); + + if (js->protocol_version.major == 0 && js->protocol_version.minor != 9) { + purple_debug_warning("jabber", "Treating version %s as 0.9 for backward " + "compatibility\n", attrib); + } + g_free(attrib); } else if(!xmlStrcmp(attributes[i], (xmlChar*) "id")) { g_free(js->stream_id); js->stream_id = attrib;