mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Merge branch 'master' into osx-functional
This commit is contained in:
commit
1bebfefa9c
@ -191,7 +191,8 @@ static struct cmd_t command_defs[] =
|
|||||||
{ "/tls",
|
{ "/tls",
|
||||||
cmd_tls, parse_args, 1, 3, NULL,
|
cmd_tls, parse_args, 1, 3, NULL,
|
||||||
CMD_TAGS(
|
CMD_TAGS(
|
||||||
CMD_TAG_CONNECTION)
|
CMD_TAG_CONNECTION,
|
||||||
|
CMD_TAG_UI)
|
||||||
CMD_SYN(
|
CMD_SYN(
|
||||||
"/tls allow",
|
"/tls allow",
|
||||||
"/tls always",
|
"/tls always",
|
||||||
@ -200,7 +201,8 @@ static struct cmd_t command_defs[] =
|
|||||||
"/tls revoke <fingerprint>",
|
"/tls revoke <fingerprint>",
|
||||||
"/tls certpath",
|
"/tls certpath",
|
||||||
"/tls certpath set <path>",
|
"/tls certpath set <path>",
|
||||||
"/tls certpath clear")
|
"/tls certpath clear",
|
||||||
|
"/tls show on|off")
|
||||||
CMD_DESC(
|
CMD_DESC(
|
||||||
"Handle TLS certificates. ")
|
"Handle TLS certificates. ")
|
||||||
CMD_ARGS(
|
CMD_ARGS(
|
||||||
@ -211,7 +213,8 @@ static struct cmd_t command_defs[] =
|
|||||||
{ "revoke <fingerprint>", "Remove a manually trusted certificate." },
|
{ "revoke <fingerprint>", "Remove a manually trusted certificate." },
|
||||||
{ "certpath", "Show the trusted certificate path." },
|
{ "certpath", "Show the trusted certificate path." },
|
||||||
{ "certpath set <path>", "Specify filesystem path containing trusted certificates." },
|
{ "certpath set <path>", "Specify filesystem path containing trusted certificates." },
|
||||||
{ "certpath clear", "Clear the trusted certificate path." })
|
{ "certpath clear", "Clear the trusted certificate path." },
|
||||||
|
{ "show on|off", "Show or hide the TLS indicator in the titlebar." })
|
||||||
CMD_NOEXAMPLES
|
CMD_NOEXAMPLES
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -2158,6 +2161,7 @@ cmd_init(void)
|
|||||||
autocomplete_add(tls_ac, "trusted");
|
autocomplete_add(tls_ac, "trusted");
|
||||||
autocomplete_add(tls_ac, "revoke");
|
autocomplete_add(tls_ac, "revoke");
|
||||||
autocomplete_add(tls_ac, "certpath");
|
autocomplete_add(tls_ac, "certpath");
|
||||||
|
autocomplete_add(tls_ac, "show");
|
||||||
|
|
||||||
tls_certpath_ac = autocomplete_new();
|
tls_certpath_ac = autocomplete_new();
|
||||||
autocomplete_add(tls_certpath_ac, "set");
|
autocomplete_add(tls_certpath_ac, "set");
|
||||||
@ -3628,6 +3632,11 @@ _tls_autocomplete(ProfWin *window, const char * const input)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
result = autocomplete_param_with_func(input, "/tls show", prefs_autocomplete_boolean_choice);
|
||||||
|
if (result) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
result = autocomplete_param_with_ac(input, "/tls", tls_ac, TRUE);
|
result = autocomplete_param_with_ac(input, "/tls", tls_ac, TRUE);
|
||||||
if (result) {
|
if (result) {
|
||||||
return result;
|
return result;
|
||||||
|
@ -237,6 +237,8 @@ cmd_tls(ProfWin *window, const char * const command, gchar **args)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
} else if (g_strcmp0(args[0], "show") == 0) {
|
||||||
|
return _cmd_set_boolean_preference(args[1], command, "TLS titlebar indicator", PREF_TLS_SHOW);
|
||||||
} else {
|
} else {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -602,6 +602,7 @@ _get_group(preference_t pref)
|
|||||||
case PREF_RESOURCE_MESSAGE:
|
case PREF_RESOURCE_MESSAGE:
|
||||||
case PREF_ENC_WARN:
|
case PREF_ENC_WARN:
|
||||||
case PREF_INPBLOCK_DYNAMIC:
|
case PREF_INPBLOCK_DYNAMIC:
|
||||||
|
case PREF_TLS_SHOW:
|
||||||
return PREF_GROUP_UI;
|
return PREF_GROUP_UI;
|
||||||
case PREF_STATES:
|
case PREF_STATES:
|
||||||
case PREF_OUTTYPE:
|
case PREF_OUTTYPE:
|
||||||
@ -781,6 +782,8 @@ _get_key(preference_t pref)
|
|||||||
return "log";
|
return "log";
|
||||||
case PREF_CERT_PATH:
|
case PREF_CERT_PATH:
|
||||||
return "certpath";
|
return "certpath";
|
||||||
|
case PREF_TLS_SHOW:
|
||||||
|
return "tls.show";
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -817,6 +820,7 @@ _get_default_boolean(preference_t pref)
|
|||||||
case PREF_ROSTER_OFFLINE:
|
case PREF_ROSTER_OFFLINE:
|
||||||
case PREF_ROSTER_RESOURCE:
|
case PREF_ROSTER_RESOURCE:
|
||||||
case PREF_ROSTER_EMPTY:
|
case PREF_ROSTER_EMPTY:
|
||||||
|
case PREF_TLS_SHOW:
|
||||||
return TRUE;
|
return TRUE;
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -112,6 +112,7 @@ typedef enum {
|
|||||||
PREF_ENC_WARN,
|
PREF_ENC_WARN,
|
||||||
PREF_PGP_LOG,
|
PREF_PGP_LOG,
|
||||||
PREF_CERT_PATH,
|
PREF_CERT_PATH,
|
||||||
|
PREF_TLS_SHOW,
|
||||||
} preference_t;
|
} preference_t;
|
||||||
|
|
||||||
typedef struct prof_alias_t {
|
typedef struct prof_alias_t {
|
||||||
|
@ -471,6 +471,7 @@ _load_preferences(void)
|
|||||||
_set_boolean_preference("intype", PREF_INTYPE);
|
_set_boolean_preference("intype", PREF_INTYPE);
|
||||||
|
|
||||||
_set_boolean_preference("enc.warn", PREF_ENC_WARN);
|
_set_boolean_preference("enc.warn", PREF_ENC_WARN);
|
||||||
|
_set_boolean_preference("tls.show", PREF_TLS_SHOW);
|
||||||
|
|
||||||
if (g_key_file_has_key(theme, "ui", "otr.char", NULL)) {
|
if (g_key_file_has_key(theme, "ui", "otr.char", NULL)) {
|
||||||
gchar *ch = g_key_file_get_string(theme, "ui", "otr.char", NULL);
|
gchar *ch = g_key_file_get_string(theme, "ui", "otr.char", NULL);
|
||||||
|
@ -941,6 +941,16 @@ cons_encwarn_setting(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
cons_tlsshow_setting(void)
|
||||||
|
{
|
||||||
|
if (prefs_get_boolean(PREF_TLS_SHOW)) {
|
||||||
|
cons_show("TLS show (/tls) : ON");
|
||||||
|
} else {
|
||||||
|
cons_show("TLS show (/tls) : OFF");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cons_presence_setting(void)
|
cons_presence_setting(void)
|
||||||
{
|
{
|
||||||
@ -1147,6 +1157,7 @@ cons_show_ui_prefs(void)
|
|||||||
cons_encwarn_setting();
|
cons_encwarn_setting();
|
||||||
cons_presence_setting();
|
cons_presence_setting();
|
||||||
cons_inpblock_setting();
|
cons_inpblock_setting();
|
||||||
|
cons_tlsshow_setting();
|
||||||
|
|
||||||
cons_alert();
|
cons_alert();
|
||||||
}
|
}
|
||||||
|
@ -282,7 +282,7 @@ _show_self_presence(void)
|
|||||||
mvwaddch(win, 0, cols - 2, ']');
|
mvwaddch(win, 0, cols - 2, ']');
|
||||||
wattroff(win, bracket_attrs);
|
wattroff(win, bracket_attrs);
|
||||||
|
|
||||||
if (is_connected) {
|
if (is_connected && prefs_get_boolean(PREF_TLS_SHOW)) {
|
||||||
wattron(win, bracket_attrs);
|
wattron(win, bracket_attrs);
|
||||||
mvwaddch(win, 0, cols - tls_start, '[');
|
mvwaddch(win, 0, cols - tls_start, '[');
|
||||||
wattroff(win, bracket_attrs);
|
wattroff(win, bracket_attrs);
|
||||||
|
@ -304,6 +304,7 @@ void cons_beep_setting(void);
|
|||||||
void cons_flash_setting(void);
|
void cons_flash_setting(void);
|
||||||
void cons_splash_setting(void);
|
void cons_splash_setting(void);
|
||||||
void cons_encwarn_setting(void);
|
void cons_encwarn_setting(void);
|
||||||
|
void cons_tlsshow_setting(void);
|
||||||
void cons_vercheck_setting(void);
|
void cons_vercheck_setting(void);
|
||||||
void cons_occupants_setting(void);
|
void cons_occupants_setting(void);
|
||||||
void cons_roster_setting(void);
|
void cons_roster_setting(void);
|
||||||
|
@ -83,3 +83,4 @@ occupants.jid=false
|
|||||||
wins.autotidy=true
|
wins.autotidy=true
|
||||||
otr.char=@
|
otr.char=@
|
||||||
pgp.char=%
|
pgp.char=%
|
||||||
|
tls.show=true
|
||||||
|
@ -28,3 +28,4 @@ privileges=true
|
|||||||
presence=true
|
presence=true
|
||||||
intype=true
|
intype=true
|
||||||
enc.warn=true
|
enc.warn=true
|
||||||
|
tls.show=true
|
||||||
|
@ -28,3 +28,4 @@ presence=false
|
|||||||
intype=false
|
intype=false
|
||||||
enc.warn=false
|
enc.warn=false
|
||||||
wins.autotidy=false
|
wins.autotidy=false
|
||||||
|
tls.show=false
|
||||||
|
Loading…
Reference in New Issue
Block a user