Mercurial > pidgin
comparison src/protocols/yahoo/yahoo.c @ 11608:5e3f07172dab
[gaim-migrate @ 13879]
move the gaim_input_remove to the top to try to stop a crash.
committer: Tailor Script <tailor@pidgin.im>
author | Tim Ringenbach <marv@pidgin.im> |
---|---|
date | Tue, 04 Oct 2005 13:31:28 +0000 |
parents | a26eb48d1953 |
children | a9c5fcce537b |
comparison
equal
deleted
inserted
replaced
11607:cdab645d1ad6 | 11608:5e3f07172dab |
---|---|
663 static void yahoo_process_message(GaimConnection *gc, struct yahoo_packet *pkt) | 663 static void yahoo_process_message(GaimConnection *gc, struct yahoo_packet *pkt) |
664 { | 664 { |
665 GSList *l = pkt->hash; | 665 GSList *l = pkt->hash; |
666 GSList *list = NULL; | 666 GSList *list = NULL; |
667 struct _yahoo_im *im = NULL; | 667 struct _yahoo_im *im = NULL; |
668 | 668 |
669 char imv[16]; | 669 char imv[16]; |
670 | 670 |
671 if (pkt->status <= 1 || pkt->status == 5) { | 671 if (pkt->status <= 1 || pkt->status == 5) { |
672 while (l) { | 672 while (l) { |
673 struct yahoo_pair *pair = l->data; | 673 struct yahoo_pair *pair = l->data; |
699 } | 699 } |
700 } else if (pkt->status == 2) { | 700 } else if (pkt->status == 2) { |
701 gaim_notify_error(gc, NULL, | 701 gaim_notify_error(gc, NULL, |
702 _("Your Yahoo! message did not get sent."), NULL); | 702 _("Your Yahoo! message did not get sent."), NULL); |
703 } | 703 } |
704 | 704 |
705 // Check for the Doodle IMV | 705 // Check for the Doodle IMV |
706 if( !strcmp( imv, "doodle;11" ) ) | 706 if( !strcmp( imv, "doodle;11" ) ) |
707 { | 707 { |
708 GaimWhiteboard *wb; | 708 GaimWhiteboard *wb; |
709 | 709 |
710 g_print( "'doodle;11' found in chat packet\n" ); | 710 g_print( "'doodle;11' found in chat packet\n" ); |
711 | 711 |
712 wb = gaim_whiteboard_get_session( gc->account, im->from ); | 712 wb = gaim_whiteboard_get_session( gc->account, im->from ); |
713 | 713 |
714 // If a Doodle session doesn't exist between this user | 714 // If a Doodle session doesn't exist between this user |
715 if( wb == NULL ) | 715 if( wb == NULL ) |
716 { | 716 { |
717 g_print( "Creating new whiteboard for chat packet request\n" ); | 717 g_print( "Creating new whiteboard for chat packet request\n" ); |
718 wb = gaim_whiteboard_create( gc->account, im->from, DOODLE_STATE_REQUESTED ); | 718 wb = gaim_whiteboard_create( gc->account, im->from, DOODLE_STATE_REQUESTED ); |
719 | 719 |
720 yahoo_doodle_command_send_request( gc, im->from ); | 720 yahoo_doodle_command_send_request( gc, im->from ); |
721 yahoo_doodle_command_send_ready( gc, im->from ); | 721 yahoo_doodle_command_send_ready( gc, im->from ); |
722 } | 722 } |
723 } | 723 } |
724 | 724 |
2522 | 2522 |
2523 static void yahoo_close(GaimConnection *gc) { | 2523 static void yahoo_close(GaimConnection *gc) { |
2524 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; | 2524 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; |
2525 GSList *l; | 2525 GSList *l; |
2526 | 2526 |
2527 if (gc->inpa) | |
2528 gaim_input_remove(gc->inpa); | |
2529 | |
2527 for (l = yd->confs; l; l = l->next) { | 2530 for (l = yd->confs; l; l = l->next) { |
2528 GaimConversation *conv = l->data; | 2531 GaimConversation *conv = l->data; |
2529 | 2532 |
2530 yahoo_conf_leave(yd, gaim_conversation_get_name(conv), | 2533 yahoo_conf_leave(yd, gaim_conversation_get_name(conv), |
2531 gaim_connection_get_display_name(gc), | 2534 gaim_connection_get_display_name(gc), |
2552 g_free(yd->picture_url); | 2555 g_free(yd->picture_url); |
2553 if (yd->picture_upload_todo) | 2556 if (yd->picture_upload_todo) |
2554 yahoo_buddy_icon_upload_data_free(yd->picture_upload_todo); | 2557 yahoo_buddy_icon_upload_data_free(yd->picture_upload_todo); |
2555 if (yd->ycht) | 2558 if (yd->ycht) |
2556 ycht_connection_close(yd->ycht); | 2559 ycht_connection_close(yd->ycht); |
2557 if (gc->inpa) | 2560 |
2558 gaim_input_remove(gc->inpa); | |
2559 g_free(yd); | 2561 g_free(yd); |
2560 } | 2562 } |
2561 | 2563 |
2562 static const char *yahoo_list_icon(GaimAccount *a, GaimBuddy *b) | 2564 static const char *yahoo_list_icon(GaimAccount *a, GaimBuddy *b) |
2563 { | 2565 { |
2999 wb = gaim_whiteboard_get_session(gc->account, (char*)who); | 3001 wb = gaim_whiteboard_get_session(gc->account, (char*)who); |
3000 if (wb) | 3002 if (wb) |
3001 yahoo_packet_hash_str(pkt, 63, "doodle;11"); | 3003 yahoo_packet_hash_str(pkt, 63, "doodle;11"); |
3002 else | 3004 else |
3003 yahoo_packet_hash_str(pkt, 63, ";0"); // IMvironment | 3005 yahoo_packet_hash_str(pkt, 63, ";0"); // IMvironment |
3004 | 3006 |
3005 yahoo_packet_hash_str(pkt, 64, "0"); /* no idea */ | 3007 yahoo_packet_hash_str(pkt, 64, "0"); /* no idea */ |
3006 yahoo_packet_hash_str(pkt, 1002, "1"); /* no idea, Yahoo 6 or later only it seems */ | 3008 yahoo_packet_hash_str(pkt, 1002, "1"); /* no idea, Yahoo 6 or later only it seems */ |
3007 if (!yd->picture_url) | 3009 if (!yd->picture_url) |
3008 yahoo_packet_hash_str(pkt, 206, "0"); /* 0 = no picture, 2 = picture, maybe 1 = avatar? */ | 3010 yahoo_packet_hash_str(pkt, 206, "0"); /* 0 = no picture, 2 = picture, maybe 1 = avatar? */ |
3009 else | 3011 else |
3540 _("join <room>: Join a chat room on the Yahoo network"), NULL); | 3542 _("join <room>: Join a chat room on the Yahoo network"), NULL); |
3541 gaim_cmd_register("buzz", "", GAIM_CMD_P_PRPL, | 3543 gaim_cmd_register("buzz", "", GAIM_CMD_P_PRPL, |
3542 GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_PRPL_ONLY, | 3544 GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_PRPL_ONLY, |
3543 "prpl-yahoo", yahoogaim_cmd_buzz, | 3545 "prpl-yahoo", yahoogaim_cmd_buzz, |
3544 _("buzz: Buzz a contact to get their attention"), NULL); | 3546 _("buzz: Buzz a contact to get their attention"), NULL); |
3545 | 3547 |
3546 gaim_cmd_register("doodle", "", GAIM_CMD_P_PRPL, | 3548 gaim_cmd_register("doodle", "", GAIM_CMD_P_PRPL, |
3547 GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_PRPL_ONLY, | 3549 GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_PRPL_ONLY, |
3548 "prpl-yahoo", yahoo_doodle_gaim_cmd_start, | 3550 "prpl-yahoo", yahoo_doodle_gaim_cmd_start, |
3549 _("doodle: Request user to start a Doodle session"), NULL); | 3551 _("doodle: Request user to start a Doodle session"), NULL); |
3550 } | 3552 } |