about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-11-15 21:33:48 +0000
committerJames Booth <boothj5@gmail.com>2015-11-15 21:33:48 +0000
commitbadbc3003f1a6e2d6eecb166a36fef8bc66f9b17 (patch)
tree66cd345cad6c6cab51d186836693a2bc98f866f4 /src/command
parentc5ac0f1319c38d3f2a212da86c6b6ba233d6fd84 (diff)
downloadprofani-tty-badbc3003f1a6e2d6eecb166a36fef8bc66f9b17.tar.gz
Show presence in roster WIP
Diffstat (limited to 'src/command')
-rw-r--r--src/command/command.c10
-rw-r--r--src/command/commands.c28
2 files changed, 36 insertions, 2 deletions
diff --git a/src/command/command.c b/src/command/command.c
index 2b8b4d8b..4241acb4 100644
--- a/src/command/command.c
+++ b/src/command/command.c
@@ -274,8 +274,8 @@ static struct cmd_t command_defs[] =
         CMD_SYN(
             "/roster",
             "/roster online",
-            "/roster show [offline|resource|empty]",
-            "/roster hide [offline|resource|empty]",
+            "/roster show [offline|resource|presence|status|empty]",
+            "/roster hide [offline|resource|presence|status|empty]",
             "/roster by group|presence|none",
             "/roster size <percent>",
             "/roster add <jid> [<nick>]",
@@ -291,10 +291,14 @@ static struct cmd_t command_defs[] =
             { "show",                "Show the roster panel." },
             { "show offline",        "Show offline contacts in the roster panel." },
             { "show resource",       "Show contact's connected resources in the roster panel." },
+            { "show presence",       "Show contact's presence in the roster panel." },
+            { "show status",         "Show contact's status message in the roster panel." },
             { "show empty",          "When grouping by presence, show empty presence groups." },
             { "hide",                "Hide the roster panel." },
             { "hide offline",        "Hide offline contacts in the roster panel." },
             { "hide resource",       "Hide contact's connected resources in the roster panel." },
+            { "hide presence",       "Hide contact's presence in the roster panel." },
+            { "hide status",         "Hide contact's status message in the roster panel." },
             { "hide empty",          "When grouping by presence, hide empty presence groups." },
             { "by group",            "Group contacts in the roster panel by roster group." },
             { "by presence",         "Group contacts in the roster panel by presence." },
@@ -2015,6 +2019,8 @@ cmd_init(void)
     roster_option_ac = autocomplete_new();
     autocomplete_add(roster_option_ac, "offline");
     autocomplete_add(roster_option_ac, "resource");
+    autocomplete_add(roster_option_ac, "presence");
+    autocomplete_add(roster_option_ac, "status");
     autocomplete_add(roster_option_ac, "empty");
 
     roster_by_ac = autocomplete_new();
diff --git a/src/command/commands.c b/src/command/commands.c
index fe3c7045..40a041c9 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -1773,6 +1773,20 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
                 rosterwin_roster();
             }
             return TRUE;
+        } else if (g_strcmp0(args[1], "presence") == 0) {
+            cons_show("Roster presence enabled");
+            prefs_set_boolean(PREF_ROSTER_PRESENCE, TRUE);
+            if (conn_status == JABBER_CONNECTED) {
+                rosterwin_roster();
+            }
+            return TRUE;
+        } else if (g_strcmp0(args[1], "status") == 0) {
+            cons_show("Roster status enabled");
+            prefs_set_boolean(PREF_ROSTER_STATUS, TRUE);
+            if (conn_status == JABBER_CONNECTED) {
+                rosterwin_roster();
+            }
+            return TRUE;
         } else if (g_strcmp0(args[1], "empty") == 0) {
             cons_show("Roster empty enabled");
             prefs_set_boolean(PREF_ROSTER_EMPTY, TRUE);
@@ -1806,6 +1820,20 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
                 rosterwin_roster();
             }
             return TRUE;
+        } else if (g_strcmp0(args[1], "presence") == 0) {
+            cons_show("Roster presence disabled");
+            prefs_set_boolean(PREF_ROSTER_PRESENCE, FALSE);
+            if (conn_status == JABBER_CONNECTED) {
+                rosterwin_roster();
+            }
+            return TRUE;
+        } else if (g_strcmp0(args[1], "status") == 0) {
+            cons_show("Roster status disabled");
+            prefs_set_boolean(PREF_ROSTER_STATUS, FALSE);
+            if (conn_status == JABBER_CONNECTED) {
+                rosterwin_roster();
+            }
+            return TRUE;
         } else if (g_strcmp0(args[1], "empty") == 0) {
             cons_show("Roster empty disabled");
             prefs_set_boolean(PREF_ROSTER_EMPTY, FALSE);