pidgin: f100b483: Restore the conversation SaveAs function...

qulogic at pidgin.im qulogic at pidgin.im
Mon Jun 4 04:26:00 EDT 2012


----------------------------------------------------------------------
Revision: f100b48348f534758d716bab2a2389d9468b38f6
Parent:   a1328bdeb01ec697c6d125f8a089de977d07a2de
Author:   qulogic at pidgin.im
Date:     06/02/12 15:08:43
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f100b48348f534758d716bab2a2389d9468b38f6

Changelog: 

Restore the conversation SaveAs functionality.

Changes against parent a1328bdeb01ec697c6d125f8a089de977d07a2de

  patched  pidgin/gtkconv.c

-------------- next part --------------
============================================================
--- pidgin/gtkconv.c	a6aadae2149006f109d8224ed9dc760bce4a236f
+++ pidgin/gtkconv.c	37bd09e5dbc4b8c31c01695b8e37b8d382f4b480
@@ -1066,12 +1066,10 @@ savelog_writefile_cb(void *user_data, co
 static void
 savelog_writefile_cb(void *user_data, const char *filename)
 {
-	/* TODO WEBKIT: I don't know how to support this using webkit yet. */
-#if 0
 	PurpleConversation *conv = (PurpleConversation *)user_data;
+	GtkWebView *webview;
 	FILE *fp;
 	const char *name;
-	char **lines;
 	gchar *text;
 
 	if ((fp = g_fopen(filename, "w+")) == NULL) {
@@ -1079,22 +1077,27 @@ savelog_writefile_cb(void *user_data, co
 		return;
 	}
 
+	webview = GTK_WEBVIEW(PIDGIN_CONVERSATION(conv)->webview);
 	name = purple_conversation_get_name(conv);
-	fprintf(fp, "<html>\n<head>\n");
+	fprintf(fp, "<html>\n");
+
+	fprintf(fp, "<head>\n");
 	fprintf(fp, "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n");
-	fprintf(fp, "<title>%s</title>\n</head>\n<body>\n", name);
-	fprintf(fp, _("<h1>Conversation with %s</h1>\n"), name);
+	fprintf(fp, "<title>%s</title>\n", name);
+	text = gtk_webview_get_head_html(webview);
+	fprintf(fp, "%s", text);
+	g_free(text);
+	fprintf(fp, "</head>\n");
 
-	lines = gtk_imhtml_get_markup_lines(
-		GTK_IMHTML(PIDGIN_CONVERSATION(conv)->imhtml));
-	text = g_strjoinv("<br>\n", lines);
+	fprintf(fp, "<body>\n");
+	fprintf(fp, _("<h1>Conversation with %s</h1>\n"), name);
+	text = gtk_webview_get_body_html(webview);
 	fprintf(fp, "%s", text);
 	g_free(text);
-	g_strfreev(lines);
+	fprintf(fp, "\n</body>\n");
 
-	fprintf(fp, "\n</body>\n</html>\n");
+	fprintf(fp, "</html>\n");
 	fclose(fp);
-#endif /* if 0 */
 }
 
 /*


More information about the Commits mailing list