comparison libpurple/protocols/yahoo/yahoo_filexfer.c @ 27694:908be3822215

Move from "struct yahoo_data" to "YahooData" to be consistent with other structs in the prpl. I'm sure someone is going to want to shoot me over this, but I'm tired of seeing "struct yahoo_data" everywhere in this prpl.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Sun, 26 Jul 2009 17:25:18 +0000
parents ef5f0cde8d74
children 0a056130718e
comparison
equal deleted inserted replaced
27693:8bc9087b5ec2 27694:908be3822215
78 }; 78 };
79 79
80 static void yahoo_xfer_data_free(struct yahoo_xfer_data *xd) 80 static void yahoo_xfer_data_free(struct yahoo_xfer_data *xd)
81 { 81 {
82 PurpleConnection *gc; 82 PurpleConnection *gc;
83 struct yahoo_data *yd; 83 YahooData *yd;
84 PurpleXfer *xfer; 84 PurpleXfer *xfer;
85 GSList *l; 85 GSList *l;
86 86
87 gc = xd->gc; 87 gc = xd->gc;
88 yd = gc->proto_data; 88 yd = gc->proto_data;
231 const char *host; 231 const char *host;
232 int port; 232 int port;
233 size_t content_length, header_len, pkt_buf_len; 233 size_t content_length, header_len, pkt_buf_len;
234 PurpleConnection *gc; 234 PurpleConnection *gc;
235 PurpleAccount *account; 235 PurpleAccount *account;
236 struct yahoo_data *yd; 236 YahooData *yd;
237 237
238 purple_debug_info("yahoo", "in yahoo_sendfile_connected\n"); 238 purple_debug_info("yahoo", "in yahoo_sendfile_connected\n");
239 239
240 if (!(xfer = data)) 240 if (!(xfer = data))
241 return; 241 return;
309 static void yahoo_xfer_init(PurpleXfer *xfer) 309 static void yahoo_xfer_init(PurpleXfer *xfer)
310 { 310 {
311 struct yahoo_xfer_data *xfer_data; 311 struct yahoo_xfer_data *xfer_data;
312 PurpleConnection *gc; 312 PurpleConnection *gc;
313 PurpleAccount *account; 313 PurpleAccount *account;
314 struct yahoo_data *yd; 314 YahooData *yd;
315 315
316 xfer_data = xfer->data; 316 xfer_data = xfer->data;
317 gc = xfer_data->gc; 317 gc = xfer_data->gc;
318 yd = gc->proto_data; 318 yd = gc->proto_data;
319 account = purple_connection_get_account(gc); 319 account = purple_connection_get_account(gc);
352 static void yahoo_xfer_init_15(PurpleXfer *xfer) 352 static void yahoo_xfer_init_15(PurpleXfer *xfer)
353 { 353 {
354 struct yahoo_xfer_data *xfer_data; 354 struct yahoo_xfer_data *xfer_data;
355 PurpleConnection *gc; 355 PurpleConnection *gc;
356 PurpleAccount *account; 356 PurpleAccount *account;
357 struct yahoo_data *yd; 357 YahooData *yd;
358 struct yahoo_packet *pkt; 358 struct yahoo_packet *pkt;
359 359
360 xfer_data = xfer->data; 360 xfer_data = xfer->data;
361 gc = xfer_data->gc; 361 gc = xfer_data->gc;
362 yd = gc->proto_data; 362 yd = gc->proto_data;
523 523
524 if(purple_xfer_get_status(xfer) == PURPLE_XFER_STATUS_CANCEL_LOCAL && xfer_data->version == 15) 524 if(purple_xfer_get_status(xfer) == PURPLE_XFER_STATUS_CANCEL_LOCAL && xfer_data->version == 15)
525 { 525 {
526 PurpleConnection *gc; 526 PurpleConnection *gc;
527 PurpleAccount *account; 527 PurpleAccount *account;
528 struct yahoo_data *yd; 528 YahooData *yd;
529 struct yahoo_packet *pkt; 529 struct yahoo_packet *pkt;
530 530
531 gc = xfer_data->gc; 531 gc = xfer_data->gc;
532 yd = gc->proto_data; 532 yd = gc->proto_data;
533 account = purple_connection_get_account(gc); 533 account = purple_connection_get_account(gc);
571 if(purple_xfer_get_status(xfer) == PURPLE_XFER_STATUS_CANCEL_LOCAL && xfer_data->version == 15) 571 if(purple_xfer_get_status(xfer) == PURPLE_XFER_STATUS_CANCEL_LOCAL && xfer_data->version == 15)
572 { 572 {
573 573
574 PurpleConnection *gc; 574 PurpleConnection *gc;
575 PurpleAccount *account; 575 PurpleAccount *account;
576 struct yahoo_data *yd; 576 YahooData *yd;
577 struct yahoo_packet *pkt; 577 struct yahoo_packet *pkt;
578 578
579 gc = xfer_data->gc; 579 gc = xfer_data->gc;
580 yd = gc->proto_data; 580 yd = gc->proto_data;
581 account = purple_connection_get_account(gc); 581 account = purple_connection_get_account(gc);
632 static void yahoo_xfer_end(PurpleXfer *xfer_old) 632 static void yahoo_xfer_end(PurpleXfer *xfer_old)
633 { 633 {
634 struct yahoo_xfer_data *xfer_data; 634 struct yahoo_xfer_data *xfer_data;
635 PurpleXfer *xfer = NULL; 635 PurpleXfer *xfer = NULL;
636 PurpleConnection *gc; 636 PurpleConnection *gc;
637 struct yahoo_data *yd; 637 YahooData *yd;
638 638
639 xfer_data = xfer_old->data; 639 xfer_data = xfer_old->data;
640 if(xfer_data && xfer_data->version == 15 640 if(xfer_data && xfer_data->version == 15
641 && purple_xfer_get_type(xfer_old) == PURPLE_XFER_RECEIVE 641 && purple_xfer_get_type(xfer_old) == PURPLE_XFER_RECEIVE
642 && xfer_data->filename_list) { 642 && xfer_data->filename_list) {
800 char *msg = NULL; 800 char *msg = NULL;
801 char *url = NULL; 801 char *url = NULL;
802 char *imv = NULL; 802 char *imv = NULL;
803 long expires = 0; 803 long expires = 0;
804 PurpleXfer *xfer; 804 PurpleXfer *xfer;
805 struct yahoo_data *yd; 805 YahooData *yd;
806 struct yahoo_xfer_data *xfer_data; 806 struct yahoo_xfer_data *xfer_data;
807 char *service = NULL; 807 char *service = NULL;
808 char *filename = NULL; 808 char *filename = NULL;
809 unsigned long filesize = 0L; 809 unsigned long filesize = 0L;
810 GSList *l; 810 GSList *l;
983 struct yahoo_packet *pkt; 983 struct yahoo_packet *pkt;
984 long actaddr; 984 long actaddr;
985 long a,b,c,d; 985 long a,b,c,d;
986 PurpleConnection *gc; 986 PurpleConnection *gc;
987 PurpleAccount *account; 987 PurpleAccount *account;
988 struct yahoo_data *yd; 988 YahooData *yd;
989 gchar *url; 989 gchar *url;
990 gchar *filename; 990 gchar *filename;
991 991
992 if (!(xfer = data)) 992 if (!(xfer = data))
993 return; 993 return;
1066 } 1066 }
1067 1067
1068 void yahoo_send_file(PurpleConnection *gc, const char *who, const char *file) 1068 void yahoo_send_file(PurpleConnection *gc, const char *who, const char *file)
1069 { 1069 {
1070 struct yahoo_xfer_data *xfer_data; 1070 struct yahoo_xfer_data *xfer_data;
1071 struct yahoo_data *yd = gc->proto_data; 1071 YahooData *yd = gc->proto_data;
1072 PurpleXfer *xfer = yahoo_new_xfer(gc, who); 1072 PurpleXfer *xfer = yahoo_new_xfer(gc, who);
1073 1073
1074 g_return_if_fail(xfer != NULL); 1074 g_return_if_fail(xfer != NULL);
1075 1075
1076 /* if we don't have a p2p connection, try establishing it now */ 1076 /* if we don't have a p2p connection, try establishing it now */
1224 static void yahoo_xfer_connected_15(gpointer data, gint source, const gchar *error_message) 1224 static void yahoo_xfer_connected_15(gpointer data, gint source, const gchar *error_message)
1225 { 1225 {
1226 PurpleXfer *xfer; 1226 PurpleXfer *xfer;
1227 struct yahoo_xfer_data *xd; 1227 struct yahoo_xfer_data *xd;
1228 PurpleAccount *account; 1228 PurpleAccount *account;
1229 struct yahoo_data* yd; 1229 YahooData* yd;
1230 1230
1231 if (!(xfer = data)) 1231 if (!(xfer = data))
1232 return; 1232 return;
1233 if (!(xd = xfer->data)) 1233 if (!(xd = xfer->data))
1234 return; 1234 return;
1477 { 1477 {
1478 PurpleXfer *xfer; 1478 PurpleXfer *xfer;
1479 struct yahoo_xfer_data *xd; 1479 struct yahoo_xfer_data *xd;
1480 struct yahoo_packet *pkt; 1480 struct yahoo_packet *pkt;
1481 PurpleAccount *account; 1481 PurpleAccount *account;
1482 struct yahoo_data *yd; 1482 YahooData *yd;
1483 gchar *filename; 1483 gchar *filename;
1484 const char *local_ip; 1484 const char *local_ip;
1485 gchar *url_to_send = NULL; 1485 gchar *url_to_send = NULL;
1486 char *filename_without_spaces = NULL; 1486 char *filename_without_spaces = NULL;
1487 1487
1544 static void yahoo_p2p_client_send_ft_info(PurpleConnection *gc, PurpleXfer *xfer) 1544 static void yahoo_p2p_client_send_ft_info(PurpleConnection *gc, PurpleXfer *xfer)
1545 { 1545 {
1546 struct yahoo_xfer_data *xd; 1546 struct yahoo_xfer_data *xd;
1547 struct yahoo_packet *pkt; 1547 struct yahoo_packet *pkt;
1548 PurpleAccount *account; 1548 PurpleAccount *account;
1549 struct yahoo_data *yd; 1549 YahooData *yd;
1550 gchar *filename; 1550 gchar *filename;
1551 struct yahoo_p2p_data *p2p_data; 1551 struct yahoo_p2p_data *p2p_data;
1552 1552
1553 if (!(xd = xfer->data)) 1553 if (!(xd = xfer->data))
1554 return; 1554 return;
1581 char *from = NULL; 1581 char *from = NULL;
1582 char *to = NULL; 1582 char *to = NULL;
1583 char *imv = NULL; 1583 char *imv = NULL;
1584 long val_222 = 0L; 1584 long val_222 = 0L;
1585 PurpleXfer *xfer; 1585 PurpleXfer *xfer;
1586 struct yahoo_data *yd; 1586 YahooData *yd;
1587 struct yahoo_xfer_data *xfer_data; 1587 struct yahoo_xfer_data *xfer_data;
1588 char *service = NULL; 1588 char *service = NULL;
1589 char *filename = NULL; 1589 char *filename = NULL;
1590 char *xfer_peer_idstring = NULL; 1590 char *xfer_peer_idstring = NULL;
1591 unsigned long filesize = 0L; 1591 unsigned long filesize = 0L;
1758 char *to = NULL; 1758 char *to = NULL;
1759 char *url = NULL; 1759 char *url = NULL;
1760 long val_249 = 0; 1760 long val_249 = 0;
1761 long val_66 = 0; 1761 long val_66 = 0;
1762 PurpleXfer *xfer; 1762 PurpleXfer *xfer;
1763 struct yahoo_data *yd; 1763 YahooData *yd;
1764 struct yahoo_xfer_data *xfer_data; 1764 struct yahoo_xfer_data *xfer_data;
1765 char *filename = NULL; 1765 char *filename = NULL;
1766 char *xfer_peer_idstring = NULL; 1766 char *xfer_peer_idstring = NULL;
1767 char *xfer_idstring_for_relay = NULL; 1767 char *xfer_idstring_for_relay = NULL;
1768 GSList *l; 1768 GSList *l;
1865 void yahoo_process_filetrans_acc_15(PurpleConnection *gc, struct yahoo_packet *pkt) 1865 void yahoo_process_filetrans_acc_15(PurpleConnection *gc, struct yahoo_packet *pkt)
1866 { 1866 {
1867 gchar *xfer_peer_idstring = NULL; 1867 gchar *xfer_peer_idstring = NULL;
1868 gchar *xfer_idstring_for_relay = NULL; 1868 gchar *xfer_idstring_for_relay = NULL;
1869 PurpleXfer *xfer; 1869 PurpleXfer *xfer;
1870 struct yahoo_data *yd; 1870 YahooData *yd;
1871 struct yahoo_xfer_data *xfer_data; 1871 struct yahoo_xfer_data *xfer_data;
1872 GSList *l; 1872 GSList *l;
1873 PurpleAccount *account; 1873 PurpleAccount *account;
1874 long val_66 = 0; 1874 long val_66 = 0;
1875 gchar *url = NULL; 1875 gchar *url = NULL;