Mercurial > pidgin
changeset 31998:fcf841ffd620
Convert yahoo prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data()
author | andrew.victor@mxit.com |
---|---|
date | Tue, 30 Aug 2011 20:03:11 +0000 |
parents | 1a3723704543 |
children | 3899615cef8a |
files | libpurple/protocols/yahoo/libymsg.c libpurple/protocols/yahoo/util.c libpurple/protocols/yahoo/yahoo_aliases.c libpurple/protocols/yahoo/yahoo_doodle.c libpurple/protocols/yahoo/yahoo_filexfer.c libpurple/protocols/yahoo/yahoo_friend.c libpurple/protocols/yahoo/yahoo_picture.c libpurple/protocols/yahoo/yahoo_profile.c libpurple/protocols/yahoo/yahoochat.c libpurple/protocols/yahoo/ycht.c |
diffstat | 10 files changed, 120 insertions(+), 116 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/libymsg.c Tue Aug 30 19:32:08 2011 +0000 +++ b/libpurple/protocols/yahoo/libymsg.c Tue Aug 30 20:03:11 2011 +0000 @@ -496,7 +496,7 @@ GSList *l = pkt->hash; PurpleAccount *account = purple_connection_get_account(gc); - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); GHashTable *ht; char *norm_bud = NULL; char *temp = NULL; @@ -638,7 +638,7 @@ gboolean got_serv_list = FALSE; YahooFriend *f = NULL; PurpleAccount *account = purple_connection_get_account(gc); - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); GHashTable *ht; char **lines; @@ -787,7 +787,7 @@ YahooFriend *f = NULL; GSList *l = pkt->hash; gint val_11 = 0; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); YahooFederation fed = YAHOO_FEDERATION_NONE; account = purple_connection_get_account(gc); @@ -899,7 +899,7 @@ char *server_msg = NULL; char *m; - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); account = purple_connection_get_account(gc); while (l != NULL) { @@ -960,7 +960,7 @@ static void yahoo_process_message(PurpleConnection *gc, struct yahoo_packet *pkt, yahoo_pkt_type pkt_type) { PurpleAccount *account; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); GSList *l = pkt->hash; GSList *list = NULL; struct _yahoo_im *im = NULL; @@ -1202,7 +1202,7 @@ { struct yahoo_add_request *add_req = data; struct yahoo_packet *pkt; - YahooData *yd = add_req->gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(add_req->gc); const char *who = add_req->who; pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH_REQ_15, YAHOO_STATUS_AVAILABLE, yd->session_id); @@ -1233,7 +1233,7 @@ static void yahoo_buddy_add_deny_cb(struct yahoo_add_request *add_req, const char *msg) { - YahooData *yd = add_req->gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(add_req->gc); struct yahoo_packet *pkt; char *encoded_msg = NULL; const char *who = add_req->who; @@ -1295,7 +1295,7 @@ static void yahoo_buddy_denied_our_add(PurpleConnection *gc, const char *who, const char *reason) { char *notify_msg; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); if (who == NULL) return; @@ -1625,7 +1625,7 @@ static void yahoo_process_mail(PurpleConnection *gc, struct yahoo_packet *pkt) { PurpleAccount *account = purple_connection_get_account(gc); - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); const char *who = NULL; const char *email = NULL; const char *subj = NULL; @@ -1709,7 +1709,7 @@ static void yahoo_auth16_stage3(PurpleConnection *gc, const char *crypt) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); PurpleAccount *account = purple_connection_get_account(gc); const char *name = purple_normalize(account, purple_account_get_username(account)); PurpleCipher *md5_cipher; @@ -2207,7 +2207,7 @@ static void yahoo_process_authresp(PurpleConnection *gc, struct yahoo_packet *pkt) { #ifdef TRY_WEBMESSENGER_LOGIN - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); #endif /* TRY_WEBMESSENGER_LOGIN */ GSList *l = pkt->hash; int err = 0; @@ -2300,7 +2300,7 @@ char *buf; YahooFriend *f; GSList *l = pkt->hash; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); YahooFederation fed = YAHOO_FEDERATION_NONE; while (l) { @@ -2394,7 +2394,7 @@ PurpleConnection *gc = user_data; struct yahoo_packet *pkt_to_send; PurpleAccount *account; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); account = purple_connection_get_account(gc); @@ -2413,7 +2413,7 @@ static gboolean yahoo_p2p_keepalive(gpointer data) { PurpleConnection *gc = data; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); g_hash_table_foreach(yd->peers, yahoo_p2p_keepalive_cb, gc); @@ -2460,7 +2460,7 @@ if(!(p2p_data = data)) return ; - yd = p2p_data->gc->proto_data; + yd = purple_connection_get_protocol_data(p2p_data->gc); /* lets see whats in the packet */ while (l) { @@ -2545,7 +2545,7 @@ if(!(p2p_data = data)) return ; - yd = p2p_data->gc->proto_data; + yd = purple_connection_get_protocol_data(p2p_data->gc); len = read(source, buf, sizeof(buf)); if ((len < 0) && ((errno == EAGAIN) || (errno == EWOULDBLOCK))) @@ -2617,7 +2617,7 @@ if(!(p2p_data = data)) return ; - yd = p2p_data->gc->proto_data; + yd = purple_connection_get_protocol_data(p2p_data->gc); acceptfd = accept(source, NULL, 0); if(acceptfd == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) @@ -2657,7 +2657,7 @@ if(!(p2p_data = data)) return FALSE; - yd = p2p_data->gc->proto_data; + yd = purple_connection_get_protocol_data(p2p_data->gc); purple_debug_warning("yahoo","yahoo p2p server timeout, peer failed to connect\n"); yahoo_p2p_disconnect_destroy_data(data); @@ -2678,7 +2678,7 @@ if(!(p2p_data = data)) return ; - yd = p2p_data->gc->proto_data; + yd = purple_connection_get_protocol_data(p2p_data->gc); yd->listen_data = NULL; if(listenfd == -1) { @@ -2706,7 +2706,7 @@ YahooFriend *f; struct yahoo_packet *pkt; PurpleAccount *account; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_p2p_data *p2p_data; const char *norm_username; @@ -2787,7 +2787,7 @@ YahooData *yd; p2p_data = data; - yd = p2p_data->gc->proto_data; + yd = purple_connection_get_protocol_data(p2p_data->gc); if(error_message != NULL) { purple_debug_warning("yahoo","p2p: %s\n",error_message); @@ -3132,7 +3132,7 @@ static void yahoo_pending(gpointer data, gint source, PurpleInputCondition cond) { PurpleConnection *gc = data; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); char buf[1024]; int len; @@ -3240,7 +3240,7 @@ return; } - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); yd->fd = source; pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH, yd->current_status, yd->session_id); @@ -3266,7 +3266,7 @@ return; } - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); yd->fd = source; pkt = yahoo_packet_new(YAHOO_SERVICE_WEBLOGIN, YAHOO_STATUS_WEBLOGIN, yd->session_id); @@ -3285,7 +3285,7 @@ { PurpleConnection *gc = data; PurpleAccount *account = purple_connection_get_account(gc); - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); char bufread[2048], *i = bufread, *buf = bufread; int len; GString *s; @@ -3364,7 +3364,7 @@ int written, remaining; gc = data; - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); remaining = strlen(yd->auth) - yd->auth_written; written = write(source, yd->auth + yd->auth_written, remaining); @@ -3474,7 +3474,7 @@ { PurpleConnection *gc = (PurpleConnection *)user_data; PurpleAccount *account = purple_connection_get_account(gc); - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); const char *sn = purple_account_get_username(account); const char *pass = purple_connection_get_password(gc); GHashTable *hash = yahoo_login_page_hash(url_text, len); @@ -3671,12 +3671,13 @@ void yahoo_login(PurpleAccount *account) { PurpleConnection *gc = purple_account_get_connection(account); - YahooData *yd = gc->proto_data = g_new0(YahooData, 1); + YahooData *yd = g_new0(YahooData, 1); PurpleStatus *status = purple_account_get_active_status(account); gboolean use_whole_url = yahoo_account_use_http_proxy(gc); gboolean proxy_ssl = purple_account_get_bool(account, "proxy_ssl", FALSE); PurpleUtilFetchUrlData *url_data; + purple_connection_set_protocol_data(gc, yd); gc->flags |= PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_NO_BGCOLOR | PURPLE_CONNECTION_NO_URLDESC; purple_connection_update_progress(gc, _("Connecting"), 1, 2); @@ -3721,7 +3722,7 @@ } void yahoo_close(PurpleConnection *gc) { - YahooData *yd = (YahooData *)gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); GSList *l; if (gc->inpa) @@ -3810,7 +3811,7 @@ g_free(yd->current_list15_grp); g_free(yd); - gc->proto_data = NULL; + purple_connection_set_protocol_data(gc, NULL); } const char *yahoo_list_icon(PurpleAccount *a, PurpleBuddy *b) @@ -3827,7 +3828,7 @@ if (!b || !(account = purple_buddy_get_account(b)) || !(gc = purple_account_get_connection(account)) || - !gc->proto_data) + !purple_connection_get_protocol_data(gc)) return NULL; f = yahoo_friend_find(gc, purple_buddy_get_name(b)); @@ -3892,7 +3893,7 @@ buddy = (PurpleBuddy *) node; gc = purple_account_get_connection(purple_buddy_get_account(buddy)); - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); id = yd->conf_id; components = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); @@ -4075,7 +4076,7 @@ static GList *build_presence_submenu(YahooFriend *f, PurpleConnection *gc) { GList *m = NULL; PurpleMenuAction *act; - YahooData *yd = (YahooData *) gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); if (yd->current_status == YAHOO_STATUS_INVISIBLE) { if (f->presence != YAHOO_PRESENCE_ONLINE) { @@ -4135,7 +4136,7 @@ PurpleMenuAction *act; PurpleConnection *gc = purple_account_get_connection(purple_buddy_get_account(buddy)); - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); static char buf2[1024]; YahooFriend *f; @@ -4218,7 +4219,7 @@ static void yahoo_act_id(PurpleConnection *gc, PurpleRequestFields *fields) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); const char *name = yd->profiles[purple_request_fields_get_choice(fields, "id")]; struct yahoo_packet *pkt = yahoo_packet_new(YAHOO_SERVICE_IDACT, YAHOO_STATUS_AVAILABLE, yd->session_id); @@ -4235,7 +4236,7 @@ PurpleConnection *gc = user_data; gboolean set_cookie = FALSE; gchar *url; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); g_return_if_fail(PURPLE_CONNECTION_IS_VALID(gc)); @@ -4271,7 +4272,7 @@ /* XXX I have no idea how this will work with Yahoo! Japan. */ PurpleConnection *gc = action->context; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); PurpleUtilFetchUrlData *url_data; const char* base_url = "http://login.yahoo.com"; @@ -4385,7 +4386,7 @@ { struct yahoo_sms_carrier_cb_data *sms_cb_data = user_data; PurpleConnection *gc = sms_cb_data->gc; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); char *status = NULL; char *carrier = NULL; PurpleAccount *account = purple_connection_get_account(gc); @@ -4440,7 +4441,7 @@ static void yahoo_get_sms_carrier(PurpleConnection *gc, gpointer data) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); PurpleUtilFetchUrlData *url_data; struct yahoo_sms_carrier_cb_data *sms_cb_data; char *validate_request_str = NULL; @@ -4500,7 +4501,7 @@ int yahoo_send_im(PurpleConnection *gc, const char *who, const char *what, PurpleMessageFlags flags) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt = NULL; char *msg = yahoo_html_to_codes(what); char *msg2; @@ -4657,7 +4658,7 @@ unsigned int yahoo_send_typing(PurpleConnection *gc, const char *who, PurpleTypingState state) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_p2p_data *p2p_data; YahooFederation fed = YAHOO_FEDERATION_NONE; struct yahoo_packet *pkt = NULL; @@ -4728,7 +4729,7 @@ gc = purple_account_get_connection(account); presence = purple_status_get_presence(status); - yd = (YahooData *)gc->proto_data; + yd = purple_connection_get_protocol_data(gc); old_status = yd->current_status; yd->current_status = get_yahoo_status_from_purple_status(status); @@ -4794,7 +4795,7 @@ void yahoo_set_idle(PurpleConnection *gc, int idle) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt = NULL; char *msg = NULL, *msg2 = NULL; PurpleStatus *status = NULL; @@ -4913,7 +4914,7 @@ void yahoo_keepalive(PurpleConnection *gc) { struct yahoo_packet *pkt; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); time_t now = time(NULL); /* We're only allowed to send a ping once an hour or the servers will boot us */ @@ -4946,7 +4947,7 @@ void yahoo_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *g) { - YahooData *yd = (YahooData *)gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt; const char *group = NULL; char *group2; @@ -5009,7 +5010,7 @@ void yahoo_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) { - YahooData *yd = (YahooData *)gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt; GSList *buddies, *l; PurpleGroup *g; @@ -5065,7 +5066,7 @@ } void yahoo_add_deny(PurpleConnection *gc, const char *who) { - YahooData *yd = (YahooData *)gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt; YahooFederation fed = YAHOO_FEDERATION_NONE; @@ -5088,7 +5089,7 @@ } void yahoo_rem_deny(PurpleConnection *gc, const char *who) { - YahooData *yd = (YahooData *)gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt; YahooFederation fed = YAHOO_FEDERATION_NONE; @@ -5136,7 +5137,7 @@ void yahoo_change_buddys_group(PurpleConnection *gc, const char *who, const char *old_group, const char *new_group) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt; char *gpn, *gpo; YahooFriend *f = yahoo_friend_find(gc, who); @@ -5183,7 +5184,7 @@ void yahoo_rename_group(PurpleConnection *gc, const char *old_name, PurpleGroup *group, GList *moved_buddies) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt; char *gpn, *gpo;
--- a/libpurple/protocols/yahoo/util.c Tue Aug 30 19:32:08 2011 +0000 +++ b/libpurple/protocols/yahoo/util.c Tue Aug 30 20:03:11 2011 +0000 @@ -63,8 +63,9 @@ char firstflag = 1; gchar *t1,*t2,*t3; GSList *tmp; - GSList *cookies; - cookies = ((YahooData*)(gc->proto_data))->cookies; + YahooData *yd = purple_connection_get_protocol_data(gc); + GSList *cookies = yd->cookies; + tmp = cookies; while(tmp) { @@ -129,7 +130,7 @@ */ char *yahoo_string_encode(PurpleConnection *gc, const char *str, gboolean *utf8) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); char *ret; const char *to_codeset; @@ -158,7 +159,7 @@ */ char *yahoo_string_decode(PurpleConnection *gc, const char *str, gboolean utf8) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); char *ret; const char *from_codeset;
--- a/libpurple/protocols/yahoo/yahoo_aliases.c Tue Aug 30 19:32:08 2011 +0000 +++ b/libpurple/protocols/yahoo/yahoo_aliases.c Tue Aug 30 20:03:11 2011 +0000 @@ -74,7 +74,7 @@ yahoo_fetch_aliases_cb(PurpleUtilFetchUrlData *url_data, gpointer user_data, const gchar *url_text, size_t len, const gchar *error_message) { PurpleConnection *gc = user_data; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); yd->url_datas = g_slist_remove(yd->url_datas, url_data); @@ -186,7 +186,7 @@ void yahoo_fetch_aliases(PurpleConnection *gc) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); const char *url; gchar *request, *webpage, *webaddress; PurpleUtilFetchUrlData *url_data; @@ -230,7 +230,7 @@ PurpleConnection *gc = cb->gc; YahooData *yd; - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); yd->url_datas = g_slist_remove(yd->url_datas, url_data); if (len == 0 || error_message != NULL) { @@ -310,7 +310,7 @@ return; } - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); /* Using callback_data so I have access to gc in the callback function */ cb = g_new0(struct callback_data, 1);
--- a/libpurple/protocols/yahoo/yahoo_doodle.c Tue Aug 30 19:32:08 2011 +0000 +++ b/libpurple/protocols/yahoo/yahoo_doodle.c Tue Aug 30 20:03:11 2011 +0000 @@ -389,7 +389,7 @@ purple_debug_info("yahoo", "doodle: Sent %s (%s)\n", type, to); - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); /* Make and send an acknowledge (ready) Doodle packet */ pkt = yahoo_packet_new(YAHOO_SERVICE_P2PFILEXFER, YAHOO_STATUS_AVAILABLE, yd->session_id);
--- a/libpurple/protocols/yahoo/yahoo_filexfer.c Tue Aug 30 19:32:08 2011 +0000 +++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Tue Aug 30 20:03:11 2011 +0000 @@ -85,7 +85,7 @@ GSList *l; gc = xd->gc; - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); /* remove entry from map */ if(xd->xfer_peer_idstring) { @@ -255,7 +255,7 @@ /* Assemble the tx buffer */ gc = xd->gc; account = purple_connection_get_account(gc); - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANSFER, YAHOO_STATUS_AVAILABLE, yd->session_id); @@ -316,7 +316,7 @@ xfer_data = purple_xfer_get_protocol_data(xfer); gc = xfer_data->gc; - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); account = purple_connection_get_account(gc); if (purple_xfer_get_type(xfer) == PURPLE_XFER_SEND) { @@ -360,7 +360,7 @@ xfer_data = purple_xfer_get_protocol_data(xfer); gc = xfer_data->gc; - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); account = purple_connection_get_account(gc); if (purple_xfer_get_type(xfer) == PURPLE_XFER_SEND) { @@ -527,7 +527,7 @@ struct yahoo_packet *pkt; gc = xfer_data->gc; - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); account = purple_connection_get_account(gc); if(xfer_data->xfer_idstring_for_relay) /* hack to see if file trans acc/info packet has been received */ { @@ -575,7 +575,7 @@ struct yahoo_packet *pkt; gc = xfer_data->gc; - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); account = purple_connection_get_account(gc); if(!xfer_data->xfer_idstring_for_relay) /* hack to see if file trans acc/info packet has been received */ { @@ -662,7 +662,7 @@ filesize = atol( xfer_data->size_list->data ); gc = xfer_data->gc; - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); /* setting up xfer_data for next file's tranfer */ g_free(xfer_data->host); @@ -805,7 +805,7 @@ unsigned long filesize = 0L; GSList *l; - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); for (l = pkt->hash; l; l = l->next) { struct yahoo_pair *pair = l->data; @@ -996,7 +996,7 @@ return; gc = xd->gc; account = purple_connection_get_account(gc); - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); if(!hosts) { @@ -1076,7 +1076,7 @@ void yahoo_send_file(PurpleConnection *gc, const char *who, const char *file) { struct yahoo_xfer_data *xfer_data; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); PurpleXfer *xfer = yahoo_new_xfer(gc, who); g_return_if_fail(xfer != NULL); @@ -1249,7 +1249,7 @@ { gchar* cookies; gchar* initial_buffer; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); /* cookies = yahoo_get_cookies(gc); * This doesn't seem to be working. The function is returning NULL, which yahoo servers don't like @@ -1505,7 +1505,7 @@ } if( (purple_xfer_get_type(xfer) == PURPLE_XFER_RECEIVE) || (xd->status_15 != P2P_HEAD_REPLIED) ) { - yd = xd->gc->proto_data; + yd = purple_connection_get_protocol_data(xd->gc); account = purple_connection_get_account(xd->gc); local_ip = purple_network_get_my_ip(listenfd); xd->yahoo_local_p2p_ft_server_port = purple_network_get_port_from_fd(listenfd); @@ -1566,7 +1566,7 @@ return; account = purple_connection_get_account(gc); - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); p2p_data = g_hash_table_lookup(yd->peers, purple_xfer_get_remote_user(xfer)); if( p2p_data->connection_type == YAHOO_P2P_WE_ARE_SERVER ) @@ -1607,7 +1607,7 @@ GSList *size_list = NULL; int nooffiles = 0; - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); for (l = pkt->hash; l; l = l->next) { struct yahoo_pair *pair = l->data; @@ -1786,7 +1786,7 @@ struct yahoo_packet *pkt_to_send; struct yahoo_p2p_data *p2p_data; - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); for (l = pkt->hash; l; l = l->next) { struct yahoo_pair *pair = l->data; @@ -1892,7 +1892,7 @@ gchar *url = NULL; int val_249 = 0; - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); for (l = pkt->hash; l; l = l->next) { struct yahoo_pair *pair = l->data;
--- a/libpurple/protocols/yahoo/yahoo_friend.c Tue Aug 30 19:32:08 2011 +0000 +++ b/libpurple/protocols/yahoo/yahoo_friend.c Tue Aug 30 20:03:11 2011 +0000 @@ -46,9 +46,10 @@ const char *norm; g_return_val_if_fail(gc != NULL, NULL); - g_return_val_if_fail(gc->proto_data != NULL, NULL); - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); + g_return_val_if_fail(yd != NULL, NULL); + norm = purple_normalize(purple_connection_get_account(gc), name); return g_hash_table_lookup(yd->friends, norm); @@ -61,9 +62,10 @@ const char *norm; g_return_val_if_fail(gc != NULL, NULL); - g_return_val_if_fail(gc->proto_data != NULL, NULL); - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); + g_return_val_if_fail(yd != NULL, NULL); + norm = purple_normalize(purple_connection_get_account(gc), name); f = g_hash_table_lookup(yd->friends, norm); @@ -225,7 +227,7 @@ void yahoo_friend_update_presence(PurpleConnection *gc, const char *name, YahooPresenceVisibility presence) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt = NULL; YahooFriend *f; const char *thirtyone, *thirteen;
--- a/libpurple/protocols/yahoo/yahoo_picture.c Tue Aug 30 19:32:08 2011 +0000 +++ b/libpurple/protocols/yahoo/yahoo_picture.c Tue Aug 30 20:03:11 2011 +0000 @@ -52,7 +52,7 @@ YahooData *yd; d = user_data; - yd = d->gc->proto_data; + yd = purple_connection_get_protocol_data(d->gc); yd->url_datas = g_slist_remove(yd->url_datas, url_data); if (error_message != NULL) { @@ -142,7 +142,7 @@ "Mozilla/4.0 (compatible; MSIE 5.5)", FALSE, yahoo_fetch_picture_cb, data); if (url_data != NULL) { - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); yd->url_datas = g_slist_prepend(yd->url_datas, url_data); } else { g_free(data->who); @@ -192,7 +192,7 @@ void yahoo_process_picture_upload(PurpleConnection *gc, struct yahoo_packet *pkt) { PurpleAccount *account = purple_connection_get_account(gc); - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); GSList *l = pkt->hash; char *url = NULL; @@ -268,7 +268,7 @@ void yahoo_send_picture_info(PurpleConnection *gc, const char *who) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt; if (!yd->picture_url) { @@ -285,7 +285,7 @@ void yahoo_send_picture_request(PurpleConnection *gc, const char *who) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt; pkt = yahoo_packet_new(YAHOO_SERVICE_PICTURE, YAHOO_STATUS_AVAILABLE, yd->session_id); @@ -297,7 +297,7 @@ void yahoo_send_picture_checksum(PurpleConnection *gc) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt; pkt = yahoo_packet_new(YAHOO_SERVICE_PICTURE_CHECKSUM, YAHOO_STATUS_AVAILABLE, yd->session_id); @@ -308,7 +308,7 @@ void yahoo_send_picture_update_to_user(PurpleConnection *gc, const char *who, int type) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt; pkt = yahoo_packet_new(YAHOO_SERVICE_AVATAR_UPDATE, YAHOO_STATUS_AVAILABLE, yd->session_id); @@ -333,7 +333,7 @@ void yahoo_send_picture_update(PurpleConnection *gc, int type) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yspufe data; data.gc = gc; @@ -432,7 +432,7 @@ gboolean use_whole_url = yahoo_account_use_http_proxy(gc); account = purple_connection_get_account(gc); - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); /* Buddy icon connect is now complete; clear the PurpleProxyConnectData */ yd->buddy_icon_connect_data = NULL; @@ -497,7 +497,7 @@ void yahoo_buddy_icon_upload(PurpleConnection *gc, struct yahoo_buddy_icon_upload_data *d) { PurpleAccount *account = purple_connection_get_account(gc); - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); if (yd->buddy_icon_connect_data != NULL) { /* Cancel any in-progress buddy icon upload */ @@ -542,7 +542,7 @@ void yahoo_set_buddy_icon(PurpleConnection *gc, PurpleStoredImage *img) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); PurpleAccount *account = gc->account; if (img == NULL) {
--- a/libpurple/protocols/yahoo/yahoo_profile.c Tue Aug 30 19:32:08 2011 +0000 +++ b/libpurple/protocols/yahoo/yahoo_profile.c Tue Aug 30 20:03:11 2011 +0000 @@ -789,7 +789,7 @@ purple_debug_info("yahoo", "In yahoo_got_info\n"); - yd = info_data->gc->proto_data; + yd = purple_connection_get_protocol_data(info_data->gc); yd->url_datas = g_slist_remove(yd->url_datas, url_data); user_info = purple_notify_user_info_new(); @@ -983,7 +983,7 @@ /* in to purple_markup_strip_html*/ char *fudged_buffer; - yd = info_data->gc->proto_data; + yd = purple_connection_get_protocol_data(info_data->gc); yd->url_datas = g_slist_remove(yd->url_datas, url_data); fudged_buffer = purple_strcasereplace(url_buffer, "</dd>", "</dd><br>"); @@ -1262,7 +1262,7 @@ void yahoo_get_info(PurpleConnection *gc, const char *name) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); YahooGetInfoData *data; char *url; PurpleUtilFetchUrlData *url_data;
--- a/libpurple/protocols/yahoo/yahoochat.c Tue Aug 30 19:32:08 2011 +0000 +++ b/libpurple/protocols/yahoo/yahoochat.c Tue Aug 30 20:03:11 2011 +0000 @@ -53,7 +53,7 @@ /* special function to log us on to the yahoo chat service */ static void yahoo_chat_online(PurpleConnection *gc) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt; const char *rll; @@ -101,7 +101,7 @@ YahooData *yd; GSList *l; - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); for (l = yd->confs; l; l = l->next) { PurpleConversation *c = l->data; @@ -372,7 +372,7 @@ static void yahoo_chat_join(PurpleConnection *gc, const char *dn, const char *room, const char *topic, const char *id) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt; char *room2; gboolean utf8 = TRUE; @@ -400,7 +400,7 @@ /* this is a confirmation of yahoo_chat_online(); */ void yahoo_process_chat_online(PurpleConnection *gc, struct yahoo_packet *pkt) { - YahooData *yd = (YahooData *) gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); if (pkt->status == 1) { yd->chat_online = TRUE; @@ -432,7 +432,7 @@ /* this is basicly the opposite of chat_online */ void yahoo_process_chat_logout(PurpleConnection *gc, struct yahoo_packet *pkt) { - YahooData *yd = (YahooData *) gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); GSList *l; for (l = pkt->hash; l; l = l->next) { @@ -462,7 +462,7 @@ void yahoo_process_chat_join(PurpleConnection *gc, struct yahoo_packet *pkt) { PurpleAccount *account = purple_connection_get_account(gc); - YahooData *yd = (YahooData *) gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); PurpleConversation *c = NULL; GSList *l; GList *members = NULL; @@ -786,7 +786,7 @@ static int yahoo_conf_send(PurpleConnection *gc, const char *dn, const char *room, GList *members, const char *what) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt; GList *who; char *msg, *msg2; @@ -843,7 +843,7 @@ static void yahoo_conf_invite(PurpleConnection *gc, PurpleConversation *c, const char *dn, const char *buddy, const char *room, const char *msg) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt; GList *members; char *msg2 = NULL; @@ -873,7 +873,7 @@ static void yahoo_chat_leave(PurpleConnection *gc, const char *room, const char *dn, gboolean logout) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt; char *eroom; @@ -924,7 +924,7 @@ static int yahoo_chat_send(PurpleConnection *gc, const char *dn, const char *room, const char *what, PurpleMessageFlags flags) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt; int me = 0; char *msg1, *msg2, *room2; @@ -969,7 +969,7 @@ static void yahoo_chat_invite(PurpleConnection *gc, const char *dn, const char *buddy, const char *room, const char *msg) { - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); struct yahoo_packet *pkt; char *room2, *msg2 = NULL; gboolean utf8 = TRUE; @@ -997,7 +997,7 @@ YahooData *yd; struct yahoo_packet *pkt; - yd = gc->proto_data; + yd = purple_connection_get_protocol_data(gc); if (yd->wm) { g_return_if_fail(yd->ycht != NULL); @@ -1029,7 +1029,7 @@ void yahoo_c_leave(PurpleConnection *gc, int id) { - YahooData *yd = (YahooData *) gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); PurpleConversation *c; if (!yd) @@ -1056,7 +1056,7 @@ int ret; YahooData *yd; - yd = (YahooData *) gc->proto_data; + yd = purple_connection_get_protocol_data(gc); if (!yd) return -1; @@ -1114,7 +1114,7 @@ char *room, *topic, *type; PurpleConversation *c; - yd = (YahooData *) gc->proto_data; + yd = purple_connection_get_protocol_data(gc); if (!yd) return; @@ -1478,7 +1478,7 @@ PurpleRoomlist *list = yrl->list; PurpleAccount *account = purple_roomlist_get_account(list); PurpleConnection *pc = purple_account_get_connection(account); - YahooData *yd = pc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(pc); if (source < 0) { purple_notify_error(pc, NULL, _("Unable to connect"), _("Fetching the room list failed."));
--- a/libpurple/protocols/yahoo/ycht.c Tue Aug 30 19:32:08 2011 +0000 +++ b/libpurple/protocols/yahoo/ycht.c Tue Aug 30 20:03:11 2011 +0000 @@ -53,7 +53,7 @@ static void ycht_process_login(YchtConn *ycht, YchtPkt *pkt) { PurpleConnection *gc = ycht->gc; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); if (ycht->logged_in) return; @@ -68,7 +68,7 @@ static void ycht_process_logout(YchtConn *ycht, YchtPkt *pkt) { PurpleConnection *gc = ycht->gc; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); yd->chat_online = FALSE; ycht->logged_in = FALSE; @@ -173,7 +173,7 @@ { #if 0 PurpleConnection *gc = ycht->gc; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); if (ycht->logged_in) return; @@ -429,7 +429,7 @@ void ycht_connection_close(YchtConn *ycht) { - YahooData *yd = ycht->gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(ycht->gc); if (yd) { yd->ycht = NULL; @@ -541,7 +541,7 @@ { YchtConn *ycht = data; PurpleConnection *gc = ycht->gc; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); YchtPkt *pkt; char *buf; @@ -568,7 +568,7 @@ void ycht_connection_open(PurpleConnection *gc) { YchtConn *ycht; - YahooData *yd = gc->proto_data; + YahooData *yd = purple_connection_get_protocol_data(gc); PurpleAccount *account = purple_connection_get_account(gc); ycht = g_new0(YchtConn, 1);