changeset 11814:fa17fc619f17

[gaim-migrate @ 14105] Fix the display of smilies in text added to the imhtml by the history plugin. Fixes part of SF Bug #1298455. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Tue, 25 Oct 2005 13:29:28 +0000
parents 1f7f4f850db5
children 821f40e1912f
files plugins/ChangeLog.API plugins/history.c src/gtkimhtml.c src/gtkimhtml.h
diffstat 4 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/ChangeLog.API	Tue Oct 25 07:02:50 2005 +0000
+++ b/plugins/ChangeLog.API	Tue Oct 25 13:29:28 2005 +0000
@@ -106,6 +106,7 @@
 		messages to the specified account
 	* gtk_imhtml_clear_formatting()
 	* gtk_imhtml_delete to clear out part of a imhtml buffer
+	* gtk_imhtml_get_protocol_name()
 	* gaim_buddy_icons_get_full_path(), to get the full path of a buddy
 		icon setting
 	* CHAT_USERS_ALIAS_COLUMN, CHAT_USERS_COLOR_COLUMN,
--- a/plugins/history.c	Tue Oct 25 07:02:50 2005 +0000
+++ b/plugins/history.c	Tue Oct 25 13:29:28 2005 +0000
@@ -43,6 +43,7 @@
 	time_t tm;
 	char day[64];
 	char *header;
+	char *protocol;
 
 	convtype = gaim_conversation_get_type(c);
 	gtkconv = GAIM_GTK_CONVERSATION(c);
@@ -111,6 +112,10 @@
 	if (flags & GAIM_LOG_READ_NO_NEWLINE)
 		options |= GTK_IMHTML_NO_NEWLINE;
 
+	protocol = g_strdup(gtk_imhtml_get_protocol_name(GTK_IMHTML(gtkconv->imhtml)));
+	gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->imhtml),
+							      gaim_account_get_protocol_name(((GaimLog*)logs->data)->account));
+
 	tm = ((GaimLog *)logs->data)->time;
 	gaim_strftime(day, sizeof(day), "%c", localtime(&tm));
 	header = g_strdup_printf("<b>Conversation with %s on %s:</b><br>", alias, day);
@@ -122,6 +127,9 @@
 
 	gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<hr>", options);
 
+	gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->imhtml), protocol);
+	g_free(protocol);
+
 	g_object_ref(G_OBJECT(gtkconv->imhtml));
 	g_idle_add(_scroll_imhtml_to_end, gtkconv->imhtml);
 
--- a/src/gtkimhtml.c	Tue Oct 25 07:02:50 2005 +0000
+++ b/src/gtkimhtml.c	Tue Oct 25 13:29:28 2005 +0000
@@ -3046,6 +3046,11 @@
 	imhtml->show_comments = show;
 }
 
+const char *
+gtk_imhtml_get_protocol_name(GtkIMHtml *imhtml) {
+	return imhtml->protocol_name;
+}
+
 void
 gtk_imhtml_set_protocol_name(GtkIMHtml *imhtml, const gchar *protocol_name) {
 	if (imhtml->protocol_name)
--- a/src/gtkimhtml.h	Tue Oct 25 07:02:50 2005 +0000
+++ b/src/gtkimhtml.h	Tue Oct 25 13:29:28 2005 +0000
@@ -303,6 +303,13 @@
 void gtk_imhtml_show_comments(GtkIMHtml *imhtml, gboolean show);
 
 /**
+ * Gets the protocol name associated with this GTK+ IM/HTML.
+ *
+ * @param imhtml The GTK+ IM/HTML
+ */
+const char *gtk_imhtml_get_protocol_name(GtkIMHtml *imhtml);
+
+/**
  * Associates a protocol name with a GTK+ IM/HTML.
  *
  * @param imhtml        The GTK+ IM/HTML.