# HG changeset patch # User Jeffrey Connelly # Date 1183353191 0 # Node ID 51f54868bbad7c571b1323067d47f7ec23cdf714 # Parent 11988aee28f2d90a57c869f238bd5ab7edc9eae4 Fix typo to allow font face to be displayed correctly on incoming messages. Disable font size on incoming instant messages, until I get it working. Add OPT_PROTO_POINTSIZE to make it (hopefully) easier, and remove the function to convert from point size to libpurple size, since with this flag it should be possible to specify point size directly. diff -r 11988aee28f2 -r 51f54868bbad libpurple/protocols/myspace/CHANGES --- a/libpurple/protocols/myspace/CHANGES Mon Jul 02 04:51:09 2007 +0000 +++ b/libpurple/protocols/myspace/CHANGES Mon Jul 02 05:13:11 2007 +0000 @@ -1,5 +1,5 @@ 2007-07-xx Jeff Connelly - 0.10 -* Handle incoming text color formatting. +* On incoming instant messages, support: text color, font face. 2007-07-01 Jeff Connelly - 0.9 * Fix crash on Windows when logging in (bug #1990) diff -r 11988aee28f2 -r 51f54868bbad libpurple/protocols/myspace/myspace.c --- a/libpurple/protocols/myspace/myspace.c Mon Jul 02 04:51:09 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.c Mon Jul 02 05:13:11 2007 +0000 @@ -702,30 +702,6 @@ return rc; } -/** Convert a font point size to purple's HTML font size. - * - * Based on libpurple/protocols/bonjour/jabber.c. - */ -static guint -msim_font_size_to_purple(int size) -{ - if (size > 24) { - return 7; - } else if (size >= 21) { - return 6; - } else if (size >= 17) { - return 5; - } else if (size >= 14) { - return 4; - } else if (size >= 12) { - return 3; - } else if (size >= 10) { - return 2; - } - - return 1; -} - /** Convert a msim markup font height to points. */ static guint msim_font_height_to_point(guint height) @@ -756,7 +732,7 @@ GString *gs_end, *gs_begin; guint decor, height; - face = xmlnode_get_attrib(root, "n"); + face = xmlnode_get_attrib(root, "f"); height_str = xmlnode_get_attrib(root, "h"); decor_str = xmlnode_get_attrib(root, "s"); @@ -771,12 +747,23 @@ decor = 0; gs_begin = g_string_new(""); +#ifdef MSIM_FONT_SIZE_WORKS + /* TODO: get font size working */ if (!face) g_string_printf(gs_begin, "", - msim_font_size_to_purple(msim_font_height_to_point(height))); + msim_font_height_to_point(height)); else g_string_printf(gs_begin, "", face, - msim_font_size_to_purple(msim_font_height_to_point(height))); + msim_font_height_to_point(height)); +#else + if (face) + { + g_string_printf(gs_begin, "", face); + } else { + g_string_printf(gs_begin, ""); + } +#endif + /* No support for font-size CSS? */ /* g_string_printf(gs_begin, "", face, @@ -977,8 +964,7 @@ strncpy(inner, node->data, node->data_sz); inner[node->data_sz + 1] = 0; - purple_debug_info("msim", " ** node data=%s (%s)\n", inner, - node->data); + purple_debug_info("msim", " ** node data=%s\n", inner); break; default: @@ -2660,7 +2646,11 @@ /** Callbacks called by Purple, to access this plugin. */ PurplePluginProtocolInfo prpl_info = { - OPT_PROTO_MAIL_CHECK,/* options - TODO: myspace will notify of mail */ + /* options */ + OPT_PROTO_USE_POINTSIZE /* specify font size in sane point size */ + /* | OPT_PROTO_MAIL_CHECK - TODO: myspace will notify of mail */ + /* | OPT_PROTO_IM_IMAGE - TODO: direct images. */ + , NULL, /* user_splits */ NULL, /* protocol_options */ NO_BUDDY_ICONS, /* icon_spec - TODO: eventually should add this */