# HG changeset patch # User Elliott Sales de Andrade # Date 1246947504 0 # Node ID 740760605cc1bee6350ee49a77a40897dfbc1ae2 # Parent d375ef85519f4ddc173353e805214a5310851a05 Link-ify the filename when writing the "Transfer is complete" message to the conversation window when receiving a file. References #8254. diff -r d375ef85519f -r 740760605cc1 libpurple/ft.c --- a/libpurple/ft.c Tue Jul 07 04:16:29 2009 +0000 +++ b/libpurple/ft.c Tue Jul 07 06:18:24 2009 +0000 @@ -696,14 +696,34 @@ if (completed == TRUE) { char *msg = NULL; + PurpleConversation *conv; + purple_xfer_set_status(xfer, PURPLE_XFER_STATUS_DONE); if (purple_xfer_get_filename(xfer) != NULL) - msg = g_strdup_printf(_("Transfer of file %s complete"), - purple_xfer_get_filename(xfer)); + { + char *filename = g_markup_escape_text(purple_xfer_get_filename(xfer), -1); + if (purple_xfer_get_local_filename(xfer) + && purple_xfer_get_type(xfer) == PURPLE_XFER_RECEIVE) + { + char *local = g_markup_escape_text(purple_xfer_get_local_filename(xfer), -1); + msg = g_strdup_printf(_("Transfer of file %s complete"), + local, filename); + g_free(local); + } + else + msg = g_strdup_printf(_("Transfer of file %s complete"), + filename); + g_free(filename); + } else msg = g_strdup(_("File transfer complete")); - purple_xfer_conversation_write(xfer, msg, FALSE); + + conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, xfer->who, + purple_xfer_get_account(xfer)); + + if (conv != NULL) + purple_conversation_write(conv, NULL, msg, PURPLE_MESSAGE_SYSTEM, time(NULL)); g_free(msg); }