pidgin: a85d02f1: Link-ify the filename when writing the "...

qulogic at pidgin.im qulogic at pidgin.im
Tue Jul 7 02:35:35 EDT 2009


-----------------------------------------------------------------
Revision: a85d02f1b4038b6a119e8a89cf5b6564ac2022d7
Ancestor: 5b59e897e1e21b559cc42f414a84f744414154ce
Author: qulogic at pidgin.im
Date: 2009-07-07T06:18:24
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/a85d02f1b4038b6a119e8a89cf5b6564ac2022d7

Modified files:
        libpurple/ft.c

ChangeLog: 

Link-ify the filename when writing the "Transfer is complete" message to
the conversation window when receiving a file.

References #8254.

-------------- next part --------------
============================================================
--- libpurple/ft.c	001b040033429f66b53efdd5906b414ff1d4a5ce
+++ libpurple/ft.c	88aea75e43da3b1c64f266752992350e9dd7a9af
@@ -696,14 +696,34 @@ purple_xfer_set_completed(PurpleXfer *xf
 
 	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 <A HREF=\"file://%s\">%s</A> 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);
 	}
 


More information about the Commits mailing list