degesch: make highlights more obvious

Just the tiniest bit.
This commit is contained in:
Přemysl Eric Janouch 2015-06-21 04:00:20 +02:00
parent 1eb38fa5ec
commit 85cebbcfa2
1 changed files with 10 additions and 1 deletions

View File

@ -979,6 +979,7 @@ struct buffer
unsigned lines_count; ///< How many lines we have
unsigned unseen_messages_count; ///< # messages since last visited
bool highlighted; ///< We've been highlighted
// Origin information:
@ -2519,6 +2520,9 @@ buffer_send_internal (struct app_context *ctx, struct buffer *buffer,
LIST_APPEND_WITH_TAIL (buffer->lines, buffer->lines_tail, line);
buffer->lines_count++;
// TODO: beep if so configured and either the line is a highlight,
// or the buffer is an inactive PM buffer
if (buffer == ctx->current_buffer)
{
buffer_line_display (ctx, line, false);
@ -2538,6 +2542,9 @@ buffer_send_internal (struct app_context *ctx, struct buffer *buffer,
else
{
buffer->unseen_messages_count++;
if (flags & BUFFER_LINE_HIGHLIGHT)
buffer->highlighted = true;
refresh_prompt (ctx);
}
}
@ -2620,6 +2627,7 @@ buffer_print_backlog (struct app_context *ctx, struct buffer *buffer)
for (; line; line = line->next)
buffer_line_display (ctx, line, false);
buffer->unseen_messages_count = 0;
buffer->highlighted = false;
refresh_prompt (ctx);
}
@ -3690,6 +3698,8 @@ make_unseen_prefix (struct app_context *ctx)
if (active_buffers.len)
str_append_c (&active_buffers, ',');
if (iter->highlighted)
str_append_c (&active_buffers, '!');
str_append_printf (&active_buffers, "%zu", i);
}
@ -4436,7 +4446,6 @@ irc_handle_notice_text (struct server *s,
if (buffer)
{
// TODO: some more obvious indication of highlights
int flags = irc_is_highlight (s, text->str)
? BUFFER_LINE_HIGHLIGHT
: 0;