comparison src/protocols/yahoo/yahoo.c @ 8503:4c3ec649fd7d

[gaim-migrate @ 9239] Another patch from marv. I think this is his hojillionth patch since 0.75 was released. They should just call him Tim Rockinbach. "unescape outgoing status msgs" ...so that < doesn't show up as &lt; to people committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 25 Mar 2004 06:51:51 +0000
parents 791c05d1679d
children e3c059c3d92d
comparison
equal deleted inserted replaced
8502:48112dfe1179 8503:4c3ec649fd7d
2581 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; 2581 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data;
2582 struct yahoo_packet *pkt; 2582 struct yahoo_packet *pkt;
2583 int service; 2583 int service;
2584 char s[4]; 2584 char s[4];
2585 char *conv_msg = NULL; 2585 char *conv_msg = NULL;
2586 char *conv_msg2 = NULL;
2586 2587
2587 if (gc->away) { 2588 if (gc->away) {
2588 g_free(gc->away); 2589 g_free(gc->away);
2589 gc->away = NULL; 2590 gc->away = NULL;
2590 } 2591 }
2638 g_snprintf(s, sizeof(s), "%d", yd->current_status); 2639 g_snprintf(s, sizeof(s), "%d", yd->current_status);
2639 yahoo_packet_hash(pkt, 10, s); 2640 yahoo_packet_hash(pkt, 10, s);
2640 2641
2641 if ((yd->current_status == YAHOO_STATUS_CUSTOM) && gc->away) { 2642 if ((yd->current_status == YAHOO_STATUS_CUSTOM) && gc->away) {
2642 conv_msg = yahoo_string_encode(gc, gc->away, NULL); 2643 conv_msg = yahoo_string_encode(gc, gc->away, NULL);
2643 yahoo_packet_hash(pkt, 19, conv_msg); 2644 conv_msg2 = gaim_unescape_html(conv_msg);
2645 yahoo_packet_hash(pkt, 19, conv_msg2);
2644 } 2646 }
2645 2647
2646 if ((yd->current_status != YAHOO_STATUS_AVAILABLE) && 2648 if ((yd->current_status != YAHOO_STATUS_AVAILABLE) &&
2647 (yd->current_status != YAHOO_STATUS_IDLE)) { 2649 (yd->current_status != YAHOO_STATUS_IDLE)) {
2648 if (gc->is_idle) 2650 if (gc->is_idle)
2653 2655
2654 yahoo_send_packet(yd, pkt); 2656 yahoo_send_packet(yd, pkt);
2655 yahoo_packet_free(pkt); 2657 yahoo_packet_free(pkt);
2656 if (conv_msg) 2658 if (conv_msg)
2657 g_free(conv_msg); 2659 g_free(conv_msg);
2660 if (conv_msg2)
2661 g_free(conv_msg2);
2658 } 2662 }
2659 2663
2660 static void yahoo_set_idle(GaimConnection *gc, int idle) 2664 static void yahoo_set_idle(GaimConnection *gc, int idle)
2661 { 2665 {
2662 struct yahoo_data *yd = gc->proto_data; 2666 struct yahoo_data *yd = gc->proto_data;
2663 struct yahoo_packet *pkt = NULL; 2667 struct yahoo_packet *pkt = NULL;
2664 char *msg = NULL; 2668 char *msg = NULL, *msg2 = NULL;
2665 2669
2666 if (idle && yd->current_status == YAHOO_STATUS_AVAILABLE) { 2670 if (idle && yd->current_status == YAHOO_STATUS_AVAILABLE) {
2667 pkt = yahoo_packet_new(YAHOO_SERVICE_ISAWAY, YAHOO_STATUS_AVAILABLE, 0); 2671 pkt = yahoo_packet_new(YAHOO_SERVICE_ISAWAY, YAHOO_STATUS_AVAILABLE, 0);
2668 yd->current_status = YAHOO_STATUS_IDLE; 2672 yd->current_status = YAHOO_STATUS_IDLE;
2669 } else if (!idle && yd->current_status == YAHOO_STATUS_IDLE) { 2673 } else if (!idle && yd->current_status == YAHOO_STATUS_IDLE) {
2677 char buf[4]; 2681 char buf[4];
2678 g_snprintf(buf, sizeof(buf), "%d", yd->current_status); 2682 g_snprintf(buf, sizeof(buf), "%d", yd->current_status);
2679 yahoo_packet_hash(pkt, 10, buf); 2683 yahoo_packet_hash(pkt, 10, buf);
2680 if (gc->away && yd->current_status == YAHOO_STATUS_CUSTOM) { 2684 if (gc->away && yd->current_status == YAHOO_STATUS_CUSTOM) {
2681 msg = yahoo_string_encode(gc, gc->away, NULL); 2685 msg = yahoo_string_encode(gc, gc->away, NULL);
2682 yahoo_packet_hash(pkt, 19, msg); 2686 msg2 = gaim_unescape_html(msg);
2687 yahoo_packet_hash(pkt, 19, msg2);
2683 if (idle) 2688 if (idle)
2684 yahoo_packet_hash(pkt, 47, "2"); 2689 yahoo_packet_hash(pkt, 47, "2");
2685 else 2690 else
2686 yahoo_packet_hash(pkt, 47, "1"); /* fixme when available messages are possible */ 2691 yahoo_packet_hash(pkt, 47, "1"); /* fixme when available messages are possible */
2687 } else if (idle && (yd->current_status != YAHOO_STATUS_AVAILABLE) && 2692 } else if (idle && (yd->current_status != YAHOO_STATUS_AVAILABLE) &&
2695 yahoo_send_packet(yd, pkt); 2700 yahoo_send_packet(yd, pkt);
2696 yahoo_packet_free(pkt); 2701 yahoo_packet_free(pkt);
2697 } 2702 }
2698 if (msg) 2703 if (msg)
2699 g_free(msg); 2704 g_free(msg);
2705 if (msg2)
2706 g_free(msg2);
2700 } 2707 }
2701 2708
2702 static GList *yahoo_away_states(GaimConnection *gc) 2709 static GList *yahoo_away_states(GaimConnection *gc)
2703 { 2710 {
2704 GList *m = NULL; 2711 GList *m = NULL;