| 53 * Functions to process various kinds of packets. |
53 * Functions to process various kinds of packets. |
| 54 ************************************************************************************/ |
54 ************************************************************************************/ |
| 55 static void ycht_process_login(YchtConn *ycht, YchtPkt *pkt) |
55 static void ycht_process_login(YchtConn *ycht, YchtPkt *pkt) |
| 56 { |
56 { |
| 57 PurpleConnection *gc = ycht->gc; |
57 PurpleConnection *gc = ycht->gc; |
| 58 struct yahoo_data *yd = gc->proto_data; |
58 YahooData *yd = gc->proto_data; |
| 59 |
59 |
| 60 if (ycht->logged_in) |
60 if (ycht->logged_in) |
| 61 return; |
61 return; |
| 62 |
62 |
| 63 yd->chat_online = TRUE; |
63 yd->chat_online = TRUE; |
| 68 } |
68 } |
| 69 |
69 |
| 70 static void ycht_process_logout(YchtConn *ycht, YchtPkt *pkt) |
70 static void ycht_process_logout(YchtConn *ycht, YchtPkt *pkt) |
| 71 { |
71 { |
| 72 PurpleConnection *gc = ycht->gc; |
72 PurpleConnection *gc = ycht->gc; |
| 73 struct yahoo_data *yd = gc->proto_data; |
73 YahooData *yd = gc->proto_data; |
| 74 |
74 |
| 75 yd->chat_online = FALSE; |
75 yd->chat_online = FALSE; |
| 76 ycht->logged_in = FALSE; |
76 ycht->logged_in = FALSE; |
| 77 } |
77 } |
| 78 |
78 |
| 429 * structs, and all that stuff. |
429 * structs, and all that stuff. |
| 430 ************************************************************************************/ |
430 ************************************************************************************/ |
| 431 |
431 |
| 432 void ycht_connection_close(YchtConn *ycht) |
432 void ycht_connection_close(YchtConn *ycht) |
| 433 { |
433 { |
| 434 struct yahoo_data *yd = ycht->gc->proto_data; |
434 YahooData *yd = ycht->gc->proto_data; |
| 435 |
435 |
| 436 if (yd) { |
436 if (yd) { |
| 437 yd->ycht = NULL; |
437 yd->ycht = NULL; |
| 438 yd->chat_online = FALSE; |
438 yd->chat_online = FALSE; |
| 439 } |
439 } |
| 541 |
541 |
| 542 static void ycht_got_connected(gpointer data, gint source, const gchar *error_message) |
542 static void ycht_got_connected(gpointer data, gint source, const gchar *error_message) |
| 543 { |
543 { |
| 544 YchtConn *ycht = data; |
544 YchtConn *ycht = data; |
| 545 PurpleConnection *gc = ycht->gc; |
545 PurpleConnection *gc = ycht->gc; |
| 546 struct yahoo_data *yd = gc->proto_data; |
546 YahooData *yd = gc->proto_data; |
| 547 YchtPkt *pkt; |
547 YchtPkt *pkt; |
| 548 char *buf; |
548 char *buf; |
| 549 |
549 |
| 550 if (source < 0) { |
550 if (source < 0) { |
| 551 ycht_connection_error(ycht, _("Unable to connect")); |
551 ycht_connection_error(ycht, _("Unable to connect")); |