# HG changeset patch # User Elliott Sales de Andrade # Date 1244254352 0 # Node ID 0901c366228659eaa370b8389d91a02fcc5486ba # Parent e6ba07a72fd8e5a8712c1a5b33b9b1dbeefb11ab Make XMPP Disco plugin show better errors when getting a 404-like return. diff -r e6ba07a72fd8 -r 0901c3662286 pidgin/plugins/disco/xmppdisco.c --- a/pidgin/plugins/disco/xmppdisco.c Sat Jun 06 01:42:15 2009 +0000 +++ b/pidgin/plugins/disco/xmppdisco.c Sat Jun 06 02:12:32 2009 +0000 @@ -473,6 +473,7 @@ struct item_data *cb_data = data; PidginDiscoList *list = cb_data->list; xmlnode *query; + xmlnode *error; gboolean items = FALSE; --list->fetch_count; @@ -489,16 +490,26 @@ break; } } + + if (items) { + xmpp_disco_items_do(pc, cb_data, from, NULL /* node */, server_items_cb); + ++list->fetch_count; + pidgin_disco_list_ref(list); + } } - - if (items) { - xmpp_disco_items_do(pc, cb_data, from, NULL /* node */, server_items_cb); - ++list->fetch_count; - pidgin_disco_list_ref(list); - } else { - purple_notify_error(my_plugin, _("Error"), - _("Server does not support service discovery"), - NULL); + else { + error = xmlnode_get_child(iq, "error"); + if (xmlnode_get_child(error, "remote-server-not-found") + || xmlnode_get_child(error, "jid-malformed")) { + purple_notify_error(my_plugin, _("Error"), + _("Server does not exist"), + NULL); + } + else { + purple_notify_error(my_plugin, _("Error"), + _("Server does not support service discovery"), + NULL); + } pidgin_disco_list_set_in_progress(list, FALSE); g_free(cb_data); }