aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-06-21 04:00:20 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-06-21 04:00:20 +0200
commit85cebbcfa236005daf91698ed38498fc2b206e7e (patch)
tree82698c8d0caa77e2460afa990353ffd206cf0b01
parent1eb38fa5ec424d7f8898951eda751ef188540725 (diff)
downloadxK-85cebbcfa236005daf91698ed38498fc2b206e7e.tar.gz
xK-85cebbcfa236005daf91698ed38498fc2b206e7e.tar.xz
xK-85cebbcfa236005daf91698ed38498fc2b206e7e.zip
degesch: make highlights more obvious
Just the tiniest bit.
-rw-r--r--degesch.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/degesch.c b/degesch.c
index ccd5d00..4259d73 100644
--- a/degesch.c
+++ b/degesch.c
@@ -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;