changeset 7736:662a33ce4343

[gaim-migrate @ 8381] This does protocol-specific smileys when wysiwyging. It will also reflect changes in smiley theme. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Thu, 04 Dec 2003 05:23:19 +0000
parents edebf99a5ec4
children c497b3bb7581
files src/dialogs.c src/gtkimhtml.c src/gtkimhtml.h src/themes.c
diffstat 4 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/dialogs.c	Thu Dec 04 05:06:59 2003 +0000
+++ b/src/dialogs.c	Thu Dec 04 05:23:19 2003 +0000
@@ -1572,12 +1572,12 @@
 {
 	GaimGtkConversation *gtkconv;
 	char *smiley_text = g_object_get_data(G_OBJECT(widget), "smiley_text");
-	GtkTextMark *select_mark, *insert_mark;
-	GtkTextIter select_iter, insert_iter;
-
+	GaimProtocol protocol = gaim_account_get_protocol(gaim_conversation_get_account(c));
+	GaimPlugin *proto = gaim_find_prpl(protocol);
+	
 	gtkconv = GAIM_GTK_CONVERSATION(c);
 	
-	gtk_imhtml_insert_smiley(GTK_IMHTML(gtkconv->entry), smiley_text);
+	gtk_imhtml_insert_smiley(GTK_IMHTML(gtkconv->entry), proto->info->name, smiley_text);
 	
 	close_smiley_dialog(NULL, c);
 }
--- a/src/gtkimhtml.c	Thu Dec 04 05:06:59 2003 +0000
+++ b/src/gtkimhtml.c	Thu Dec 04 05:23:19 2003 +0000
@@ -2194,7 +2194,7 @@
 	imhtml->format_spans = g_list_append(imhtml->format_spans, span);
 }
 
-void gtk_imhtml_insert_smiley(GtkIMHtml *imhtml, const char *smiley)
+void gtk_imhtml_insert_smiley(GtkIMHtml *imhtml, const char *sml, char *smiley)
 {
 	GtkTextMark *ins = gtk_text_buffer_get_insert(imhtml->text_buffer);
 	GtkTextIter iter;
@@ -2205,7 +2205,7 @@
 
 	GtkTextChildAnchor *anchor = gtk_text_buffer_create_child_anchor(imhtml->text_buffer, &iter);
 	g_object_set_data(G_OBJECT(anchor), "text_tag", smiley);
-	annipixbuf = gtk_smiley_tree_image(imhtml, NULL, smiley);
+	annipixbuf = gtk_smiley_tree_image(imhtml, sml, smiley);
 	if(annipixbuf) {
 		if(gdk_pixbuf_animation_is_static_image(annipixbuf)) {
 			pixbuf = gdk_pixbuf_animation_get_static_image(annipixbuf);
--- a/src/gtkimhtml.h	Thu Dec 04 05:06:59 2003 +0000
+++ b/src/gtkimhtml.h	Thu Dec 04 05:23:19 2003 +0000
@@ -214,7 +214,7 @@
 gboolean gtk_imhtml_toggle_backcolor(GtkIMHtml *imhtml, const char *color);
 gboolean gtk_imhtml_toggle_fontface(GtkIMHtml *imhtml, const char *face);
 void gtk_imhtml_insert_link(GtkIMHtml *imhtml, const char *url, const char *text);
-
+void gtk_imhtml_insert_smiley(GtkIMHtml *imhtml, const char *sml, char *smiley);
 char *gtk_imhtml_get_markup(GtkIMHtml *imhtml);
 char *gtk_imhtml_get_text(GtkIMHtml *imhtml);
 
--- a/src/themes.c	Thu Dec 04 05:06:59 2003 +0000
+++ b/src/themes.c	Thu Dec 04 05:23:19 2003 +0000
@@ -193,8 +193,10 @@
 		for (cnv = gaim_get_conversations(); cnv != NULL; cnv = cnv->next) {
 			GaimConversation *conv = cnv->data;
 
-			if (GAIM_IS_GTK_CONVERSATION(conv))
+			if (GAIM_IS_GTK_CONVERSATION(conv)) {
 				smiley_themeize(GAIM_GTK_CONVERSATION(conv)->imhtml);
+				smiley_themeize(GAIM_GTK_CONVERSATION(conv)->entry);
+			}
 		}
 	}