diff options
author | James Booth <boothj5@gmail.com> | 2012-10-28 02:40:04 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2012-10-28 02:40:04 +0000 |
commit | e4c389cc51c6bf08836308bb4c3e4fa715a1fe65 (patch) | |
tree | 46feef82fea903b512f17a824015cc760dcaeee3 /src | |
parent | 7aa177c6687d78b3bc3f1fe1b951145cb2a07635 (diff) | |
download | profani-tty-e4c389cc51c6bf08836308bb4c3e4fa715a1fe65.tar.gz |
Added /me handling for incoming messages
Diffstat (limited to 'src')
-rw-r--r-- | src/windows.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/windows.c b/src/windows.c index b7486c92..6aea74ca 100644 --- a/src/windows.c +++ b/src/windows.c @@ -275,8 +275,17 @@ win_show_incomming_msg(const char * const from, const char * const message) // currently viewing chat window with sender if (win_index == _curr_prof_win) { _win_show_time(win); - _win_show_user(win, short_from, 1); - _win_show_message(win, message); + + if (strncmp(message, "/me ", 4) == 0) { + wattron(win, COLOUR_ONLINE); + wprintw(win, "*%s ", short_from); + wprintw(win, message + 4); + wprintw(win, "\n"); + wattroff(win, COLOUR_ONLINE); + } else { + _win_show_user(win, short_from, 1); + _win_show_message(win, message); + } title_bar_set_typing(FALSE); title_bar_draw(); status_bar_active(win_index); @@ -295,8 +304,16 @@ win_show_incomming_msg(const char * const from, const char * const message) } _win_show_time(win); - _win_show_user(win, short_from, 1); - _win_show_message(win, message); + if (strncmp(message, "/me ", 4) == 0) { + wattron(win, COLOUR_ONLINE); + wprintw(win, "*%s ", short_from); + wprintw(win, message + 4); + wprintw(win, "\n"); + wattroff(win, COLOUR_ONLINE); + } else { + _win_show_user(win, short_from, 1); + _win_show_message(win, message); + } } if (prefs_get_beep()) |