# HG changeset patch # User Stu Tomlinson # Date 1101584365 0 # Node ID 3016b1b32339170022a6294062dde16c85199313 # Parent 891141c68573ea05591011d731c5d6e19ca48dbb [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 diff -r 891141c68573 -r 3016b1b32339 src/desktopitem.h --- a/src/desktopitem.h Sat Nov 27 17:10:36 2004 +0000 +++ b/src/desktopitem.h Sat Nov 27 19:39:25 2004 +0000 @@ -115,7 +115,7 @@ #define GAIM_DESKTOP_ITEM_DOC_PATH "X-GNOME-DocPath" /* string */ /** - * This function loads 'filename' and turns it into a GnomeDesktopItem. + * This function loads 'filename' and turns it into a GaimDesktopItem. * * @param filename The filename or directory path to load the GaimDesktopItem from * @@ -133,7 +133,7 @@ * @param item A desktop item * * @return The type of the specified 'item'. The returned memory - * remains owned by the GnomeDesktopItem and should not be freed. + * remains owned by the GaimDesktopItem and should not be freed. */ GaimDesktopItemType gaim_desktop_item_get_entry_type (const GaimDesktopItem *item); @@ -149,7 +149,7 @@ const char *attr); /** - * Creates a copy of a GnomeDesktopItem. The new copy has a refcount of 1. + * Creates a copy of a GaimDesktopItem. The new copy has a refcount of 1. * Note: Section stack is NOT copied. * * @param item The item to be copied diff -r 891141c68573 -r 3016b1b32339 src/gtkconv.c --- 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 diff -r 891141c68573 -r 3016b1b32339 src/protocols/msn/msg.c --- a/src/protocols/msn/msg.c Sat Nov 27 17:10:36 2004 +0000 +++ b/src/protocols/msn/msg.c Sat Nov 27 19:39:25 2004 +0000 @@ -429,10 +429,10 @@ if (ret_size != NULL) { + *ret_size = n - base; + if (*ret_size > 1664) *ret_size = 1664; - - *ret_size = n - base; } return base; diff -r 891141c68573 -r 3016b1b32339 src/protocols/msn/msn.c --- a/src/protocols/msn/msn.c Sat Nov 27 17:10:36 2004 +0000 +++ b/src/protocols/msn/msn.c Sat Nov 27 19:39:25 2004 +0000 @@ -735,6 +735,15 @@ swboard = msn_session_get_swboard(session, who); msn_import_html(message, &msgformat, &msgtext); + + if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564) + { + g_free(msgformat); + g_free(msgtext); + + return -E2BIG; + } + msg = msn_message_new_plain(msgtext); msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat); @@ -1130,6 +1139,14 @@ { msn_import_html(message, &msgformat, &msgtext); + if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564) + { + g_free(msgformat); + g_free(msgtext); + + return -E2BIG; + } + msg = msn_message_new_plain(msgtext); msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat); msn_switchboard_send_msg(swboard, msg); diff -r 891141c68573 -r 3016b1b32339 src/protocols/msn/utils.c --- a/src/protocols/msn/utils.c Sat Nov 27 17:10:36 2004 +0000 +++ b/src/protocols/msn/utils.c Sat Nov 27 19:39:25 2004 +0000 @@ -209,10 +209,15 @@ strcat(fonteffect, "U"); c += 3; } + else if (!g_ascii_strncasecmp(c + 1, "s>", 2)) + { + strcat(fonteffect, "S"); + c += 3; + } else if (!g_ascii_strncasecmp(c + 1, "a href=\"", 8)) { c += 9; - + if (!g_ascii_strncasecmp(c, "mailto:", 7)) c += 7;