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

Moved remaining static functions to console module

This commit is contained in:
James Booth 2013-04-21 01:47:57 +01:00
parent 8a280b43ca
commit e151ce707d
3 changed files with 24 additions and 25 deletions

View File

@ -152,6 +152,24 @@ cons_bad_command(const char * const cmd)
}
}
void
cons_show_typing(const char * const short_from)
{
window_show_time(console, '-');
wattron(console->win, COLOUR_TYPING);
wprintw(console->win, "!! %s is typing a message...\n", short_from);
wattroff(console->win, COLOUR_TYPING);
}
void
cons_show_incoming_message(const char * const short_from, const int win_index)
{
window_show_time(console, '-');
wattron(console->win, COLOUR_INCOMING);
wprintw(console->win, "<< incoming from %s (%d)\n", short_from, win_index + 1);
wattroff(console->win, COLOUR_INCOMING);
}
void
cons_about(void)
{

View File

@ -166,6 +166,8 @@ void cons_show_disco_info(const char *from, GSList *identities, GSList *features
void cons_show_room_invite(const char * const invitor, const char * const room,
const char * const reason);
void cons_check_version(gboolean not_available_msg);
void cons_show_typing(const char * const short_from);
void cons_show_incoming_message(const char * const short_from, const int win_index);
// status bar actions
void status_bar_refresh(void);

View File

@ -83,9 +83,6 @@ static void _show_status_string(ProfWin *window, const char * const from,
const char * const show, const char * const status,
GDateTime *last_activity, const char * const pre,
const char * const default_show);
static void _cons_show_typing(const char * const short_from);
static void _cons_show_incoming_message(const char * const short_from,
const int win_index);
static void _win_handle_switch(const wint_t * const ch);
static void _win_handle_page(const wint_t * const ch);
static void _win_resize_all(void);
@ -266,11 +263,11 @@ ui_show_typing(const char * const from)
if (prefs_get_boolean(PREF_INTYPE)) {
// no chat window for user
if (win_index == NUM_WINS) {
_cons_show_typing(from);
cons_show_typing(from);
// have chat window but not currently in it
} else if (win_index != current_index) {
_cons_show_typing(from);
cons_show_typing(from);
dirty = TRUE;
// in chat window with user
@ -400,7 +397,7 @@ ui_show_incoming_msg(const char * const from, const char * const message,
// not currently viewing chat window with sender
} else {
status_bar_new(win_index);
_cons_show_incoming_message(from, win_index);
cons_show_incoming_message(from, win_index);
if (prefs_get_boolean(PREF_FLASH))
flash();
@ -1034,7 +1031,7 @@ win_show_room_message(const char * const room_jid, const char * const nick,
// not currenlty on groupchat window
} else {
status_bar_new(win_index);
_cons_show_incoming_message(nick, win_index);
cons_show_incoming_message(nick, win_index);
if (current_index == 0) {
dirty = TRUE;
}
@ -1414,24 +1411,6 @@ _show_status_string(ProfWin *window, const char * const from,
}
}
static void
_cons_show_typing(const char * const short_from)
{
window_show_time(console, '-');
wattron(console->win, COLOUR_TYPING);
wprintw(console->win, "!! %s is typing a message...\n", short_from);
wattroff(console->win, COLOUR_TYPING);
}
static void
_cons_show_incoming_message(const char * const short_from, const int win_index)
{
window_show_time(console, '-');
wattron(console->win, COLOUR_INCOMING);
wprintw(console->win, "<< incoming from %s (%d)\n", short_from, win_index + 1);
wattroff(console->win, COLOUR_INCOMING);
}
static void
_win_handle_switch(const wint_t * const ch)
{