# HG changeset patch # User Mark Doliner # Date 1295948399 0 # Node ID 85d5f1e37fdbc79e1d025cf35be270c99a474f2f # Parent 59bcbc35f9c017794c8898f91aa2791aabad9912 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 diff -r 59bcbc35f9c0 -r 85d5f1e37fdb pidgin/gtkutils.c --- 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));