# HG changeset patch # User Sean Egan # Date 1132160362 0 # Node ID 2cbb5993c819eccf5c13c469a4df97f08cbf1e50 # Parent 46fcc076518790b0712cb0517f284f1d3b2c82fb [gaim-migrate @ 14414] Killed stylize(). No more gtk in server.c. Next stop: No more server.c. It looks like also the auto-response code was leaking, so that's fixed now. committer: Tailor Script diff -r 46fcc0765187 -r 2cbb5993c819 src/gtkutils.c --- a/src/gtkutils.c Wed Nov 16 08:49:46 2005 +0000 +++ b/src/gtkutils.c Wed Nov 16 16:59:22 2005 +0000 @@ -827,76 +827,6 @@ return FALSE; } -/* - * TODO: Do we even need this? - */ -char *stylize(const gchar *text, int length) -{ - char *tmp; - gchar *buf; - const char *font; - GdkColor fg_color, bg_color; - - tmp = g_malloc(length); - buf = g_malloc(length); - g_snprintf(buf, length, "%s", text); - - if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_bold")) - { - g_snprintf(tmp, length, "%s", buf); - strcpy(buf, tmp); - } - - if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_italic")) - { - g_snprintf(tmp, length, "%s", buf); - strcpy(buf, tmp); - } - - if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_underline")) - { - g_snprintf(tmp, length, "%s", buf); - strcpy(buf, tmp); - } - - font = gaim_prefs_get_string("/gaim/gtk/conversations/font_face"); - - if (strcmp(font, "") != 0) - { - g_snprintf(tmp, length, "%s", font, buf); - strcpy(buf, tmp); - } - - g_snprintf(tmp, length, "%s", - gaim_prefs_get_int("/gaim/gtk/conversations/font_size"), buf); - strcpy(buf, tmp); - - if (strcmp(gaim_prefs_get_string("/gaim/gtk/conversations/fgcolor"), "") != 0) - { - gdk_color_parse(gaim_prefs_get_string("/gaim/gtk/conversations/fgcolor"), - &fg_color); - - g_snprintf(tmp, length, "%s", - fg_color.red/256, fg_color.green/256, - fg_color.blue/256, buf); - strcpy(buf, tmp); - } - - if (strcmp(gaim_prefs_get_string("/gaim/gtk/conversations/bgcolor"), "") != 0) - { - gdk_color_parse(gaim_prefs_get_string("/gaim/gtk/conversations/bgcolor"), - &bg_color); - - g_snprintf(tmp, length, "%s", - bg_color.red/256, bg_color.green/256, - bg_color.blue/256, buf); - strcpy(buf, tmp); - } - - g_free(tmp); - return buf; -} - void gaim_gtk_setup_gtkspell(GtkTextView *textview) { diff -r 46fcc0765187 -r 2cbb5993c819 src/gtkutils.h --- a/src/gtkutils.h Wed Nov 16 08:49:46 2005 +0000 +++ b/src/gtkutils.h Wed Nov 16 16:59:22 2005 +0000 @@ -269,18 +269,6 @@ void gaim_gtk_setup_gtkspell(GtkTextView *textview); /** - * Stylizes the specified text using HTML, according to the current - * font options. - * - * @param text The text to stylize. - * @param len The intended length of the new buffer. - * - * @return A newly allocated string of length @a len, containing the - * stylized version of @a text. - */ -char *stylize(const gchar *text, int len); - -/** * Save menu accelerators callback */ void gaim_gtk_save_accels_cb(GtkAccelGroup *accel_group, guint arg1, diff -r 46fcc0765187 -r 2cbb5993c819 src/server.c --- a/src/server.c Wed Nov 16 08:49:46 2005 +0000 +++ b/src/server.c Wed Nov 16 16:59:22 2005 +0000 @@ -34,10 +34,6 @@ #include "status.h" #include "util.h" -/* XXX UI Stuff */ -#include "gaim.h" -#include "gtkutils.h" - #define SECS_BEFORE_RESENDING_AUTORESPONSE 600 #define SEX_BEFORE_RESENDING_AUTORESPONSE "Only after you're married" @@ -552,7 +548,6 @@ if (!gaim_presence_is_available(presence)) { time_t t = time(NULL); - char *tmpmsg; GaimBuddy *b = gaim_find_buddy(gc->account, name); const char *alias = b ? gaim_buddy_get_alias(b) : name; struct last_auto_response *lar; @@ -684,14 +679,9 @@ if ((away_msg == NULL) || (*away_msg == '\0')) return; - /* apply default fonts and colors */ - /* TODO: Do we even need this? */ - tmpmsg = stylize(away_msg, MSG_LEN); - /* Move this to oscar.c! */ - buffy = gaim_str_sub_away_formatters(tmpmsg, alias); + buffy = gaim_str_sub_away_formatters(away_msg, alias); serv_send_im(gc, name, buffy, GAIM_CONV_IM_AUTO_RESP); - g_free(buffy); #if 0 if (!cnv && awayqueue && @@ -701,7 +691,7 @@ qm = g_new0(struct queued_message, 1); g_snprintf(qm->name, sizeof(qm->name), "%s", name); - qm->message = g_strdup(gaim_str_sub_away_formatters(tmpmsg, alias)); + qm->message = g_strdup(buffy); qm->account = gc->account; qm->tm = mtime; qm->flags = GAIM_MESSAGE_SEND | GAIM_MESSAGE_AUTO_RESP; @@ -710,13 +700,12 @@ else if (cnv != NULL) #endif { - gaim_conv_im_write(GAIM_CONV_IM(cnv), NULL, - gaim_str_sub_away_formatters(tmpmsg, alias), + gaim_conv_im_write(GAIM_CONV_IM(cnv), NULL, buffy, GAIM_MESSAGE_SEND | GAIM_MESSAGE_AUTO_RESP, mtime); } - g_free(tmpmsg); + g_free(buffy); } else {