pidgin/plugins/history.c

branch
release-2.2.2
changeset 20234
272ffbb581b0
parent 16749
14a3fdc0aed7
child 20288
5ca925a094e2
child 21076
bb293a21ce84
equal deleted inserted replaced
20233:d38146452955 20234:272ffbb581b0
40 char *history; 40 char *history;
41 PidginConversation *gtkconv; 41 PidginConversation *gtkconv;
42 GtkIMHtmlOptions options = GTK_IMHTML_NO_COLOURS; 42 GtkIMHtmlOptions options = GTK_IMHTML_NO_COLOURS;
43 char *header; 43 char *header;
44 char *protocol; 44 char *protocol;
45 char *escaped_alias;
45 46
46 convtype = purple_conversation_get_type(c); 47 convtype = purple_conversation_get_type(c);
47 gtkconv = PIDGIN_CONVERSATION(c); 48 gtkconv = PIDGIN_CONVERSATION(c);
48 if (convtype == PURPLE_CONV_TYPE_IM && g_list_length(gtkconv->convs) < 2) 49 if (convtype == PURPLE_CONV_TYPE_IM && g_list_length(gtkconv->convs) < 2)
49 { 50 {
115 purple_account_get_protocol_name(((PurpleLog*)logs->data)->account)); 116 purple_account_get_protocol_name(((PurpleLog*)logs->data)->account));
116 117
117 if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->imhtml)))) 118 if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->imhtml))))
118 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<BR>", options); 119 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<BR>", options);
119 120
120 header = g_strdup_printf(_("<b>Conversation with %s on %s:</b><br>"), alias, 121 escaped_alias = g_markup_escape_text(alias, -1);
122 header = g_strdup_printf(_("<b>Conversation with %s on %s:</b><br>"), escaped_alias,
121 purple_date_format_full(localtime(&((PurpleLog *)logs->data)->time))); 123 purple_date_format_full(localtime(&((PurpleLog *)logs->data)->time)));
122 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), header, options); 124 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), header, options);
123 g_free(header); 125 g_free(header);
126 g_free(escaped_alias);
124 127
125 g_strchomp(history); 128 g_strchomp(history);
126 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), history, options); 129 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), history, options);
127 g_free(history); 130 g_free(history);
128 131

mercurial