# HG changeset patch # User Richard Laager # Date 1130246968 0 # Node ID fa17fc619f17e37ccfd9d0ea1077508566acdd2a # Parent 1f7f4f850db58f311094789e30a44cc417a27363 [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 diff -r 1f7f4f850db5 -r fa17fc619f17 plugins/ChangeLog.API --- 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, diff -r 1f7f4f850db5 -r fa17fc619f17 plugins/history.c --- 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("Conversation with %s on %s:
", alias, day); @@ -122,6 +127,9 @@ gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "
", 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); diff -r 1f7f4f850db5 -r fa17fc619f17 src/gtkimhtml.c --- 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) diff -r 1f7f4f850db5 -r fa17fc619f17 src/gtkimhtml.h --- 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.