1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

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
This commit is contained in:
Michael Vetter 2019-11-05 21:06:07 +01:00
parent 68843f2448
commit 40dc5932f7
3 changed files with 13 additions and 0 deletions

View File

@ -777,6 +777,7 @@ cmd_ac_init(void)
autocomplete_add(titlebar_show_ac, "tls"); autocomplete_add(titlebar_show_ac, "tls");
autocomplete_add(titlebar_show_ac, "encwarn"); autocomplete_add(titlebar_show_ac, "encwarn");
autocomplete_add(titlebar_show_ac, "resource"); autocomplete_add(titlebar_show_ac, "resource");
autocomplete_add(titlebar_show_ac, "presence");
tls_certpath_ac = autocomplete_new(); tls_certpath_ac = autocomplete_new();
autocomplete_add(tls_certpath_ac, "set"); autocomplete_add(tls_certpath_ac, "set");

View File

@ -5960,6 +5960,9 @@ cmd_titlebar_show_hide(ProfWin *window, const char *const command, gchar **args)
} else if (g_strcmp0(args[1], "resource") == 0) { } else if (g_strcmp0(args[1], "resource") == 0) {
cons_show("Showing resource in titlebar enabled."); cons_show("Showing resource in titlebar enabled.");
prefs_set_boolean(PREF_RESOURCE_TITLE , TRUE); 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 { } else {
cons_bad_cmd_usage(command); 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) { } else if (g_strcmp0(args[1], "resource") == 0) {
cons_show("Showing resource in titlebar disabled."); cons_show("Showing resource in titlebar disabled.");
prefs_set_boolean(PREF_RESOURCE_TITLE , FALSE); 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 { } else {
cons_bad_cmd_usage(command); cons_bad_cmd_usage(command);
} }

View File

@ -1151,6 +1151,12 @@ cons_titlebar_setting(void)
} else { } else {
cons_show("Resource show (/titlebar) : OFF"); cons_show("Resource show (/titlebar) : OFF");
} }
if (prefs_get_boolean(PREF_PRESENCE)) {
cons_show("Titlebar presence (/titlebar) : ON");
} else {
cons_show("Titlebar presence (/titlebar) : OFF");
}
} }
void void