Tue, 25 Jan 2011 09:39:59 +0000
When drag-dropping an image into an IM window and sending as an inline
image in a direct IM, strip the full path from the filename and just use
the basename.ext. Fixes #13098
| pidgin/gtkutils.c | file | annotate | diff | comparison | revisions |
--- a/pidgin/gtkutils.c Sun Jan 23 21:57:49 2011 +0000 +++ b/pidgin/gtkutils.c Tue Jan 25 09:39:59 2011 +0000 @@ -1463,6 +1463,7 @@ static void dnd_image_ok_callback(_DndData *data, int choice) { + const gchar *shortname; gchar *filedata; size_t size; struct stat st; @@ -1517,7 +1518,9 @@ break; } - id = purple_imgstore_add_with_id(filedata, size, data->filename); + shortname = strrchr(data->filename, G_DIR_SEPARATOR); + shortname = shortname ? shortname + 1 : data->filename; + id = purple_imgstore_add_with_id(filedata, size, shortname); gtk_text_buffer_get_iter_at_mark(GTK_IMHTML(gtkconv->entry)->text_buffer, &iter, gtk_text_buffer_get_insert(GTK_IMHTML(gtkconv->entry)->text_buffer));