diff options
author | Dolan O'Toole <dolan.otoole@corelogic.co.uk> | 2012-06-03 23:02:13 +0100 |
---|---|---|
committer | Dolan O'Toole <dolan.otoole@corelogic.co.uk> | 2012-06-03 23:02:13 +0100 |
commit | d91175e5c2c33c2b03ff4c991008ea0a87841055 (patch) | |
tree | 8cc45c5a7de91aa35b29f034859a83e2b8f8e52b /command.c | |
parent | 4dbf4ff099a19ce2fe55f50e2dacb299d4a0841f (diff) | |
download | profani-tty-d91175e5c2c33c2b03ff4c991008ea0a87841055.tar.gz |
added showsplash command
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/command.c b/command.c index 743ec5ae..f9b70e1f 100644 --- a/command.c +++ b/command.c @@ -44,6 +44,7 @@ static gboolean _cmd_msg(const char * const inp); static gboolean _cmd_close(const char * const inp); static gboolean _cmd_set_beep(const char * const inp); static gboolean _cmd_set_flash(const char * const inp); +static gboolean _cmd_set_showsplash(const char * const inp); static gboolean _cmd_away(const char * const inp); static gboolean _cmd_online(const char * const inp); static gboolean _cmd_dnd(const char * const inp); @@ -107,6 +108,8 @@ static gboolean _handle_command(const char * const command, const char * const i result = _cmd_set_beep(inp); } else if (strcmp(command, "/flash") == 0) { result = _cmd_set_flash(inp); + } else if (strcmp(command, "/showsplash") == 0) { + result = _cmd_set_showsplash(inp); } else if (strcmp(command, "/away") == 0) { result = _cmd_away(inp); } else if (strcmp(command, "/online") == 0) { @@ -267,6 +270,21 @@ static gboolean _cmd_set_flash(const char * const inp) return TRUE; } +static gboolean _cmd_set_showsplash(const char * const inp) +{ + if (strcmp(inp, "/showsplash on") == 0) { + cons_show("Splash screen enabled."); + prefs_set_showsplash(TRUE); + } else if (strcmp(inp, "/showsplash off") == 0) { + cons_show("Splash screen disabled."); + prefs_set_showsplash(FALSE); + } else { + cons_show("Usage: /showsplash <on/off>"); + } + + return TRUE; +} + static gboolean _cmd_away(const char * const inp) { _update_presence(PRESENCE_AWAY, "away", inp); |