Mercurial > pidgin
changeset 32498:4542143a38b2
Drop support for protocols below 18.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Mon, 06 Feb 2012 22:24:04 +0000 |
parents | 30a92ba1c39f |
children | 585447a5f83c |
files | libpurple/protocols/msn/contact.c libpurple/protocols/msn/msn.c libpurple/protocols/msn/notification.c libpurple/protocols/msn/session.c libpurple/protocols/msn/state.c libpurple/protocols/msn/switchboard.c |
diffstat | 6 files changed, 52 insertions(+), 77 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c Mon Feb 06 21:44:41 2012 +0000 +++ b/libpurple/protocols/msn/contact.c Mon Feb 06 22:24:04 2012 +0000 @@ -865,6 +865,21 @@ g_free(alias); } +static void +msn_parse_addressbook_circles(MsnSession *session, xmlnode *node) +{ + xmlnode *ticket; + + /* TODO: Parse groups */ + + ticket = xmlnode_get_child(node, "CircleTicket"); + if (ticket) { + char *data = xmlnode_get_data(ticket); + msn_notification_send_circle_auth(session, data); + g_free(data); + } +} + static gboolean msn_parse_addressbook(MsnSession *session, xmlnode *node) { @@ -956,13 +971,9 @@ g_free(tmp); } - circleNode = xmlnode_get_child(result, "CircleResult/CircleTicket"); - if (circleNode != NULL && session->protocol_ver >= 18) { - char *data; - - data = xmlnode_get_data(circleNode); - msn_notification_send_circle_auth(session, data); - g_free(data); + circleNode = xmlnode_get_child(result, "CircleResult"); + if (circleNode != NULL) { + msn_parse_addressbook_circles(session, circleNode); } return TRUE;
--- a/libpurple/protocols/msn/msn.c Mon Feb 06 21:44:41 2012 +0000 +++ b/libpurple/protocols/msn/msn.c Mon Feb 06 22:24:04 2012 +0000 @@ -1223,7 +1223,7 @@ m = g_list_append(m, act); m = g_list_append(m, NULL); - if (session->enable_mpop && session->protocol_ver >= 16) + if (session->enable_mpop) { act = purple_plugin_action_new(_("View Locations..."), msn_show_locations);
--- a/libpurple/protocols/msn/notification.c Mon Feb 06 21:44:41 2012 +0000 +++ b/libpurple/protocols/msn/notification.c Mon Feb 06 22:24:04 2012 +0000 @@ -164,10 +164,7 @@ msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_END); - if (session->protocol_ver >= 16) - trans = msn_transaction_new(cmdproc, "USR", "SSO S %s %s %s", ticket, response, session->guid); - else - trans = msn_transaction_new(cmdproc, "USR", "SSO S %s %s", ticket, response); + trans = msn_transaction_new(cmdproc, "USR", "SSO S %s %s %s", ticket, response, session->guid); msn_cmdproc_send_trans(cmdproc, trans); } @@ -401,10 +398,7 @@ * command and we are processing it */ if (cmd->payload == NULL) { cmdproc->last_cmd->payload_cb = msg_cmd_post; - if (cmdproc->session->protocol_ver >= 16) - cmd->payload_len = atoi(cmd->params[5]); - else - cmd->payload_len = atoi(cmd->params[3]); + cmd->payload_len = atoi(cmd->params[5]); } else { g_return_if_fail(cmd->payload_cb != NULL); @@ -1053,7 +1047,7 @@ networkid = atoi(cmd->params[3]); friendly = g_strdup(purple_url_decode(cmd->params[4])); clientid = strtoul(cmd->params[5], &extcap_str, 10); - if (session->protocol_ver >= 16 && extcap_str && *extcap_str) + if (extcap_str && *extcap_str) extcaps = strtoul(extcap_str+1, NULL, 10); else extcaps = 0; @@ -1067,7 +1061,7 @@ networkid = atoi(cmd->params[3]); friendly = g_strdup(purple_url_decode(cmd->params[4])); clientid = strtoul(cmd->params[5], &extcap_str, 10); - if (session->protocol_ver >= 16 && extcap_str && *extcap_str) + if (extcap_str && *extcap_str) extcaps = strtoul(extcap_str+1, NULL, 10); else extcaps = 0; @@ -1080,7 +1074,7 @@ networkid = atoi(cmd->params[3]); friendly = g_strdup(purple_url_decode(cmd->params[4])); clientid = strtoul(cmd->params[5], &extcap_str, 10); - if (session->protocol_ver >= 16 && extcap_str && *extcap_str) + if (extcap_str && *extcap_str) extcaps = strtoul(extcap_str+1, NULL, 10); else extcaps = 0; @@ -1088,7 +1082,7 @@ /* MSNP8+ with Display Picture object */ friendly = g_strdup(purple_url_decode(cmd->params[3])); clientid = strtoul(cmd->params[4], &extcap_str, 10); - if (session->protocol_ver >= 16 && extcap_str && *extcap_str) + if (extcap_str && *extcap_str) extcaps = strtoul(extcap_str+1, NULL, 10); else extcaps = 0; @@ -1098,7 +1092,7 @@ /* MSNP8+ without Display Picture object */ friendly = g_strdup(purple_url_decode(cmd->params[3])); clientid = strtoul(cmd->params[4], &extcap_str, 10); - if (session->protocol_ver >= 16 && extcap_str && *extcap_str) + if (extcap_str && *extcap_str) extcaps = strtoul(extcap_str+1, NULL, 10); else extcaps = 0; @@ -1267,16 +1261,9 @@ session = cmdproc->session; - state = cmd->params[0]; - if (session->protocol_ver >= 18) { - const char *tmp = cmd->params[1]; - msn_parse_user(tmp, &passport, &networkid); - friendly = purple_url_decode(cmd->params[2]); - } else { - passport = cmd->params[1]; - networkid = atoi(cmd->params[2]); - friendly = purple_url_decode(cmd->params[3]); - } + state = cmd->params[0]; + msn_parse_user(cmd->params[1], &passport, &networkid); + friendly = purple_url_decode(cmd->params[2]); user = msn_userlist_find_user(session->userlist, passport); if (user == NULL) return; @@ -1297,7 +1284,7 @@ } clientid = strtoul(cmd->params[4], &extcap_str, 10); - if (session->protocol_ver >= 16 && extcap_str && *extcap_str) + if (extcap_str && *extcap_str) extcaps = strtoul(extcap_str+1, NULL, 10); else extcaps = 0; @@ -1311,8 +1298,7 @@ msn_user_set_state(user, state); msn_user_update(user); - if (session->protocol_ver >= 18) - g_free(passport); + g_free(passport); } #if 0 @@ -1733,23 +1719,19 @@ session = cmdproc->session; - if (session->protocol_ver >= 18) { - str = cmd->params[0]; - msn_parse_user(str, &passport, &network); - } else { - passport = cmd->params[0]; - } + msn_parse_user(cmd->params[0], &passport, &network); user = msn_userlist_find_user(session->userlist, passport); + if (user == NULL) { - char *str = g_strndup(payload, len); + str = g_strndup(payload, len); purple_debug_info("msn", "unknown user %s, payload is %s\n", passport, str); + g_free(passport); g_free(str); return; } - if (session->protocol_ver >= 18) - g_free(passport); + g_free(passport); /* Free any existing media info for this user */ if (user->extinfo) { @@ -1797,10 +1779,7 @@ { purple_debug_misc("msn", "UBX received.\n"); cmdproc->last_cmd->payload_cb = ubx_cmd_post; - if (cmdproc->session->protocol_ver >= 18) - cmd->payload_len = atoi(cmd->params[1]); - else - cmd->payload_len = atoi(cmd->params[2]); + cmd->payload_len = atoi(cmd->params[1]); } static void @@ -1845,10 +1824,7 @@ epDataNode = xmlnode_new("EndpointData"); capNode = xmlnode_new_child(epDataNode, "Capabilities"); - if (session->protocol_ver >= 16) - caps = g_strdup_printf("%d:%02d", MSN_CLIENT_ID_CAPABILITIES, MSN_CLIENT_ID_EXT_CAPS); - else - caps = g_strdup_printf("%d", MSN_CLIENT_ID_CAPABILITIES); + caps = g_strdup_printf("%d:%02d", MSN_CLIENT_ID_CAPABILITIES, MSN_CLIENT_ID_EXT_CAPS); xmlnode_insert_data(capNode, caps, -1); g_free(caps);
--- a/libpurple/protocols/msn/session.c Mon Feb 06 21:44:41 2012 +0000 +++ b/libpurple/protocols/msn/session.c Mon Feb 06 22:24:04 2012 +0000 @@ -491,11 +491,10 @@ msn_session_sync_users(session); } - if (session->protocol_ver >= 16) { - /* TODO: Send this when updating status instead? */ - msn_notification_send_uux_endpointdata(session); - msn_notification_send_uux_private_endpointdata(session); - } + /* TODO: Send this when updating status instead? */ + msn_notification_send_uux_endpointdata(session); + msn_notification_send_uux_private_endpointdata(session); + msn_change_status(session); }
--- a/libpurple/protocols/msn/state.c Mon Feb 06 21:44:41 2012 +0000 +++ b/libpurple/protocols/msn/state.c Mon Feb 06 22:24:04 2012 +0000 @@ -186,7 +186,7 @@ statusline_stripped = purple_markup_strip_html(statusline); media = create_media_string(presence); g_free(session->psm); - session->psm = msn_build_psm(statusline_stripped, media, session->protocol_ver >= 16 ? session->guid : NULL, session->protocol_ver); + session->psm = msn_build_psm(statusline_stripped, media, session->guid, session->protocol_ver); payload = session->psm; @@ -245,10 +245,8 @@ if (msnobj == NULL) { - if (session->protocol_ver >= 16) - trans = msn_transaction_new(cmdproc, "CHG", "%s %u:%02u 0", state_text, caps, MSN_CLIENT_ID_EXT_CAPS); - else - trans = msn_transaction_new(cmdproc, "CHG", "%s %u", state_text, caps); + trans = msn_transaction_new(cmdproc, "CHG", "%s %u:%02u 0", state_text, + caps, MSN_CLIENT_ID_EXT_CAPS); } else { @@ -256,12 +254,9 @@ msnobj_str = msn_object_to_string(msnobj); - if (session->protocol_ver >= 16) - trans = msn_transaction_new(cmdproc, "CHG", "%s %u:%02u %s", state_text, - caps, MSN_CLIENT_ID_EXT_CAPS, purple_url_encode(msnobj_str)); - else - trans = msn_transaction_new(cmdproc, "CHG", "%s %u %s", state_text, - caps, purple_url_encode(msnobj_str)); + trans = msn_transaction_new(cmdproc, "CHG", "%s %u:%02u %s", state_text, + caps, MSN_CLIENT_ID_EXT_CAPS, + purple_url_encode(msnobj_str)); g_free(msnobj_str); }
--- a/libpurple/protocols/msn/switchboard.c Mon Feb 06 21:44:41 2012 +0000 +++ b/libpurple/protocols/msn/switchboard.c Mon Feb 06 22:24:04 2012 +0000 @@ -707,10 +707,7 @@ ubm_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) { purple_debug_misc("msn", "get UBM...\n"); - if (cmdproc->session->protocol_ver >= 16) - cmd->payload_len = atoi(cmd->params[5]); - else - cmd->payload_len = atoi(cmd->params[3]); + cmd->payload_len = atoi(cmd->params[5]); cmdproc->last_cmd->payload_cb = msg_cmd_post; } @@ -867,12 +864,9 @@ swboard = cmdproc->data; g_return_if_fail(swboard != NULL); - if (servconn->session->protocol_ver >= 16) - username = g_strdup_printf("%s;{%s}", - purple_account_get_username(account), - servconn->session->guid); - else - username = g_strdup(purple_account_get_username(account)); + username = g_strdup_printf("%s;{%s}", + purple_account_get_username(account), + servconn->session->guid); if (msn_switchboard_is_invited(swboard)) {