# HG changeset patch # User Marcus Lundblad # Date 1256162881 0 # Node ID cb09d358d777a77bcfbedc59cfd41ddf57de6d61 # Parent 5502f855ec2bdaadb3082cd0bb0f9340a8d06b14 Make it work again, after some new xfer UI ops where added... :) Display the thumbnail in the ongoing conversation. diff -r 5502f855ec2b -r cb09d358d777 libpurple/ft.c --- a/libpurple/ft.c Tue Oct 20 22:32:09 2009 +0000 +++ b/libpurple/ft.c Wed Oct 21 22:08:01 2009 +0000 @@ -217,7 +217,7 @@ PurpleConversation *conv = NULL; PurpleMessageFlags flags = PURPLE_MESSAGE_SYSTEM; char *escaped; - + g_return_if_fail(xfer != NULL); g_return_if_fail(message != NULL); @@ -478,12 +478,34 @@ else if (purple_xfer_get_filename(xfer) || purple_xfer_get_status(xfer) == PURPLE_XFER_STATUS_ACCEPTED) { + /* write thumbnail to the conversation, if there is one */ + const gpointer *thumbnail_data = + purple_xfer_get_thumbnail_data(xfer); gchar* message = NULL; PurpleBuddy *buddy = purple_find_buddy(xfer->account, xfer->who); + message = g_strdup_printf(_("%s is offering to send file %s"), buddy ? purple_buddy_get_alias(buddy) : xfer->who, purple_xfer_get_filename(xfer)); purple_xfer_conversation_write(xfer, message, FALSE); g_free(message); + if (thumbnail_data) { + PurpleConversation *conv = + purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, + xfer->who, purple_xfer_get_account(xfer)); + if (conv) { + gsize size = purple_xfer_get_thumbnail_size(xfer); + gpointer data = g_memdup(thumbnail_data, size); + int id = purple_imgstore_add_with_id(data, size, NULL); + + message = g_strdup_printf("", id); + purple_conversation_write(conv, NULL, message, + PURPLE_MESSAGE_SYSTEM, time(NULL)); + purple_imgstore_unref_by_id(id); + g_free(message); + } + } + + /* Ask for a filename to save to if it's not already given by a plugin */ if (xfer->local_filename == NULL) purple_xfer_ask_recv(xfer); diff -r 5502f855ec2b -r cb09d358d777 libpurple/protocols/jabber/si.c --- a/libpurple/protocols/jabber/si.c Tue Oct 20 22:32:09 2009 +0000 +++ b/libpurple/protocols/jabber/si.c Wed Oct 21 22:08:01 2009 +0000 @@ -1674,6 +1674,11 @@ purple_debug_error("jabber", "Unknown response to data request\n"); } purple_xfer_request(xfer); + if (data) { + PurpleConversation *conv = + purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, + from, js->gc->account); + } } void jabber_si_parse(JabberStream *js, const char *from, JabberIqType type, diff -r 5502f855ec2b -r cb09d358d777 pidgin/gtkft.c --- a/pidgin/gtkft.c Tue Oct 20 22:32:09 2009 +0000 +++ b/pidgin/gtkft.c Wed Oct 21 22:08:01 2009 +0000 @@ -1190,10 +1190,10 @@ pidgin_xfer_update_progress, pidgin_xfer_cancel_local, pidgin_xfer_cancel_remote, - pidgin_xfer_add_thumbnail, NULL, NULL, - NULL + NULL, + pidgin_xfer_add_thumbnail }; /**************************************************************************