changeset 2998:6fe330f1b951

[gaim-migrate @ 3011] selected smilies will look selected now. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sun, 03 Mar 2002 20:19:30 +0000
parents 0dba6ea7d632
children 82b1553d53d0
files src/gtkimhtml.c src/list.c src/protocols/oscar/aim.h src/protocols/oscar/oscar.c
diffstat 4 files changed, 53 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkimhtml.c	Sun Mar 03 05:44:32 2002 +0000
+++ b/src/gtkimhtml.c	Sun Mar 03 20:19:30 2002 +0000
@@ -39,6 +39,8 @@
 #if USE_PIXBUF
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <gdk-pixbuf/gdk-pixbuf-loader.h>
+#else
+#include "pixmaps/broken.xpm"
 #endif
 
 #if GTK_CHECK_VERSION(1,3,0)
@@ -64,7 +66,6 @@
 #include "pixmaps/tongue.xpm"
 #include "pixmaps/wink.xpm"
 #include "pixmaps/yell.xpm"
-#include "pixmaps/broken.xpm"
 
 #define MAX_FONT_SIZE 7
 
@@ -511,8 +512,7 @@
 
 	if (line->selected) {
 		gint width, x;
-		GdkColor col;
-
+		
 		if ((line->sel_start > line->sel_end) && (line->sel_end != NULL)) {
 			start = line->sel_end;
 			end = line->sel_start;
@@ -637,8 +637,11 @@
 	yoff = GTK_LAYOUT (imhtml)->vadjustment->value;
 	gc = gdk_gc_new (window);
 	cmap = gtk_widget_get_colormap (GTK_WIDGET (imhtml));
-
-	if (bit->bg != NULL) {
+	
+	if (line->selected) {
+		gdk_color_alloc (cmap, imhtml->default_hl_color);
+		gdk_gc_set_foreground(gc, imhtml->default_hl_color);
+	} else if (bit->bg != NULL) {
 		gdk_color_alloc (cmap, bit->bg);
 		gdk_gc_set_foreground (gc, bit->bg);
 	} else {
@@ -685,16 +688,28 @@
 	cmap = gtk_widget_get_colormap (GTK_WIDGET (imhtml));
 	gc = gdk_gc_new (drawable);
 
-	if (bit->bg != NULL) {
+	if (line->selected) {
+		gdk_color_alloc (cmap, imhtml->default_hl_color);
+		gdk_gc_set_foreground (gc, imhtml->default_hl_color);
+	} else if (bit->bg != NULL) {
 		gdk_color_alloc (cmap, bit->bg);
 		gdk_gc_set_foreground (gc, bit->bg);
-
-		gdk_draw_rectangle (drawable, gc, TRUE, line->x - xoff, line->y - yoff,
-				    line->width, line->height);
+	} else {
+		gdk_color_alloc (cmap, imhtml->default_bg_color);
+		gdk_gc_set_foreground (gc, imhtml->default_bg_color);
 	}
 
-	gdk_color_alloc (cmap, imhtml->default_fg_color);
-	gdk_gc_set_foreground (gc, imhtml->default_fg_color);
+	gdk_draw_rectangle (drawable, gc, TRUE, line->x - xoff, line->y - yoff,
+			    line->width, line->height);
+	
+	
+	if (line->selected) {
+		gdk_color_alloc (cmap, imhtml->default_hlfg_color);
+		gdk_gc_set_foreground (gc, imhtml->default_hlfg_color);
+	} else {
+		gdk_color_alloc (cmap, imhtml->default_fg_color);
+		gdk_gc_set_foreground (gc, imhtml->default_fg_color);
+	}
 
 	line_height = line->height / 2;
 
--- a/src/list.c	Sun Mar 03 05:44:32 2002 +0000
+++ b/src/list.c	Sun Mar 03 20:19:30 2002 +0000
@@ -349,13 +349,13 @@
 	int how_many = 0;
 
 	bud = NULL;
-
+    
 	if (config != NULL) {
-
+    
 		/* skip "CONFIG:" (if it exists) */
 		c = strncmp(config + 6 /* sizeof(struct sflap_hdr) */ , "CONFIG:", strlen("CONFIG:")) ?
-		    strtok(config, "\n") :
-		    strtok(config + 6 /* sizeof(struct sflap_hdr) */  + strlen("CONFIG:"), "\n");
+			strtok(config, "\n") :
+			strtok(config + 6 /* sizeof(struct sflap_hdr) */  + strlen("CONFIG:"), "\n");
 		do {
 			if (c == NULL)
 				break;
@@ -368,13 +368,18 @@
 			} else if (*c == 'b' && !find_buddy(gc, c + 2)) {
 				char nm[80], sw[388], *tmp = c + 2;
 				int i = 0;
+				while (*tmp != ':' && *tmp && i < sizeof(nm) - 1)
+					nm[i++] = *tmp++;
+				
 				while (*tmp != ':' && *tmp)
-					nm[i++] = *tmp++;
+					*tmp++;
+				
 				if (*tmp == ':')
 					*tmp++ = '\0';
+				
 				nm[i] = '\0';
 				i = 0;
-				while (*tmp)
+				while (*tmp && i < sizeof(sw) - 1)
 					sw[i++] = *tmp++;
 				sw[i] = '\0';
 				if (!find_buddy(gc, nm)) {
@@ -390,7 +395,7 @@
 				n = g_strdup(normalize (name));
 				while (d) {
 					if (!g_strcasecmp(n, normalize (d->data)))
-						 break;
+						break;
 					d = d->next;
 				}
 				g_free(n);
@@ -407,15 +412,15 @@
 				n = g_strdup(normalize (name));
 				while (d) {
 					if (!g_strcasecmp(n, normalize (d->data)))
-						 break;
-					d = d->next;
-				}
-				g_free(n);
-				if (!d) {
-					gc->deny = g_slist_append(gc->deny, name);
-					how_many++;
-				} else
-					g_free(name);
+					break;
+				d = d->next;
+			}
+			g_free(n);
+			if (!d) {
+				gc->deny = g_slist_append(gc->deny, name);
+				how_many++;
+			} else
+				g_free(name);
 			} else if (!strncmp("toc", c, 3)) {
 				sscanf(c + strlen(c) - 1, "%d", &gc->permdeny);
 				debug_printf("permdeny: %d\n", gc->permdeny);
@@ -428,16 +433,17 @@
 					gc->permdeny = 1;
 			}
 		} while ((c = strtok(NULL, "\n")));
-
+		
 		if (bud != NULL) {
 			serv_add_buddies(gc, bud);
 			g_list_free(bud);
 		}
 		serv_set_permit_deny(gc);
 	}
-
+	
 	if (how_many != 0)
 		do_export(gc);
+	
 }
 
 void toc_build_config(struct gaim_connection *gc, char *s, int len, gboolean show)
--- a/src/protocols/oscar/aim.h	Sun Mar 03 05:44:32 2002 +0000
+++ b/src/protocols/oscar/aim.h	Sun Mar 03 20:19:30 2002 +0000
@@ -1035,6 +1035,7 @@
 faim_export int aim_ssi_adddenies(aim_session_t *sess, aim_conn_t *conn, char **sn, unsigned int num);
 faim_export int aim_ssi_delbuddies(aim_session_t *sess, aim_conn_t *conn, char *gn, char **sn, unsigned int num);
 faim_export int aim_ssi_delgroups(aim_session_t *sess, aim_conn_t *conn, char **gn, unsigned int num);
+faim_export int aim_ssi_deletelist(aim_session_t *sess, aim_conn_t *conn);
 faim_export int aim_ssi_delpermits(aim_session_t *sess, aim_conn_t *conn, char **sn, unsigned int num);
 faim_export int aim_ssi_deldenies(aim_session_t *sess, aim_conn_t *conn, char **sn, unsigned int num);
 faim_export int aim_ssi_setpermdeny(aim_session_t *sess, aim_conn_t *conn, int permdeny);
--- a/src/protocols/oscar/oscar.c	Sun Mar 03 05:44:32 2002 +0000
+++ b/src/protocols/oscar/oscar.c	Sun Mar 03 20:19:30 2002 +0000
@@ -2416,7 +2416,7 @@
 	struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
 	struct direct_im *dim = find_direct_im(odata, name);
 	if (!dim)
-		return;
+		return 0;
 	aim_send_typing(odata->sess, dim->conn, TRUE);
 	return 0;
 }
@@ -2606,7 +2606,7 @@
 		aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_INVISIBLE);
 		gc->away = "";
 	} else if (!strcmp(state, GAIM_AWAY_CUSTOM)) {
-		if (message) {
+	 	if (message) {
 			aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_OUT);
 			gc->away = "";
 		} else {
@@ -2759,7 +2759,6 @@
 	struct gaim_connection *gc = sess->aux_data;
 	struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
 	struct aim_ssi_item *curitem;
-	struct group *g;
 	GSList *mem;
 	int tmp;
 	char **sns;