diff src/gtkconv.c @ 10274:3016b1b32339

[gaim-migrate @ 11424] Don't allow sending oversized messages on MSN - they wouldn't get there, and the switchboard server would disconnect us. Also fix up the oversized message truncation which should have been truncating the messages anyway. Add support for sending strikethrough on MSN (not that anyone can actually enter strikethrough tags yet) And a slight change to the building of chat user status icons. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 27 Nov 2004 19:39:25 +0000
parents a66cf83552dc
children ec140184437b
line wrap: on
line diff
--- a/src/gtkconv.c	Sat Nov 27 17:10:36 2004 +0000
+++ b/src/gtkconv.c	Sat Nov 27 19:39:25 2004 +0000
@@ -3307,41 +3307,43 @@
 {
 	GdkPixbuf *pixbuf, *scale, *scale2;
 	char *filename;
-	char *image = NULL;
+	const char *image = NULL;
 
 	if (flags & GAIM_CBFLAGS_FOUNDER) {
-		image = g_strdup("founder.png");
+		image = "founder.png";
 	} else if (flags & GAIM_CBFLAGS_OP) {
-		image = g_strdup("op.png");
+		image = "op.png";
 	} else if (flags & GAIM_CBFLAGS_HALFOP) {
-		image = g_strdup("halfop.png");
+		image = "halfop.png";
 	} else if (flags & GAIM_CBFLAGS_VOICE) {
-		image = g_strdup("voice.png");
+		image = "voice.png";
 	} else if ((!flags) && gaim_conv_chat_is_user_ignored(chat, name)) {
-		image = g_strdup("ignored.png");
+		image = "ignored.png";
+	} else {
+		return NULL;
 	}
-	if (image) {
-		filename = g_build_filename(DATADIR, "pixmaps", "gaim", "status", "default", image, NULL);
-		g_free(image);
+
+	filename = g_build_filename(DATADIR, "pixmaps", "gaim", "status", "default", image, NULL);
+	pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
+	g_free(filename);
+
+	if (!pixbuf)
+		return NULL;
+
+	scale = gdk_pixbuf_scale_simple(pixbuf, 15, 15, GDK_INTERP_BILINEAR);
+	g_object_unref(pixbuf);
+
+	if (flags && gaim_conv_chat_is_user_ignored(chat, name)) {
+		filename = g_build_filename(DATADIR, "pixmaps", "gaim", "status", "default", "ignored.png", NULL);
 		pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
 		g_free(filename);
-		if (!pixbuf)
-			return NULL;
-		scale = gdk_pixbuf_scale_simple(pixbuf, 15, 15, GDK_INTERP_BILINEAR);
+		scale2 = gdk_pixbuf_scale_simple(pixbuf, 15, 15, GDK_INTERP_BILINEAR);
 		g_object_unref(pixbuf);
-		if (flags && gaim_conv_chat_is_user_ignored(chat, name)) {
-			filename = g_build_filename(DATADIR, "pixmaps", "gaim", "status", "default", "ignored.png", NULL);
-			pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
-			g_free(filename);
-			scale2 = gdk_pixbuf_scale_simple(pixbuf, 15, 15, GDK_INTERP_BILINEAR);
-			g_object_unref(pixbuf);
-			gdk_pixbuf_composite(scale2, scale, 0, 0, 15, 15, 0, 0, 1, 1, GDK_INTERP_BILINEAR, 192);
-			g_object_unref(scale2);
-		}
-		return scale;
+		gdk_pixbuf_composite(scale2, scale, 0, 0, 15, 15, 0, 0, 1, 1, GDK_INTERP_BILINEAR, 192);
+		g_object_unref(scale2);
 	}
 
-	return NULL;
+	return scale;
 }
 
 static void