about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorThorben Günther <admin@xenrox.net>2021-03-05 13:29:36 +0100
committerThorben Günther <admin@xenrox.net>2021-03-08 14:34:59 +0100
commitf1780f0017dde352a30192965233e25ef252d1f5 (patch)
treede464116964ec2f55f34f057746b70db4b5d6e34 /src/command
parent5c5c45321976c9a859694afa781178c68d076ee2 (diff)
downloadprofani-tty-f1780f0017dde352a30192965233e25ef252d1f5.tar.gz
MUC: Show offline members in sidebar
Diffstat (limited to 'src/command')
-rw-r--r--src/command/cmd_ac.c1
-rw-r--r--src/command/cmd_funcs.c12
2 files changed, 13 insertions, 0 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c
index 65d73b33..40c8d7ed 100644
--- a/src/command/cmd_ac.c
+++ b/src/command/cmd_ac.c
@@ -790,6 +790,7 @@ cmd_ac_init(void)
 
     occupants_show_ac = autocomplete_new();
     autocomplete_add(occupants_show_ac, "jid");
+    autocomplete_add(occupants_show_ac, "offline");
 
     occupants_char_ac = autocomplete_new();
     autocomplete_add(occupants_char_ac, "none");
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index d2cf2307..55965690 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -4370,6 +4370,9 @@ cmd_occupants(ProfWin* window, const char* const command, gchar** args)
             if (g_strcmp0(args[2], "jid") == 0) {
                 cons_show("Occupant jids enabled.");
                 prefs_set_boolean(PREF_OCCUPANTS_JID, TRUE);
+            } else if (g_strcmp0(args[2], "offline") == 0) {
+                cons_show("Occupants offline enabled.");
+                prefs_set_boolean(PREF_OCCUPANTS_OFFLINE, TRUE);
             } else {
                 cons_show("Occupant list enabled.");
                 prefs_set_boolean(PREF_OCCUPANTS, TRUE);
@@ -4379,6 +4382,9 @@ cmd_occupants(ProfWin* window, const char* const command, gchar** args)
             if (g_strcmp0(args[2], "jid") == 0) {
                 cons_show("Occupant jids disabled.");
                 prefs_set_boolean(PREF_OCCUPANTS_JID, FALSE);
+            } else if (g_strcmp0(args[2], "offline") == 0) {
+                cons_show("Occupants offline disabled.");
+                prefs_set_boolean(PREF_OCCUPANTS_OFFLINE, FALSE);
             } else {
                 cons_show("Occupant list disabled.");
                 prefs_set_boolean(PREF_OCCUPANTS, FALSE);
@@ -4430,6 +4436,9 @@ cmd_occupants(ProfWin* window, const char* const command, gchar** args)
         if (g_strcmp0(args[1], "jid") == 0) {
             mucwin->showjid = TRUE;
             mucwin_update_occupants(mucwin);
+        } else if (g_strcmp0(args[1], "offline") == 0) {
+            mucwin->showoffline = TRUE;
+            mucwin_update_occupants(mucwin);
         } else {
             mucwin_show_occupants(mucwin);
         }
@@ -4437,6 +4446,9 @@ cmd_occupants(ProfWin* window, const char* const command, gchar** args)
         if (g_strcmp0(args[1], "jid") == 0) {
             mucwin->showjid = FALSE;
             mucwin_update_occupants(mucwin);
+        } else if (g_strcmp0(args[1], "offline") == 0) {
+            mucwin->showoffline = FALSE;
+            mucwin_update_occupants(mucwin);
         } else {
             mucwin_hide_occupants(mucwin);
         }