From 75c97cfd449b2bac8e61af1017a83bdf43f5e8fe Mon Sep 17 00:00:00 2001 From: Samuel Mendoza-Jonas Date: Wed, 14 Dec 2016 14:44:23 +1100 Subject: discover: Maintain a backlog of status updates Add status updates to a persistent list in the discover_server struct, and send each client the backlog on connect. This avoids clients missing useful messages from early init. Clients will only show this in the backlog screen to avoid flooding the client's status line. Signed-off-by: Samuel Mendoza-Jonas --- ui/ncurses/nc-cui.c | 4 +++- ui/ncurses/nc-statuslog.c | 5 ----- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'ui') diff --git a/ui/ncurses/nc-cui.c b/ui/ncurses/nc-cui.c index 93b2e43..b4f74a7 100644 --- a/ui/ncurses/nc-cui.c +++ b/ui/ncurses/nc-cui.c @@ -714,7 +714,9 @@ static void cui_update_status(struct status *status, void *arg) statuslog_append_steal(cui, cui->statuslog, status); - nc_scr_status_printf(cui->current, "%s", status->message); + /* Ignore status messages from the backlog */ + if (!status->backlog) + nc_scr_status_printf(cui->current, "%s", status->message); } static void cui_update_mm_title(struct cui *cui) diff --git a/ui/ncurses/nc-statuslog.c b/ui/ncurses/nc-statuslog.c index 1943f39..623aa55 100644 --- a/ui/ncurses/nc-statuslog.c +++ b/ui/ncurses/nc-statuslog.c @@ -33,11 +33,6 @@ static const int max_status_entry = 10000; -struct statuslog_entry { - struct status *status; - struct list_item list; -}; - struct statuslog { struct list status; int n_status; -- cgit v1.2.1