diff options
author | Elliott Sales de Andrade <qulogic@pidgin.im> | 2010-11-06 03:46:35 +0000 |
---|---|---|
committer | Elliott Sales de Andrade <qulogic@pidgin.im> | 2010-11-06 03:46:35 +0000 |
commit | c7cb199f32732025829f2a1d9c1b27fd34d01d87 (patch) | |
tree | b16e83720cd07918551cd40748625d2ad5f43223 | |
parent | 5d3a450f4bf112311f2b473d3009ca2132353bad (diff) | |
parent | 778aa698ac262484424424a186a9c34568b96d56 (diff) | |
download | pidgin-c7cb199f32732025829f2a1d9c1b27fd34d01d87.tar.gz |
merge of '7c9cabdaa68330083908cad821dbda84b2f50f7e'
and '1ac159463a0d34c07b3fec773b65bd0027fad885'
-rw-r--r-- | libpurple/protocols/msn/cmdproc.c | 56 | ||||
-rw-r--r-- | libpurple/protocols/msn/msg.c | 4 | ||||
-rw-r--r-- | libpurple/protocols/msn/notification.c | 23 | ||||
-rw-r--r-- | libpurple/protocols/msn/slp.c | 4 | ||||
-rw-r--r-- | libpurple/protocols/msn/slpcall.c | 6 | ||||
-rw-r--r-- | libpurple/protocols/msn/switchboard.c | 4 | ||||
-rw-r--r-- | libpurple/protocols/msn/userlist.c | 5 |
7 files changed, 34 insertions, 68 deletions
diff --git a/libpurple/protocols/msn/cmdproc.c b/libpurple/protocols/msn/cmdproc.c index 03d5fe1096..a4202e4a9e 100644 --- a/libpurple/protocols/msn/cmdproc.c +++ b/libpurple/protocols/msn/cmdproc.c @@ -211,37 +211,39 @@ msn_cmdproc_process_msg(MsnCmdProc *cmdproc, MsnMessage *msg) MsnMessage *first = g_hash_table_lookup(cmdproc->multiparts, message_id); chunk = strtol(chunk_text, NULL, 10); - if (first == NULL) { + if (first != NULL) { + if (first->received_chunks != chunk) { + /* + * We received an out of order chunk number (i.e. not the + * next one in the sequence). Not sure if this can happen + * legitimately, but we definitely don't handle it right + * now. + */ + g_hash_table_remove(cmdproc->multiparts, message_id); + return; + } + + /* Chunk is from 1 to total-1 (doesn't count first one) */ + purple_debug_info("msn", "Received chunk %d of %d, message_id: '%s'\n", + chunk + 1, first->total_chunks, message_id); + first->body = g_realloc(first->body, first->body_len + msg->body_len); + memcpy(first->body + first->body_len, msg->body, msg->body_len); + first->body_len += msg->body_len; + first->received_chunks++; + if (first->received_chunks != first->total_chunks) + /* We're waiting for more chunks */ + return; + + /* + * We have all the chunks for this message, great! Send + * it along... The caller takes care of freeing the old one. + */ + msg = first; + } else { purple_debug_error("msn", "Unable to find first chunk of message_id '%s' to correspond with chunk %d.\n", message_id, chunk + 1); - } else if (first->received_chunks != chunk) { - /* - * We received an out of order chunk number (i.e. not the - * next one in the sequence). Not sure if this can happen - * legitimately, but we definitely don't handle it right - * now. - */ - g_hash_table_remove(cmdproc->multiparts, message_id); - return; } - - /* Chunk is from 1 to total-1 (doesn't count first one) */ - purple_debug_info("msn", "Received chunk %d of %d, message_id: '%s'\n", - chunk + 1, first->total_chunks, message_id); - first->body = g_realloc(first->body, first->body_len + msg->body_len); - memcpy(first->body + first->body_len, msg->body, msg->body_len); - first->body_len += msg->body_len; - first->received_chunks++; - if (first->received_chunks != first->total_chunks) - /* We're waiting for more chunks */ - return; - - /* - * We have all the chunks for this message, great! Send - * it along... The caller takes care of freeing the old one. - */ - msg = first; } else { purple_debug_error("msn", "Received MessageId '%s' with no chunk number!\n", message_id); } diff --git a/libpurple/protocols/msn/msg.c b/libpurple/protocols/msn/msg.c index 58c6475647..e127850b34 100644 --- a/libpurple/protocols/msn/msg.c +++ b/libpurple/protocols/msn/msg.c @@ -916,8 +916,6 @@ msn_p2p_msg(MsnCmdProc *cmdproc, MsnMessage *msg) { MsnSession *session; MsnSlpLink *slplink; - const char *data; - gsize len; session = cmdproc->servconn->session; slplink = msn_session_get_slplink(session, msg->remote_user); @@ -940,8 +938,6 @@ msn_p2p_msg(MsnCmdProc *cmdproc, MsnMessage *msg) } } - data = msn_message_get_bin_data(msg, &len); - if (msg->part) { msn_slplink_process_msg(slplink, msg->part); } diff --git a/libpurple/protocols/msn/notification.c b/libpurple/protocols/msn/notification.c index 98f33767ab..0bb93572be 100644 --- a/libpurple/protocols/msn/notification.c +++ b/libpurple/protocols/msn/notification.c @@ -95,7 +95,6 @@ connect_cb(MsnServConn *servconn) MsnCmdProc *cmdproc; MsnSession *session; MsnTransaction *trans; - PurpleAccount *account; GString *vers; const char *ver_str; int i; @@ -104,7 +103,6 @@ connect_cb(MsnServConn *servconn) cmdproc = servconn->cmdproc; session = servconn->session; - account = session->account; vers = g_string_new(""); @@ -189,11 +187,7 @@ cvr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) static void usr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) { - MsnSession *session; - PurpleAccount *account; - - session = cmdproc->session; - account = session->account; + MsnSession *session = cmdproc->session; if (!g_ascii_strcasecmp(cmd->params[1], "OK")) { @@ -732,11 +726,8 @@ adl_cmd_parse(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, 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)) { @@ -1021,8 +1012,6 @@ static void iln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) { MsnSession *session; - PurpleAccount *account; - PurpleConnection *gc; MsnUser *user; MsnObject *msnobj = NULL; unsigned long clientid, extcaps; @@ -1032,8 +1021,6 @@ iln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) char *friendly; session = cmdproc->session; - account = session->account; - gc = purple_account_get_connection(account); state = cmd->params[1]; passport = cmd->params[2]; @@ -1246,8 +1233,6 @@ static void nln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) { MsnSession *session; - PurpleAccount *account; - PurpleConnection *gc; MsnUser *user; MsnObject *msnobj; unsigned long clientid, extcaps; @@ -1256,8 +1241,6 @@ nln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) const char *state, *passport, *friendly; session = cmdproc->session; - account = session->account; - gc = purple_account_get_connection(account); state = cmd->params[0]; passport = cmd->params[1]; @@ -1455,7 +1438,7 @@ rng_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) swboard = msn_switchboard_new(session); msn_switchboard_set_invited(swboard, TRUE); - msn_switchboard_set_session_id(swboard, cmd->params[0]); + msn_switchboard_set_session_id(swboard, session_id); msn_switchboard_set_auth_key(swboard, cmd->params[3]); swboard->im_user = g_strdup(cmd->params[4]); /* msn_switchboard_add_user(swboard, cmd->params[4]); */ @@ -1696,14 +1679,12 @@ ubx_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len) { MsnSession *session; - PurpleAccount *account; MsnUser *user; const char *passport; xmlnode *payloadNode; char *psm_str, *str; session = cmdproc->session; - account = session->account; passport = cmd->params[0]; if (g_str_equal(passport, session->user->passport)) diff --git a/libpurple/protocols/msn/slp.c b/libpurple/protocols/msn/slp.c index 6bf14e0176..159613c3f8 100644 --- a/libpurple/protocols/msn/slp.c +++ b/libpurple/protocols/msn/slp.c @@ -118,7 +118,6 @@ static void got_user_display(MsnSlpCall *slpcall, const guchar *data, gsize size) { - MsnUserList *userlist; const char *info; PurpleAccount *account; @@ -128,7 +127,6 @@ got_user_display(MsnSlpCall *slpcall, if (purple_debug_is_verbose()) purple_debug_info("msn", "Got User Display: %s\n", slpcall->slplink->remote_user); - userlist = slpcall->slplink->session->userlist; account = slpcall->slplink->session->account; purple_buddy_icons_set_for_user(account, slpcall->slplink->remote_user, @@ -198,7 +196,7 @@ request_own_user_display(MsnUser *user) MsnSession *session; MsnObject *my_obj = NULL; gconstpointer data = NULL; - const char *info; + const char *info = NULL; size_t len = 0; if (purple_debug_is_verbose()) diff --git a/libpurple/protocols/msn/slpcall.c b/libpurple/protocols/msn/slpcall.c index 3dae90f344..c46d7057ec 100644 --- a/libpurple/protocols/msn/slpcall.c +++ b/libpurple/protocols/msn/slpcall.c @@ -567,8 +567,7 @@ got_sessionreq(MsnSlpCall *slpcall, const char *branch, } else if (!strcmp(euf_guid, MSN_CAM_REQUEST_GUID)) { purple_debug_info("msn", "Cam request.\n"); - if (slpcall && slpcall->slplink && - slpcall->slplink->session) { + if (slpcall->slplink && slpcall->slplink->session) { PurpleConversation *conv; gchar *from = slpcall->slplink->remote_user; conv = purple_find_conversation_with_account( @@ -590,8 +589,7 @@ got_sessionreq(MsnSlpCall *slpcall, const char *branch, } else if (!strcmp(euf_guid, MSN_CAM_GUID)) { purple_debug_info("msn", "Cam invite.\n"); - if (slpcall && slpcall->slplink && - slpcall->slplink->session) { + if (slpcall->slplink && slpcall->slplink->session) { PurpleConversation *conv; gchar *from = slpcall->slplink->remote_user; conv = purple_find_conversation_with_account( diff --git a/libpurple/protocols/msn/switchboard.c b/libpurple/protocols/msn/switchboard.c index 1f89cedd46..f875a35ecf 100644 --- a/libpurple/protocols/msn/switchboard.c +++ b/libpurple/protocols/msn/switchboard.c @@ -677,11 +677,9 @@ static void iro_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) { PurpleAccount *account; - PurpleConnection *gc; MsnSwitchBoard *swboard; account = cmdproc->session->account; - gc = account->gc; swboard = cmdproc->data; swboard->total_users = atoi(cmd->params[2]); @@ -694,7 +692,6 @@ joi_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) { MsnSession *session; PurpleAccount *account; - PurpleConnection *gc; MsnSwitchBoard *swboard; const char *passport; @@ -702,7 +699,6 @@ joi_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) session = cmdproc->session; account = session->account; - gc = account->gc; swboard = cmdproc->data; msn_switchboard_add_user(swboard, passport); diff --git a/libpurple/protocols/msn/userlist.c b/libpurple/protocols/msn/userlist.c index aa8f1f68bf..a840d90a6c 100644 --- a/libpurple/protocols/msn/userlist.c +++ b/libpurple/protocols/msn/userlist.c @@ -699,8 +699,6 @@ msn_release_buddy_icon_request(MsnUserList *userlist) if (userlist->buddy_icon_window > 0) { GQueue *queue; - PurpleAccount *account; - const char *username; queue = userlist->buddy_icon_requests; @@ -709,9 +707,6 @@ msn_release_buddy_icon_request(MsnUserList *userlist) user = g_queue_pop_head(queue); - account = userlist->session->account; - username = user->passport; - userlist->buddy_icon_window--; msn_request_user_display(user); |