about summary refs log tree commit diff stats
path: root/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'command.c')
-rw-r--r--command.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/command.c b/command.c
index f8f7eb7d..19f982cd 100644
--- a/command.c
+++ b/command.c
@@ -45,6 +45,7 @@ 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_online(const char * const inp);
 static gboolean _cmd_default(const char * const inp);
 
 gboolean process_input(char *inp)
@@ -103,6 +104,8 @@ static gboolean _handle_command(const char * const command, const char * const i
         result = _cmd_set_flash(inp);
     } else if (strcmp(command, "/away") == 0) {
         result = _cmd_away(inp);
+    } else if (strcmp(command, "/online") == 0) {
+        result = _cmd_online(inp);
     } else {
         result = _cmd_default(inp);
     }
@@ -261,12 +264,28 @@ static gboolean _cmd_away(const char * const inp)
         cons_show("You are not currently connected.");
     } else {
         jabber_update_presence(PRESENCE_AWAY);
+        title_bar_set_status(PRESENCE_AWAY);
         cons_show("Status set to \"away\"");
     }
 
     return TRUE;
 }
 
+static gboolean _cmd_online(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_ONLINE);
+        title_bar_set_status(PRESENCE_ONLINE);
+        cons_show("Status set to \"online\"");
+    }
+
+    return TRUE;
+}
+
 static gboolean _cmd_default(const char * const inp)
 {
     if (win_in_chat()) {