changeset 481:64afc8f41bcb

[gaim-migrate @ 491] smileys don't cause dropping of font attributes. gtkhtml handles multiple text much better. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 10 Jul 2000 02:53:14 +0000
parents 320c2f9c0315
children cf6b2efaac35
files src/gtkhtml.c src/oscar.c
diffstat 2 files changed, 25 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkhtml.c	Mon Jul 10 01:22:57 2000 +0000
+++ b/src/gtkhtml.c	Mon Jul 10 02:53:14 2000 +0000
@@ -3098,20 +3098,34 @@
 	 *url = NULL;
 	gint intag = 0,
 	  wpos = 0,
-	  tpos = 0,
-	  colorv,
+	  tpos = 0;
+	static gint colorv,
 	  bold = 0,
 	  italic = 0,
 	  fixed = 0,
 	  uline = 0,
 	  strike = 0,
-	  title = 0;
-	gint height;
-	struct font_state *current,
+	  title = 0,
+	  height;
+	static struct font_state *current = NULL,
 	 *tmp;
-	struct font_state def_state = { 3, 0, 0, "", NULL, NULL, NULL };
-
-	current = &def_state;
+	static struct font_state def_state = { 3, 0, 0, "", NULL, NULL, NULL };
+
+	if (text == NULL) {
+		while (current->next)
+		{
+			if (current->ownbg)
+				g_free(current->bgcol);
+			if (current->owncolor)
+				g_free(current->color);
+			tmp = current;
+			current = current->next;
+			g_free(tmp);
+		}
+		return;
+	}
+
+	if (!current) current = &def_state;
 	map = gdk_window_get_colormap(html->html_area);
 	cfont = getfont(current->font, bold, italic, fixed, current->size);
 	c = text;
@@ -3477,16 +3491,6 @@
 		}
 		c++;
 	}
-	while (current->next)
-	{
-		if (current->ownbg)
-			g_free(current->bgcol);
-		if (current->owncolor)
-			g_free(current->color);
-		tmp = current;
-		current = current->next;
-		g_free(tmp);
-	}
 	ws[wpos] = 0;
 	tag[tpos] = 0;
 	if (wpos)
@@ -4188,6 +4192,8 @@
 	g_return_if_fail(html != NULL);
 	g_return_if_fail(GTK_IS_HTML(html));
 
+	gtk_html_append_text(html, NULL, 0);
+
 	html->frozen--;
 
 	if (html->frozen < 0)
--- a/src/oscar.c	Mon Jul 10 01:22:57 2000 +0000
+++ b/src/oscar.c	Mon Jul 10 02:53:14 2000 +0000
@@ -114,7 +114,7 @@
 int oscar_login(char *username, char *password) {
 	struct aim_session_t *sess;
 	struct aim_conn_t *conn;
-	struct client_info_s info = {"AOL Instant Messenger (TM), version 2.1.1187/WIN32", 4, 31, 3141, "us", "en", 0x0004, 0x0001, 0x055};
+	struct client_info_s info = {"AOL Instant Messenger (TM), version 2.1.1187/WIN32", 4, 30, 3141, "us", "en", 0x0004, 0x0001, 0x055};
 	struct aim_user *u;
 	char buf[256];