diff src/gtkconv.c @ 8962:4ff4c34b7500

[gaim-migrate @ 9736] IM Image, WYSIWYG. It's still somewhat buggy, although the worse problems are with oscar's direct connect. We could always yank oscar's im image flag if we think it will cause too many bug reports. I made the GaimImgstore struct opque. I modified oscar's sending function to parse im images better, and everything seems to work. I made it write some errors to the conversation if you try to send an image and you aren't direct connected. That's just a hack until you can set formatting flags on a per conversation bases. There's a scrolling bug I haven't tracked down. I think it may exist normally and this just causes it better. It's worth noting jabber also uses this for pics in profiles, although I never did find a test case. Hopefully some other stuff can use this soon too, maybe Yahoo! pics in profiles or something. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Mon, 17 May 2004 06:47:20 +0000
parents 80944edf8d80
children c2ad41f7c82b
line wrap: on
line diff
--- a/src/gtkconv.c	Mon May 17 04:39:14 2004 +0000
+++ b/src/gtkconv.c	Mon May 17 06:47:20 2004 +0000
@@ -334,7 +334,7 @@
 		return;
 
 	buf = gtk_imhtml_get_markup(GTK_IMHTML(gtkconv->entry));
-	clean = gaim_markup_strip_html(buf);
+	clean = gtk_imhtml_get_text(GTK_IMHTML(gtkconv->entry), NULL, NULL);
 
 	gtk_widget_grab_focus(gtkconv->entry);
 
@@ -4532,7 +4532,6 @@
 	GaimConvWindow *win;
 	GaimConnection *gc;
 	int gtk_font_options = 0;
-	GSList *images = NULL;
 	char buf[BUF_LONG];
 	char buf2[BUF_LONG];
 	char mdate[64];
@@ -4556,9 +4555,6 @@
 		gaim_conv_window_show(win);
 	}
 
-	if (flags & GAIM_MESSAGE_IMAGES)
-		gaim_gtk_find_images(message, &images);
-
 	if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->imhtml))))
 		gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<BR>", 0);
 
@@ -4595,8 +4591,7 @@
 			   "<FONT %s><FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B></FONT>",
 			   sml_attrib, mdate, message);
 
-		gtk_imhtml_append_text_with_images(GTK_IMHTML(gtkconv->imhtml),
-										   buf2, 0, images);
+		gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, 0);
 
 		/* Add the message to a conversations scrollback buffer */
 		conv->history = g_string_append(conv->history, buf);
@@ -4613,9 +4608,8 @@
 			   "<FONT %s><FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B></FONT>",
 			   sml_attrib, mdate, message);
 		
-		gtk_imhtml_append_text_with_images(GTK_IMHTML(gtkconv->imhtml),
-						   buf2, 0, images);
-		
+		gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, 0);
+
 		/* Add the message to a conversations scrollback buffer */
 		conv->history = g_string_append(conv->history, buf);
 		conv->history = g_string_append(conv->history, "<BR>\n");
@@ -4624,8 +4618,7 @@
 			   "<B><FONT %s COLOR=\"#777777\">%s</FONT></B>",
 			   sml_attrib, message);
 
-		gtk_imhtml_append_text_with_images(GTK_IMHTML(gtkconv->imhtml),
-										   buf, 0, images);
+		gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf, 0);
 	}
 	else {
 		char *new_message = g_memdup(message, length);
@@ -4706,8 +4699,8 @@
 
 		g_free(str);
 
-		gtk_imhtml_append_text_with_images(GTK_IMHTML(gtkconv->imhtml),
-										   buf2, 0, images);
+		gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml),
+										   buf2, 0);
 
 		if(gc){
 			char *pre = g_strdup_printf("<font %s>", sml_attrib ? sml_attrib : "");
@@ -4727,8 +4720,8 @@
 		else
 			with_font_tag = g_memdup(new_message, length);
 
-		gtk_imhtml_append_text_with_images(GTK_IMHTML(gtkconv->imhtml),
-							 with_font_tag, gtk_font_options, images);
+		gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml),
+							 with_font_tag, gtk_font_options);
 
 		conv->history = g_string_append(conv->history, buf);
 		conv->history = g_string_append(conv->history, new_message);
@@ -4741,18 +4734,6 @@
 
 	if(sml_attrib)
 		g_free(sml_attrib);
-
-	if (images) {
-		GSList *tmp;
-
-		for (tmp = images; tmp; tmp = tmp->next) {
-			GdkPixbuf *pixbuf = tmp->data;
-			if(pixbuf)
-				g_object_unref(pixbuf);
-		}
-
-		g_slist_free(images);
-	}
 }
 
 static void