diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2022-09-07 19:42:18 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2022-09-08 01:28:51 +0200 |
commit | 4ba28c6ed3b952a06aba8ae96220c429d4d02365 (patch) | |
tree | 30b9ef26d0652451e0c28aa65343950594239c15 /xC.c | |
parent | 45aa0e8dfba2a51d26b6a4fe4990a1686ab4af65 (diff) | |
download | xK-4ba28c6ed3b952a06aba8ae96220c429d4d02365.tar.gz xK-4ba28c6ed3b952a06aba8ae96220c429d4d02365.tar.xz xK-4ba28c6ed3b952a06aba8ae96220c429d4d02365.zip |
xC/xP: mark highlights and buffer activity
And more or less finalize out the protocol for this use case.
Diffstat (limited to 'xC.c')
-rw-r--r-- | xC.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -3068,6 +3068,11 @@ relay_prepare_buffer_update (struct app_context *ctx, struct buffer *buffer) struct relay_event_data_buffer_update *e = &m->data.buffer_update; e->event = RELAY_EVENT_BUFFER_UPDATE; e->buffer_name = str_from_cstr (buffer->name); + e->new_messages = MIN (UINT32_MAX, + buffer->new_messages_count - buffer->new_unimportant_count); + e->new_unimportant_messages = MIN (UINT32_MAX, + buffer->new_unimportant_count); + e->highlighted = buffer->highlighted; } static void @@ -5015,8 +5020,16 @@ buffer_merge (struct app_context *ctx, buffer->lines_count += n; // And since there is no log_*() call, send them to relays manually + buffer->highlighted |= merged->highlighted; LIST_FOR_EACH (struct buffer_line, line, start) { + if (buffer->new_messages_count) + { + buffer->new_messages_count++; + if (line->flags & BUFFER_LINE_UNIMPORTANT) + buffer->new_unimportant_count++; + } + relay_prepare_buffer_line (ctx, buffer, line, false); relay_broadcast (ctx); } |