# HG changeset patch # User Elliott Sales de Andrade # Date 1241395324 0 # Node ID de4393eba4975dfb987edfc6f933776dfbd0c519 # Parent c56debe9ae4f3fcf48656bbd06ccdeff65ffafb6# Parent 1a1765a87336dbe0a42eb268fd0940811b6765fb merge of 'c2b098e0aaf7e6fffec72b3130cb4c851c7a64c1' and 'ff639e31b359f9399c39cfaa0f02ca3c57686d7b' diff -r c56debe9ae4f -r de4393eba497 libpurple/protocols/msn/notification.c --- a/libpurple/protocols/msn/notification.c Sat May 02 23:30:49 2009 +0000 +++ b/libpurple/protocols/msn/notification.c Mon May 04 00:02:04 2009 +0000 @@ -612,8 +612,19 @@ static void update_contact_network(MsnSession *session, const char *passport, MsnNetwork network) { - MsnUser *user = msn_userlist_find_user(session->userlist, passport); + MsnUser *user; + + if (network == MSN_NETWORK_UNKNOWN) + { + purple_debug_warning("msn", + "Ignoring user %s about which server knows nothing.\n", + passport); + session->adl_fqy--; + return; + } + /* TODO: Also figure out how to update membership lists */ + user = msn_userlist_find_user(session->userlist, passport); if (user) { xmlnode *adl_node; char *payload; @@ -774,13 +785,17 @@ purple_debug_info("msn", "Invalid XML in ADL!\n"); return; } - for (domain_node = xmlnode_get_child(root, "d"); domain_node; domain_node = xmlnode_get_next_twin(domain_node)) { + for (domain_node = xmlnode_get_child(root, "d"); + domain_node; + domain_node = xmlnode_get_next_twin(domain_node)) { const gchar * domain = NULL; xmlnode *contact_node = NULL; domain = xmlnode_get_attrib(domain_node, "n"); - for (contact_node = xmlnode_get_child(domain_node, "c"); contact_node; contact_node = xmlnode_get_next_twin(contact_node)) { + for (contact_node = xmlnode_get_child(domain_node, "c"); + contact_node; + contact_node = xmlnode_get_next_twin(contact_node)) { const gchar *list; gint list_op = 0; @@ -942,10 +957,10 @@ passport = g_strdup_printf("%s@%s", local, domain); - if (type != NULL) + if (!g_ascii_isdigit(cmd->command[0]) && type != NULL) network = (MsnNetwork)strtoul(type, NULL, 10); else - network = MSN_NETWORK_PASSPORT; + network = MSN_NETWORK_UNKNOWN; purple_debug_info("msn", "FQY response says %s is from network %d\n", passport, network); @@ -960,6 +975,26 @@ } static void +fqy_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) +{ + MsnCommand *cmd = cmdproc->last_cmd; + + purple_debug_warning("msn", "FQY error %d\n", error); + if (cmd->param_count > 1) { + cmd->payload_cb = fqy_cmd_post; + cmd->payload_len = atoi(cmd->params[1]); + cmd->payload_cbdata = GINT_TO_POINTER(error); + } +#if 0 + /* If the server didn't send us a corresponding email address for this + FQY error, it's probably going to disconnect us. So it isn't necessary + to tell the handler about it. */ + else if (trans->data) + ((MsnFqyCb)trans->data)(session, NULL, MSN_NETWORK_UNKNOWN); */ +#endif +} + +static void fqy_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) { purple_debug_info("msn", "Process FQY\n"); @@ -2153,6 +2188,7 @@ msn_table_add_error(cbs_table, "ADD", add_error); msn_table_add_error(cbs_table, "ADL", adl_error); + msn_table_add_error(cbs_table, "FQY", fqy_error); msn_table_add_error(cbs_table, "REG", reg_error); msn_table_add_error(cbs_table, "RMG", rmg_error); msn_table_add_error(cbs_table, "USR", usr_error);