1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

_win_show_message function

This commit is contained in:
James Booth 2012-02-29 23:46:25 +00:00
parent c9666f2f38
commit 5aba98c6aa

View File

@ -35,6 +35,7 @@ static void _current_window_refresh();
static void _win_switch_if_active(int i); static void _win_switch_if_active(int i);
static void _win_show_time(int win); static void _win_show_time(int win);
static void _win_show_user(int win, char *user, int colour); static void _win_show_user(int win, char *user, int colour);
static void _win_show_message(WINDOW *win, char *message);
void gui_init(void) void gui_init(void)
{ {
@ -110,9 +111,7 @@ void win_show_incomming_msg(char *from, char *message)
int win = _find_win(short_from); int win = _find_win(short_from);
_win_show_time(win); _win_show_time(win);
_win_show_user(win, short_from, 1); _win_show_user(win, short_from, 1);
wattroff(_wins[win].win, A_BOLD); _win_show_message(_wins[win].win, message);
wprintw(_wins[win].win, "%s\n", message);
wattron(_wins[win].win, A_BOLD);
status_bar_active(win); status_bar_active(win);
} }
@ -122,9 +121,7 @@ void win_show_outgoing_msg(char *from, char *to, char *message)
int win = _find_win(to); int win = _find_win(to);
_win_show_time(win); _win_show_time(win);
_win_show_user(win, from, 0); _win_show_user(win, from, 0);
wattroff(_wins[win].win, A_BOLD); _win_show_message(_wins[win].win, message);
wprintw(_wins[win].win, "%s\n", message);
wattron(_wins[win].win, A_BOLD);
status_bar_active(win); status_bar_active(win);
} }
@ -399,6 +396,13 @@ static void _win_show_user(int win, char *user, int colour)
wattroff(_wins[win].win, COLOR_PAIR(2)); wattroff(_wins[win].win, COLOR_PAIR(2));
} }
static void _win_show_message(WINDOW *win, char *message)
{
wattroff(win, A_BOLD);
wprintw(win, "%s\n", message);
wattron(win, A_BOLD);
}
static void _current_window_refresh() static void _current_window_refresh()
{ {
touchwin(_wins[_curr_win].win); touchwin(_wins[_curr_win].win);