diff --git a/docs/formats.txt b/docs/formats.txt index 6b6cf354..6dabc43c 100644 --- a/docs/formats.txt +++ b/docs/formats.txt @@ -13,6 +13,7 @@ %c %C %6 cyan bold cyan cyan %w %W %7 white bold white white %n %N Turn off all colors and other formatting + %F Blinking on/off (think: flash) %U Underline on/off %8 Reverse on/off %9 %_ Bold on/off diff --git a/src/core/channels.c b/src/core/channels.c index 1878dc02..e3728eb5 100644 --- a/src/core/channels.c +++ b/src/core/channels.c @@ -62,6 +62,7 @@ void channel_destroy(CHANNEL_REC *channel) signal_emit("channel destroyed", 1, channel); MODULE_DATA_DEINIT(channel); + g_free_not_null(channel->hilight_color); g_free_not_null(channel->topic); g_free_not_null(channel->topic_by); g_free_not_null(channel->key); diff --git a/src/core/queries.c b/src/core/queries.c index 1888bfdc..d1c51352 100644 --- a/src/core/queries.c +++ b/src/core/queries.c @@ -62,6 +62,7 @@ void query_destroy(QUERY_REC *query) signal_emit("query destroyed", 1, query); MODULE_DATA_DEINIT(query); + g_free_not_null(query->hilight_color); g_free_not_null(query->server_tag); g_free_not_null(query->address); g_free(query->name); diff --git a/src/fe-common/core/formats.c b/src/fe-common/core/formats.c index eb554973..a8a2ac7f 100644 --- a/src/fe-common/core/formats.c +++ b/src/fe-common/core/formats.c @@ -93,7 +93,9 @@ int format_expand_styles(GString *out, char format) g_string_append_c(out, FORMAT_STYLE_INDENT); break; case 'F': - /* flashing - ignore */ + /* blink */ + g_string_append_c(out, 4); + g_string_append_c(out, FORMAT_STYLE_BLINK); break; case 'n': case 'N': @@ -845,6 +847,9 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text) /* user specific colors */ flags &= ~PRINTFLAG_MIRC_COLOR; switch (*ptr) { + case FORMAT_STYLE_BLINK: + flags ^= PRINTFLAG_BLINK; + break; case FORMAT_STYLE_UNDERLINE: flags ^= PRINTFLAG_UNDERLINE; break; diff --git a/src/fe-common/core/formats.h b/src/fe-common/core/formats.h index fde5be01..86c53e69 100644 --- a/src/fe-common/core/formats.h +++ b/src/fe-common/core/formats.h @@ -101,11 +101,12 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text); #define FORMAT_COLOR_NOCHANGE ('0'-1) /* don't change this, at least hilighting depends this value */ #define FORMAT_STYLE_SPECIAL 0x60 -#define FORMAT_STYLE_UNDERLINE (0x01 + FORMAT_STYLE_SPECIAL) -#define FORMAT_STYLE_BOLD (0x02 + FORMAT_STYLE_SPECIAL) -#define FORMAT_STYLE_REVERSE (0x03 + FORMAT_STYLE_SPECIAL) -#define FORMAT_STYLE_INDENT (0x04 + FORMAT_STYLE_SPECIAL) -#define FORMAT_STYLE_DEFAULTS (0x05 + FORMAT_STYLE_SPECIAL) +#define FORMAT_STYLE_BLINK (0x01 + FORMAT_STYLE_SPECIAL) +#define FORMAT_STYLE_UNDERLINE (0x02 + FORMAT_STYLE_SPECIAL) +#define FORMAT_STYLE_BOLD (0x03 + FORMAT_STYLE_SPECIAL) +#define FORMAT_STYLE_REVERSE (0x04 + FORMAT_STYLE_SPECIAL) +#define FORMAT_STYLE_INDENT (0x05 + FORMAT_STYLE_SPECIAL) +#define FORMAT_STYLE_DEFAULTS (0x06 + FORMAT_STYLE_SPECIAL) int format_expand_styles(GString *out, char format); void formats_init(void); diff --git a/src/fe-common/core/themes.c b/src/fe-common/core/themes.c index 997395a3..ee053cd5 100644 --- a/src/fe-common/core/themes.c +++ b/src/fe-common/core/themes.c @@ -186,16 +186,13 @@ static void theme_format_append_next(THEME_REC *theme, GString *str, chr = **format; if (**format == 'n') { /* %n = change to default color */ - if (default_fg == 'n' || default_bg == 'n') { - if (*last_fg != 'n') - g_string_append(str, "%n"); - *last_bg = *last_fg = 'n'; - } - if (default_bg != *last_bg) { + g_string_append(str, "%n"); + + if (default_bg != 'n') { g_string_append_c(str, '%'); g_string_append_c(str, default_bg); } - if (default_fg != *last_fg) { + if (default_fg != 'n') { g_string_append_c(str, '%'); g_string_append_c(str, default_fg); } diff --git a/src/fe-text/gui-printtext.c b/src/fe-text/gui-printtext.c index a79033d5..e7e763b2 100644 --- a/src/fe-text/gui-printtext.c +++ b/src/fe-text/gui-printtext.c @@ -307,7 +307,7 @@ static void get_colors(int flags, int *fg, int *bg) *fg |= 8; } if (flags & PRINTFLAG_UNDERLINE) *fg |= ATTR_UNDERLINE; - if (flags & PRINTFLAG_BLINK) *bg |= 0x80; + if (flags & PRINTFLAG_BLINK) *bg |= 0x08; } static void linebuf_add(GUI_WINDOW_REC *gui, const char *str, int len)