diff options
author | James Booth <boothj5@gmail.com> | 2013-02-17 01:04:10 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-02-17 01:04:10 +0000 |
commit | 44d2f8da7a235997049bac68fea746682ae49e9f (patch) | |
tree | 084d2440cdb88815e532e5e6c526d04611bde8a0 /src/ui | |
parent | ab591b41b2535f454d35d7524c454dccea1b2cc5 (diff) | |
download | profani-tty-44d2f8da7a235997049bac68fea746682ae49e9f.tar.gz |
Added /caps command
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/ui.h | 1 | ||||
-rw-r--r-- | src/ui/windows.c | 30 |
2 files changed, 28 insertions, 3 deletions
diff --git a/src/ui/ui.h b/src/ui/ui.h index 80139cc1..378cea69 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -165,6 +165,7 @@ void cons_check_version(gboolean not_available_msg); void cons_show_wins(void); void cons_show_status(const char * const contact); void cons_show_info(PContact pcontact); +void cons_show_caps(PContact pcontact); void cons_show_themes(GSList *themes); void cons_show_login_success(ProfAccount *account); diff --git a/src/ui/windows.c b/src/ui/windows.c index d23257ba..a7bf5eec 100644 --- a/src/ui/windows.c +++ b/src/ui/windows.c @@ -103,7 +103,7 @@ static void _win_resize_all(void); static gint _win_get_unread(void); static void _win_show_history(WINDOW *win, int win_index, const char * const contact); -static void _win_show_info(WINDOW *win, PContact pcontact); +static void _win_show_info(WINDOW *win, PContact pcontact, gboolean show_caps); static gboolean _new_release(char *found_version); static void _ui_draw_win_title(void); static void _presence_colour_on(WINDOW *win, const char * const presence); @@ -1184,7 +1184,19 @@ cons_show_wins(void) void cons_show_info(PContact pcontact) { - _win_show_info(console->win, pcontact); + _win_show_info(console->win, pcontact, FALSE); + + if (current_index == 0) { + dirty = TRUE; + } else { + status_bar_new(0); + } +} + +void +cons_show_caps(PContact pcontact) +{ + _win_show_info(console->win, pcontact, TRUE); if (current_index == 0) { dirty = TRUE; @@ -2400,7 +2412,7 @@ _win_show_history(WINDOW *win, int win_index, const char * const contact) } static void -_win_show_info(WINDOW *win, PContact pcontact) +_win_show_info(WINDOW *win, PContact pcontact, gboolean show_caps) { const char *barejid = p_contact_barejid(pcontact); const char *name = p_contact_name(pcontact); @@ -2520,6 +2532,18 @@ _win_show_info(WINDOW *win, PContact pcontact) if ((caps->os != NULL) || (caps->os_version != NULL)) { wprintw(win, "\n"); } + + if (show_caps && caps->features != NULL) { + _win_show_time(win, '-'); + wprintw(win, " Features:\n"); + GSList *feature = caps->features; + while (feature != NULL) { + _win_show_time(win, '-'); + wprintw(win, " %s\n", feature->data); + feature = g_slist_next(feature); + } + } + } } |