mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-18 23:16:22 +00:00
Added _cmd_away
Not yet sending message to server
This commit is contained in:
17
command.c
17
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_away(const char * const inp);
|
||||
static gboolean _cmd_default(const char * const inp);
|
||||
|
||||
gboolean process_input(char *inp)
|
||||
@@ -100,6 +101,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, "/away") == 0) {
|
||||
result = _cmd_away(inp);
|
||||
} else {
|
||||
result = _cmd_default(inp);
|
||||
}
|
||||
@@ -250,6 +253,20 @@ static gboolean _cmd_set_flash(const char * const inp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean _cmd_away(const char * const inp)
|
||||
{
|
||||
jabber_conn_status_t conn_status = jabber_connection_status();
|
||||
|
||||
if (conn_status != JABBER_CONNECTED) {
|
||||
cons_show("You are not currently connected.");
|
||||
} else {
|
||||
jabber_update_presence(PRESENCE_AWAY);
|
||||
cons_show("Status set to \"away\"");
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean _cmd_default(const char * const inp)
|
||||
{
|
||||
if (win_in_chat()) {
|
||||
|
||||
Reference in New Issue
Block a user