diff --git a/src/plugins/api.c b/src/plugins/api.c index 1f773033..75c5b812 100644 --- a/src/plugins/api.c +++ b/src/plugins/api.c @@ -140,6 +140,11 @@ api_win_create(const char *tag, void *callback, window->callback_func = callback_func; callbacks_add_window_handler(tag, window); wins_new(tag, WIN_PLUGIN); + + // set status bar active + ProfWin *win = wins_get_by_recipient(tag); + int num = wins_get_num(win); + ui_status_bar_active(num); } void @@ -163,4 +168,10 @@ api_win_show(const char *tag, const char *line) ProfWin *window = wins_get_by_recipient(tag); win_print_time(window, '-'); wprintw(window->win, "%s\n", line); -} + + // refresh if current + if (wins_is_current(window)) { + int num = wins_get_num(window); + ui_switch_win(num); + } +} \ No newline at end of file diff --git a/src/ui/core.c b/src/ui/core.c index 9241b7f8..82ef4e8d 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -2144,6 +2144,24 @@ _win_show_history(WINDOW *win, int win_index, const char * const contact) } } +static void +_ui_status_bar_inactive(const int win) +{ + status_bar_inactive(win); +} + +static void +_ui_status_bar_active(const int win) +{ + status_bar_active(win); +} + +static void +_ui_status_bar_new(const int win) +{ + status_bar_new(win); +} + void ui_init_module(void) { @@ -2256,4 +2274,7 @@ ui_init_module(void) ui_open_xmlconsole_win = _ui_open_xmlconsole_win; ui_handle_room_join_error = _ui_handle_room_join_error; ui_swap_wins = _ui_swap_wins; + ui_status_bar_inactive = _ui_status_bar_inactive; + ui_status_bar_active = _ui_status_bar_active; + ui_status_bar_new = _ui_status_bar_new; } diff --git a/src/ui/ui.h b/src/ui/ui.h index 929127ee..10b06a8b 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -258,6 +258,10 @@ void (*cons_autoconnect_setting)(void); void (*cons_show_contact_online)(PContact contact, Resource *resource, GDateTime *last_activity); void (*cons_show_contact_offline)(PContact contact, char *resource, char *status); +void (*ui_status_bar_inactive)(const int win); +void (*ui_status_bar_active)(const int win); +void (*ui_status_bar_new)(const int win); + // desktop notifier actions void (*notifier_init)(void); void (*notifier_uninit)(void);