about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-11-05 21:06:07 +0100
committerMichael Vetter <jubalh@iodoru.org>2019-11-05 21:06:07 +0100
commit40dc5932f71ccb6bd67f4fd8365749a0ddecbf71 (patch)
treedda496c377db7713532387f4acd642211660f78a /src/command
parent68843f2448256b9761b81dcd7656ea360dae9d75 (diff)
downloadprofani-tty-40dc5932f71ccb6bd67f4fd8365749a0ddecbf71.tar.gz
Add `/titlebar show presence` command
Additionally to `/presence titlebar on` we now allow the setting via
/titlebar show|hide presence` since it's about the titlebar.

Regards https://github.com/profanity-im/profanity/issues/1116
Diffstat (limited to 'src/command')
-rw-r--r--src/command/cmd_ac.c1
-rw-r--r--src/command/cmd_funcs.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c
index f8aa2e21..a3b0625f 100644
--- a/src/command/cmd_ac.c
+++ b/src/command/cmd_ac.c
@@ -777,6 +777,7 @@ cmd_ac_init(void)
     autocomplete_add(titlebar_show_ac, "tls");
     autocomplete_add(titlebar_show_ac, "encwarn");
     autocomplete_add(titlebar_show_ac, "resource");
+    autocomplete_add(titlebar_show_ac, "presence");
 
     tls_certpath_ac = autocomplete_new();
     autocomplete_add(tls_certpath_ac, "set");
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index 32474650..3a8ae2de 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -5960,6 +5960,9 @@ cmd_titlebar_show_hide(ProfWin *window, const char *const command, gchar **args)
             } else if (g_strcmp0(args[1], "resource") == 0) {
                 cons_show("Showing resource in titlebar enabled.");
                 prefs_set_boolean(PREF_RESOURCE_TITLE , TRUE);
+            } else if (g_strcmp0(args[1], "presence") == 0) {
+                cons_show("Showing contact presence in titlebar enabled.");
+                prefs_set_boolean(PREF_PRESENCE , TRUE);
             } else {
                 cons_bad_cmd_usage(command);
             }
@@ -5974,6 +5977,9 @@ cmd_titlebar_show_hide(ProfWin *window, const char *const command, gchar **args)
             } else if (g_strcmp0(args[1], "resource") == 0) {
                 cons_show("Showing resource in titlebar disabled.");
                 prefs_set_boolean(PREF_RESOURCE_TITLE , FALSE);
+            } else if (g_strcmp0(args[1], "presence") == 0) {
+                cons_show("Showing contact presence in titlebar enabled.");
+                prefs_set_boolean(PREF_PRESENCE , FALSE);
             } else {
                 cons_bad_cmd_usage(command);
             }