cpw.nader.asynclogging-3: 16b45a6c: Corrected PurpleTxtLog setting the PURPL...

morshed.nader at gmail.com morshed.nader at gmail.com
Thu Jan 5 22:51:27 EST 2012


----------------------------------------------------------------------
Revision: 16b45a6c63e44407a255e4c31df535810007f4bc
Parent:   b07e9d6876d378fa87e7c2eb63c0fa9563d0117f
Author:   morshed.nader at gmail.com
Date:     01/05/12 14:39:02
Branch:   im.pidgin.cpw.nader.asynclogging-3
URL: http://d.pidgin.im/viewmtn/revision/info/16b45a6c63e44407a255e4c31df535810007f4bc

Changelog: 

Corrected PurpleTxtLog setting the PURPLE_LOG_READ_NO_NEWLINE on read
Changed the call to display logs to set the mime type based on the read flag, displaying the text as html if PURPLE_LOG_READ_NO_NEWLINE is set and plaintext otherwise

Changes against parent b07e9d6876d378fa87e7c2eb63c0fa9563d0117f

  patched  libpurple/txtlog.c
  patched  pidgin/gtklog.c

-------------- next part --------------
============================================================
--- pidgin/gtklog.c	b5d00dacd9ac018f989a85737b28be4fed6879f2
+++ pidgin/gtklog.c	a0e8e4417a03aaa908140d9469337125f57b5c8f
@@ -766,6 +766,7 @@ pidgin_log_read_cb(GObject *object, GAsy
 		WebKitWebView *wv = WEBKIT_WEB_VIEW(pidgin_log_viewer_get_text_area(lv));
 		GError *error = NULL;
 		gchar *text;
+		const gchar *mime;
 
 		text = purple_log_read_finish(log, res, &flags, &error);
 
@@ -796,8 +797,13 @@ pidgin_log_read_cb(GObject *object, GAsy
 
 		purple_signal_emit(pidgin_log_get_handle(), "log-displaying", lv, log);
 
-		webkit_web_view_load_html_string(wv, text, "");
+		if (flags & PURPLE_LOG_READ_NO_NEWLINE)
+			mime = "text/html";
+		else
+			mime = "text/plain";
 
+		webkit_web_view_load_string(wv, text, mime, NULL, "");
+
 		/**
 		 * If we have something in the search bar, scroll to it in the
 		 * current log.
============================================================
--- libpurple/txtlog.c	414d86583297938e3b97af8a93cbacbf656895f8
+++ libpurple/txtlog.c	170b7a5869985babf3c9ec8e7425458864c24a9b
@@ -300,7 +300,6 @@ purple_txt_log_read_async_2(GObject *obj
 		return;
 	}
 
-	flags |= PURPLE_LOG_READ_NO_NEWLINE;
 	minus_header = strchr(read, '\n');
 
 	if (minus_header == NULL)


More information about the Commits mailing list