Mercurial > pidgin.yaz
comparison libpurple/protocols/yahoo/yahoo_filexfer.c @ 27767:76ff0ad87964
propagate from branch 'im.pidgin.pidgin' (head 9de3934cd71a8b08f0f6da39df8f0102d36fbd2b)
to branch 'im.pidgin.pidgin.yaz' (head d439d42fe8d0ee4a40486b4de12acb4116bc2e58)
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Mon, 25 Feb 2008 05:45:57 +0000 |
parents | 056fb36a5770 |
children | 0f3a131d23da |
comparison
equal
deleted
inserted
replaced
22325:9d02eb04f406 | 27767:76ff0ad87964 |
---|---|
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 size_t 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); |