Mercurial > pidgin.yaz
comparison libpurple/protocols/yahoo/yahoo_filexfer.c @ 27892:d477b5b53660
propagate from branch 'im.pidgin.pidgin' (head a77a8a85e623af608434736b9e63cc17507ec60c)
to branch 'im.pidgin.pidgin.yaz' (head b6620638db9843c51a3140a4bc83482b0a69bd11)
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Sat, 27 Sep 2008 13:28:07 +0000 |
parents | 1dd0e007514d |
children | 6ecfc6b9667c |
comparison
equal
deleted
inserted
replaced
24126:43164dadf922 | 27892:d477b5b53660 |
---|---|
215 static void yahoo_sendfile_connected(gpointer data, gint source, const gchar *error_message) | 215 static void yahoo_sendfile_connected(gpointer data, gint source, const gchar *error_message) |
216 { | 216 { |
217 PurpleXfer *xfer; | 217 PurpleXfer *xfer; |
218 struct yahoo_xfer_data *xd; | 218 struct yahoo_xfer_data *xd; |
219 struct yahoo_packet *pkt; | 219 struct yahoo_packet *pkt; |
220 gchar *size, *filename, *encoded_filename, *header; | 220 gchar *size, *filename, *encoded_filename, *header, *tmp = NULL; |
221 guchar *pkt_buf; | 221 guchar *pkt_buf; |
222 const char *host; | 222 const char *host; |
223 int port; | 223 int port; |
224 size_t content_length, header_len, pkt_buf_len; | 224 size_t content_length, header_len, pkt_buf_len; |
225 PurpleConnection *gc; | 225 PurpleConnection *gc; |
226 PurpleAccount *account; | 226 PurpleAccount *account; |
227 struct yahoo_data *yd; | 227 struct yahoo_data *yd; |
228 gsize dummy; | |
228 | 229 |
229 purple_debug(PURPLE_DEBUG_INFO, "yahoo", | 230 purple_debug(PURPLE_DEBUG_INFO, "yahoo", |
230 "AAA - in yahoo_sendfile_connected\n"); | 231 "AAA - in yahoo_sendfile_connected\n"); |
231 if (!(xfer = data)) | 232 if (!(xfer = data)) |
232 return; | 233 return; |
249 | 250 |
250 pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANSFER, | 251 pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANSFER, |
251 YAHOO_STATUS_AVAILABLE, yd->session_id); | 252 YAHOO_STATUS_AVAILABLE, yd->session_id); |
252 | 253 |
253 size = g_strdup_printf("%" G_GSIZE_FORMAT, purple_xfer_get_size(xfer)); | 254 size = g_strdup_printf("%" G_GSIZE_FORMAT, purple_xfer_get_size(xfer)); |
254 filename = g_path_get_basename(purple_xfer_get_local_filename(xfer)); | 255 |
255 encoded_filename = yahoo_string_encode(gc, filename, NULL); | 256 /* yaz */ |
257 tmp = g_filename_display_basename(purple_xfer_get_local_filename(xfer)); | |
258 filename = botch_utf(tmp, strlen(tmp), &dummy); | |
259 g_free(tmp); | |
260 encoded_filename = yahoo_string_encode(gc, filename, NULL); // this takes utf8 as input. --yaz | |
256 | 261 |
257 yahoo_packet_hash(pkt, "sssss", 0, purple_connection_get_display_name(gc), | 262 yahoo_packet_hash(pkt, "sssss", 0, purple_connection_get_display_name(gc), |
258 5, xfer->who, 14, "", 27, encoded_filename, 28, size); | 263 5, xfer->who, 14, "", 27, encoded_filename, 28, size); |
259 g_free(size); | 264 g_free(size); |
260 g_free(encoded_filename); | 265 g_free(encoded_filename); |
946 { | 951 { |
947 PurpleXfer *xfer; | 952 PurpleXfer *xfer; |
948 struct yahoo_xfer_data *xd; | 953 struct yahoo_xfer_data *xd; |
949 struct sockaddr_in *addr; | 954 struct sockaddr_in *addr; |
950 struct yahoo_packet *pkt; | 955 struct yahoo_packet *pkt; |
951 long actaddr; | 956 unsigned long actaddr; |
952 long a,b,c,d; | 957 unsigned long a,b,c,d; |
953 PurpleConnection *gc; | 958 PurpleConnection *gc; |
954 PurpleAccount *account; | 959 PurpleAccount *account; |
955 struct yahoo_data *yd; | 960 struct yahoo_data *yd; |
956 gchar *url; | 961 gchar *url; |
957 gchar *filename; | 962 gchar *filename; |
1041 | 1046 |
1042 /* To determine if we should use yahoo p15 for transfer. Check other user's | 1047 /* To determine if we should use yahoo p15 for transfer. Check other user's |
1043 * reported version, but if we're on Yahoo Japan, ignore it. */ | 1048 * reported version, but if we're on Yahoo Japan, ignore it. */ |
1044 if(yf && yf->version_id > 500000 && !yd->jp) | 1049 if(yf && yf->version_id > 500000 && !yd->jp) |
1045 ver = 15; | 1050 ver = 15; |
1051 | |
1052 /* recent yahoo japan --yaz */ | |
1053 if(yd->jp && yf && yf->version_id > 500000) | |
1054 ver = 15; | |
1046 | 1055 |
1047 g_return_if_fail(xfer != NULL); | 1056 g_return_if_fail(xfer != NULL); |
1048 | 1057 |
1049 if(ver == 15) { | 1058 if(ver == 15) { |
1050 xfer_data = xfer->data; | 1059 xfer_data = xfer->data; |