Mercurial > pidgin.yaz
comparison libpurple/protocols/yahoo/yahoo_filexfer.c @ 27766:056fb36a5770
propagate from branch 'im.pidgin.pidgin' (head 7a8f58fc7611c332a05ed1c1b8417be24c9cf981)
to branch 'im.pidgin.pidgin.yaz' (head 9937b0516237dfce73c86fd0407e37b0619e3037)
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Wed, 20 Feb 2008 06:56:39 +0000 |
parents | cc5b2a145652 e9cf897bd873 |
children | 0f3a131d23da |
comparison
equal
deleted
inserted
replaced
22313:42724bd41274 | 27766:056fb36a5770 |
---|---|
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); |