pidgin: 9d89ef3f: Support for background font colors in in...
markdoliner at pidgin.im
markdoliner at pidgin.im
Tue Dec 16 23:40:47 EST 2008
-----------------------------------------------------------------
Revision: 9d89ef3f6424de7f80ef94926c05ce144cd28b30
Ancestor: 8c651f4fb2d841aa383eba3de1899a598a9bce52
Author: markdoliner at pidgin.im
Date: 2008-12-17T04:37:21
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/9d89ef3f6424de7f80ef94926c05ce144cd28b30
Modified files:
ChangeLog libpurple/protocols/myspace/markup.c
ChangeLog:
Support for background font colors in incoming MySpace IMs
-------------- next part --------------
============================================================
--- ChangeLog 1f6223e2bc6589d83c3ec3a7ff6efa3614966080
+++ ChangeLog 70a4d9a634e350c1e8e5e65b781846f8c9fe99c9
@@ -57,6 +57,7 @@ version 2.5.3 (12/??/2008):
* Fix a bug where buddies didn't appear in their correct groups the
first time you sign into your account (Mark Doliner)
* Support for foreground and background font colors in outgoing IMs
+ * Support for background font colors in incoming IMs
SIMPLE:
* Fix a crash when a malformed message is received.
============================================================
--- libpurple/protocols/myspace/markup.c c3298d95358fc41f9d3cc9c05d075781a6ae5000
+++ libpurple/protocols/myspace/markup.c 46dfc720f3db35e8fffe49a217b9519a3b25e2a2
@@ -294,7 +294,9 @@ msim_markup_p_to_html(MsimSession *sessi
*end = g_strdup("</p>");
}
-/** Convert the msim markup <c> tag (text color) into HTML. TODO: Test */
+/**
+ * Convert the msim markup <c> tag (text color) into HTML.
+ */
static void
msim_markup_c_to_html(MsimSession *session, xmlnode *root, gchar **begin, gchar **end)
{
@@ -312,15 +314,20 @@ msim_markup_c_to_html(MsimSession *sessi
purple_color = msim_color_to_purple(color);
+#ifdef USE_CSS_FORMATTING
+ *begin = g_strdup_printf("<span style='color: %s'>", purple_color);
+ *end = g_strdup("</span>");
+#else
*begin = g_strdup_printf("<font color='%s'>", purple_color);
+ *end = g_strdup("</font>");
+#endif
g_free(purple_color);
-
- /* *begin = g_strdup_printf("<span style='color: %s'>", color); */
- *end = g_strdup("</font>");
}
-/** Convert the msim markup <b> tag (background color) into HTML. TODO: Test */
+/**
+ * Convert the msim markup <b> tag (background color) into HTML.
+ */
static void
msim_markup_b_to_html(MsimSession *session, xmlnode *root, gchar **begin, gchar **end)
{
@@ -338,12 +345,15 @@ msim_markup_b_to_html(MsimSession *sessi
purple_color = msim_color_to_purple(color);
- /* TODO: find out how to set background color. */
- *begin = g_strdup_printf("<span style='background-color: %s'>",
- purple_color);
- g_free(purple_color);
+#ifdef USE_CSS_FORMATTING
+ *begin = g_strdup_printf("<span style='background-color: %s'>", purple_color);
+ *end = g_strdup("</span>");
+#else
+ *begin = g_strdup_printf("<body bgcolor='%s'>", purple_color);
+ *end = g_strdup("</body>");
+#endif
- *end = g_strdup("</p>");
+ g_free(purple_color);
}
/** Convert the msim markup <i> tag (emoticon image) into HTML. */
@@ -696,7 +706,8 @@ msim_convert_smileys_to_markup(gchar *be
return new;
}
-/** High-level function to convert MySpaceIM markup to Purple (HTML) markup.
+/**
+ * High-level function to convert MySpaceIM markup to Purple (HTML) markup.
*
* @return Purple markup string, must be g_free()'d. */
gchar *
@@ -705,7 +716,8 @@ msim_markup_to_html(MsimSession *session
return msim_convert_xml(session, raw, msim_markup_tag_to_html);
}
-/** High-level function to convert Purple (HTML) to MySpaceIM markup.
+/**
+ * High-level function to convert Purple (HTML) to MySpaceIM markup.
*
* TODO: consider using purple_markup_html_to_xhtml() to make valid XML.
*
More information about the Commits
mailing list