Mercurial > pidgin
comparison libpurple/protocols/yahoo/ycht.c @ 32672:3828a61c44da
A boring and large patch so I can merge heads.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Fri, 23 Dec 2011 08:21:58 +0000 |
parents | a5b556ac1de5 |
children |
comparison
equal
deleted
inserted
replaced
32671:0e69949b3e61 | 32672:3828a61c44da |
---|---|
51 * Functions to process various kinds of packets. | 51 * Functions to process various kinds of packets. |
52 ************************************************************************************/ | 52 ************************************************************************************/ |
53 static void ycht_process_login(YchtConn *ycht, YchtPkt *pkt) | 53 static void ycht_process_login(YchtConn *ycht, YchtPkt *pkt) |
54 { | 54 { |
55 PurpleConnection *gc = ycht->gc; | 55 PurpleConnection *gc = ycht->gc; |
56 YahooData *yd = gc->proto_data; | 56 YahooData *yd = purple_connection_get_protocol_data(gc); |
57 | 57 |
58 if (ycht->logged_in) | 58 if (ycht->logged_in) |
59 return; | 59 return; |
60 | 60 |
61 yd->chat_online = TRUE; | 61 yd->chat_online = TRUE; |
66 } | 66 } |
67 | 67 |
68 static void ycht_process_logout(YchtConn *ycht, YchtPkt *pkt) | 68 static void ycht_process_logout(YchtConn *ycht, YchtPkt *pkt) |
69 { | 69 { |
70 PurpleConnection *gc = ycht->gc; | 70 PurpleConnection *gc = ycht->gc; |
71 YahooData *yd = gc->proto_data; | 71 YahooData *yd = purple_connection_get_protocol_data(gc); |
72 | 72 |
73 yd->chat_online = FALSE; | 73 yd->chat_online = FALSE; |
74 ycht->logged_in = FALSE; | 74 ycht->logged_in = FALSE; |
75 } | 75 } |
76 | 76 |
171 | 171 |
172 static void ycht_progress_online_friends(YchtConn *ycht, YchtPkt *pkt) | 172 static void ycht_progress_online_friends(YchtConn *ycht, YchtPkt *pkt) |
173 { | 173 { |
174 #if 0 | 174 #if 0 |
175 PurpleConnection *gc = ycht->gc; | 175 PurpleConnection *gc = ycht->gc; |
176 YahooData *yd = gc->proto_data; | 176 YahooData *yd = purple_connection_get_protocol_data(gc); |
177 | 177 |
178 if (ycht->logged_in) | 178 if (ycht->logged_in) |
179 return; | 179 return; |
180 | 180 |
181 yd->chat_online = TRUE; | 181 yd->chat_online = TRUE; |
427 * structs, and all that stuff. | 427 * structs, and all that stuff. |
428 ************************************************************************************/ | 428 ************************************************************************************/ |
429 | 429 |
430 void ycht_connection_close(YchtConn *ycht) | 430 void ycht_connection_close(YchtConn *ycht) |
431 { | 431 { |
432 YahooData *yd = ycht->gc->proto_data; | 432 YahooData *yd = purple_connection_get_protocol_data(ycht->gc); |
433 | 433 |
434 if (yd) { | 434 if (yd) { |
435 yd->ycht = NULL; | 435 yd->ycht = NULL; |
436 yd->chat_online = FALSE; | 436 yd->chat_online = FALSE; |
437 } | 437 } |
539 | 539 |
540 static void ycht_got_connected(gpointer data, gint source, const gchar *error_message) | 540 static void ycht_got_connected(gpointer data, gint source, const gchar *error_message) |
541 { | 541 { |
542 YchtConn *ycht = data; | 542 YchtConn *ycht = data; |
543 PurpleConnection *gc = ycht->gc; | 543 PurpleConnection *gc = ycht->gc; |
544 YahooData *yd = gc->proto_data; | 544 YahooData *yd = purple_connection_get_protocol_data(gc); |
545 YchtPkt *pkt; | 545 YchtPkt *pkt; |
546 char *buf; | 546 char *buf; |
547 | 547 |
548 if (source < 0) { | 548 if (source < 0) { |
549 ycht_connection_error(ycht, _("Unable to connect")); | 549 ycht_connection_error(ycht, _("Unable to connect")); |
566 } | 566 } |
567 | 567 |
568 void ycht_connection_open(PurpleConnection *gc) | 568 void ycht_connection_open(PurpleConnection *gc) |
569 { | 569 { |
570 YchtConn *ycht; | 570 YchtConn *ycht; |
571 YahooData *yd = gc->proto_data; | 571 YahooData *yd = purple_connection_get_protocol_data(gc); |
572 PurpleAccount *account = purple_connection_get_account(gc); | 572 PurpleAccount *account = purple_connection_get_account(gc); |
573 | 573 |
574 ycht = g_new0(YchtConn, 1); | 574 ycht = g_new0(YchtConn, 1); |
575 ycht->gc = gc; | 575 ycht->gc = gc; |
576 ycht->fd = -1; | 576 ycht->fd = -1; |