| 2834 struct yahoo_data *yd = gc->proto_data; |
2834 struct yahoo_data *yd = gc->proto_data; |
| 2835 struct yahoo_packet *pkt = yahoo_packet_new(YAHOO_SERVICE_MESSAGE, YAHOO_STATUS_OFFLINE, 0); |
2835 struct yahoo_packet *pkt = yahoo_packet_new(YAHOO_SERVICE_MESSAGE, YAHOO_STATUS_OFFLINE, 0); |
| 2836 char *msg = yahoo_html_to_codes(what); |
2836 char *msg = yahoo_html_to_codes(what); |
| 2837 char *msg2; |
2837 char *msg2; |
| 2838 gboolean utf8 = TRUE; |
2838 gboolean utf8 = TRUE; |
| |
2839 int ret = 1; |
| 2839 |
2840 |
| 2840 msg2 = yahoo_string_encode(gc, msg, &utf8); |
2841 msg2 = yahoo_string_encode(gc, msg, &utf8); |
| 2841 |
2842 |
| 2842 yahoo_packet_hash(pkt, 1, gaim_connection_get_display_name(gc)); |
2843 yahoo_packet_hash(pkt, 1, gaim_connection_get_display_name(gc)); |
| 2843 yahoo_packet_hash(pkt, 5, who); |
2844 yahoo_packet_hash(pkt, 5, who); |
| 2851 if (!yd->picture_url) |
2852 if (!yd->picture_url) |
| 2852 yahoo_packet_hash(pkt, 206, "0"); /* 0 = no picture, 2 = picture, maybe 1 = avatar? */ |
2853 yahoo_packet_hash(pkt, 206, "0"); /* 0 = no picture, 2 = picture, maybe 1 = avatar? */ |
| 2853 else |
2854 else |
| 2854 yahoo_packet_hash(pkt, 206, "2"); |
2855 yahoo_packet_hash(pkt, 206, "2"); |
| 2855 |
2856 |
| 2856 yahoo_send_packet(yd, pkt); |
2857 /* We may need to not send any packets over 2000 bytes, but I'm not sure yet. */ |
| |
2858 if ((YAHOO_PACKET_HDRLEN + yahoo_packet_length(pkt)) <= 2000) |
| |
2859 yahoo_send_packet(yd, pkt); |
| |
2860 else |
| |
2861 ret = -E2BIG; |
| 2857 |
2862 |
| 2858 yahoo_packet_free(pkt); |
2863 yahoo_packet_free(pkt); |
| 2859 |
2864 |
| 2860 g_free(msg); |
2865 g_free(msg); |
| 2861 g_free(msg2); |
2866 g_free(msg2); |
| 2862 |
2867 |
| 2863 return 1; |
2868 return ret; |
| 2864 } |
2869 } |
| 2865 |
2870 |
| 2866 int yahoo_send_typing(GaimConnection *gc, const char *who, int typ) |
2871 int yahoo_send_typing(GaimConnection *gc, const char *who, int typ) |
| 2867 { |
2872 { |
| 2868 struct yahoo_data *yd = gc->proto_data; |
2873 struct yahoo_data *yd = gc->proto_data; |