Mercurial > pidgin
changeset 22230:0f654f866de0
Revert bfc4df11256d088d75b0512bb0c4790967b68b19 because the code is
written such that it is not possible for this to happen, and
because PURPLE_CONNECTION_IS_VALID() is a hack
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 31 Jan 2008 02:13:30 +0000 |
parents | ae5917260eac |
children | cbf64b6f5d4a |
files | libpurple/protocols/yahoo/yahoo.c |
diffstat | 1 files changed, 37 insertions(+), 41 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo.c Tue Jan 29 01:51:26 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Thu Jan 31 02:13:30 2008 +0000 @@ -975,22 +975,20 @@ }; static void -yahoo_buddy_add_authorize_cb(gpointer data) { +yahoo_buddy_add_authorize_cb(gpointer data) +{ struct yahoo_add_request *add_req = data; - - if (PURPLE_CONNECTION_IS_VALID(add_req->gc)) { - struct yahoo_packet *pkt; - struct yahoo_data *yd = add_req->gc->proto_data; - - pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH_REQ_15, YAHOO_STATUS_AVAILABLE, 0); - yahoo_packet_hash(pkt, "ssiii", - 1, add_req->id, - 5, add_req->who, - 241, add_req->protocol, - 13, 1, - 334, 0); - yahoo_packet_send_and_free(pkt, yd); - } + struct yahoo_packet *pkt; + struct yahoo_data *yd = add_req->gc->proto_data; + + pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH_REQ_15, YAHOO_STATUS_AVAILABLE, 0); + yahoo_packet_hash(pkt, "ssiii", + 1, add_req->id, + 5, add_req->who, + 241, add_req->protocol, + 13, 1, + 334, 0); + yahoo_packet_send_and_free(pkt, yd); g_free(add_req->id); g_free(add_req->who); @@ -998,32 +996,30 @@ } static void -yahoo_buddy_add_deny_cb(struct yahoo_add_request *add_req, const char *msg) { - - if (PURPLE_CONNECTION_IS_VALID(add_req->gc)) { - struct yahoo_data *yd = add_req->gc->proto_data; - struct yahoo_packet *pkt; - char *encoded_msg = NULL; - PurpleAccount *account = purple_connection_get_account(add_req->gc); - - if (msg && *msg) - encoded_msg = yahoo_string_encode(add_req->gc, msg, NULL); - - pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH_REQ_15, - YAHOO_STATUS_AVAILABLE, 0); - - yahoo_packet_hash(pkt, "ssiiis", - 1, purple_normalize(account, purple_account_get_username(account)), - 5, add_req->who, - 13, 2, - 334, 0, - 97, 1, - 14, encoded_msg ? encoded_msg : ""); - - yahoo_packet_send_and_free(pkt, yd); - - g_free(encoded_msg); - } +yahoo_buddy_add_deny_cb(struct yahoo_add_request *add_req, const char *msg) +{ + struct yahoo_data *yd = add_req->gc->proto_data; + struct yahoo_packet *pkt; + char *encoded_msg = NULL; + PurpleAccount *account = purple_connection_get_account(add_req->gc); + + if (msg && *msg) + encoded_msg = yahoo_string_encode(add_req->gc, msg, NULL); + + pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH_REQ_15, + YAHOO_STATUS_AVAILABLE, 0); + + yahoo_packet_hash(pkt, "ssiiis", + 1, purple_normalize(account, purple_account_get_username(account)), + 5, add_req->who, + 13, 2, + 334, 0, + 97, 1, + 14, encoded_msg ? encoded_msg : ""); + + yahoo_packet_send_and_free(pkt, yd); + + g_free(encoded_msg); g_free(add_req->id); g_free(add_req->who);