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

Merge branch 'feature/sendfile-enc-warn'

Close https://github.com/profanity-im/profanity/pull/1270
This commit is contained in:
Michael Vetter 2020-02-17 09:01:00 +01:00
commit 555e50cc92
7 changed files with 157 additions and 7 deletions

View File

@ -173,9 +173,11 @@ static Autocomplete bookmark_property_ac;
static Autocomplete otr_ac; static Autocomplete otr_ac;
static Autocomplete otr_log_ac; static Autocomplete otr_log_ac;
static Autocomplete otr_policy_ac; static Autocomplete otr_policy_ac;
static Autocomplete otr_sendfile_ac;
static Autocomplete omemo_ac; static Autocomplete omemo_ac;
static Autocomplete omemo_log_ac; static Autocomplete omemo_log_ac;
static Autocomplete omemo_policy_ac; static Autocomplete omemo_policy_ac;
static Autocomplete omemo_sendfile_ac;
static Autocomplete connect_property_ac; static Autocomplete connect_property_ac;
static Autocomplete tls_property_ac; static Autocomplete tls_property_ac;
static Autocomplete alias_ac; static Autocomplete alias_ac;
@ -204,6 +206,7 @@ static Autocomplete inpblock_ac;
static Autocomplete receipts_ac; static Autocomplete receipts_ac;
static Autocomplete pgp_ac; static Autocomplete pgp_ac;
static Autocomplete pgp_log_ac; static Autocomplete pgp_log_ac;
static Autocomplete pgp_sendfile_ac;
static Autocomplete tls_ac; static Autocomplete tls_ac;
static Autocomplete titlebar_ac; static Autocomplete titlebar_ac;
static Autocomplete titlebar_show_ac; static Autocomplete titlebar_show_ac;
@ -604,6 +607,7 @@ cmd_ac_init(void)
autocomplete_add(otr_ac, "question"); autocomplete_add(otr_ac, "question");
autocomplete_add(otr_ac, "answer"); autocomplete_add(otr_ac, "answer");
autocomplete_add(otr_ac, "char"); autocomplete_add(otr_ac, "char");
autocomplete_add(otr_ac, "sendfile");
otr_log_ac = autocomplete_new(); otr_log_ac = autocomplete_new();
autocomplete_add(otr_log_ac, "on"); autocomplete_add(otr_log_ac, "on");
@ -615,6 +619,10 @@ cmd_ac_init(void)
autocomplete_add(otr_policy_ac, "opportunistic"); autocomplete_add(otr_policy_ac, "opportunistic");
autocomplete_add(otr_policy_ac, "always"); autocomplete_add(otr_policy_ac, "always");
otr_sendfile_ac = autocomplete_new();
autocomplete_add(otr_sendfile_ac, "on");
autocomplete_add(otr_sendfile_ac, "off");
omemo_ac = autocomplete_new(); omemo_ac = autocomplete_new();
autocomplete_add(omemo_ac, "gen"); autocomplete_add(omemo_ac, "gen");
autocomplete_add(omemo_ac, "log"); autocomplete_add(omemo_ac, "log");
@ -626,6 +634,7 @@ cmd_ac_init(void)
autocomplete_add(omemo_ac, "clear_device_list"); autocomplete_add(omemo_ac, "clear_device_list");
autocomplete_add(omemo_ac, "policy"); autocomplete_add(omemo_ac, "policy");
autocomplete_add(omemo_ac, "char"); autocomplete_add(omemo_ac, "char");
autocomplete_add(omemo_ac, "sendfile");
omemo_log_ac = autocomplete_new(); omemo_log_ac = autocomplete_new();
autocomplete_add(omemo_log_ac, "on"); autocomplete_add(omemo_log_ac, "on");
@ -637,6 +646,10 @@ cmd_ac_init(void)
autocomplete_add(omemo_policy_ac, "automatic"); autocomplete_add(omemo_policy_ac, "automatic");
autocomplete_add(omemo_policy_ac, "always"); autocomplete_add(omemo_policy_ac, "always");
omemo_sendfile_ac = autocomplete_new();
autocomplete_add(omemo_sendfile_ac, "on");
autocomplete_add(omemo_sendfile_ac, "off");
connect_property_ac = autocomplete_new(); connect_property_ac = autocomplete_new();
autocomplete_add(connect_property_ac, "server"); autocomplete_add(connect_property_ac, "server");
autocomplete_add(connect_property_ac, "port"); autocomplete_add(connect_property_ac, "port");
@ -776,12 +789,17 @@ cmd_ac_init(void)
autocomplete_add(pgp_ac, "end"); autocomplete_add(pgp_ac, "end");
autocomplete_add(pgp_ac, "log"); autocomplete_add(pgp_ac, "log");
autocomplete_add(pgp_ac, "char"); autocomplete_add(pgp_ac, "char");
autocomplete_add(pgp_ac, "sendfile");
pgp_log_ac = autocomplete_new(); pgp_log_ac = autocomplete_new();
autocomplete_add(pgp_log_ac, "on"); autocomplete_add(pgp_log_ac, "on");
autocomplete_add(pgp_log_ac, "off"); autocomplete_add(pgp_log_ac, "off");
autocomplete_add(pgp_log_ac, "redact"); autocomplete_add(pgp_log_ac, "redact");
pgp_sendfile_ac = autocomplete_new();
autocomplete_add(pgp_sendfile_ac, "on");
autocomplete_add(pgp_sendfile_ac, "off");
tls_ac = autocomplete_new(); tls_ac = autocomplete_new();
autocomplete_add(tls_ac, "allow"); autocomplete_add(tls_ac, "allow");
autocomplete_add(tls_ac, "always"); autocomplete_add(tls_ac, "always");
@ -1184,9 +1202,11 @@ cmd_ac_reset(ProfWin *window)
autocomplete_reset(otr_ac); autocomplete_reset(otr_ac);
autocomplete_reset(otr_log_ac); autocomplete_reset(otr_log_ac);
autocomplete_reset(otr_policy_ac); autocomplete_reset(otr_policy_ac);
autocomplete_reset(otr_sendfile_ac);
autocomplete_reset(omemo_ac); autocomplete_reset(omemo_ac);
autocomplete_reset(omemo_log_ac); autocomplete_reset(omemo_log_ac);
autocomplete_reset(omemo_policy_ac); autocomplete_reset(omemo_policy_ac);
autocomplete_reset(omemo_sendfile_ac);
autocomplete_reset(connect_property_ac); autocomplete_reset(connect_property_ac);
autocomplete_reset(tls_property_ac); autocomplete_reset(tls_property_ac);
autocomplete_reset(alias_ac); autocomplete_reset(alias_ac);
@ -1215,6 +1235,7 @@ cmd_ac_reset(ProfWin *window)
autocomplete_reset(receipts_ac); autocomplete_reset(receipts_ac);
autocomplete_reset(pgp_ac); autocomplete_reset(pgp_ac);
autocomplete_reset(pgp_log_ac); autocomplete_reset(pgp_log_ac);
autocomplete_reset(pgp_sendfile_ac);
autocomplete_reset(tls_ac); autocomplete_reset(tls_ac);
autocomplete_reset(titlebar_ac); autocomplete_reset(titlebar_ac);
autocomplete_reset(titlebar_show_ac); autocomplete_reset(titlebar_show_ac);
@ -1328,9 +1349,11 @@ cmd_ac_uninit(void)
autocomplete_free(otr_ac); autocomplete_free(otr_ac);
autocomplete_free(otr_log_ac); autocomplete_free(otr_log_ac);
autocomplete_free(otr_policy_ac); autocomplete_free(otr_policy_ac);
autocomplete_free(otr_sendfile_ac);
autocomplete_free(omemo_ac); autocomplete_free(omemo_ac);
autocomplete_free(omemo_log_ac); autocomplete_free(omemo_log_ac);
autocomplete_free(omemo_policy_ac); autocomplete_free(omemo_policy_ac);
autocomplete_free(omemo_sendfile_ac);
autocomplete_free(connect_property_ac); autocomplete_free(connect_property_ac);
autocomplete_free(tls_property_ac); autocomplete_free(tls_property_ac);
autocomplete_free(alias_ac); autocomplete_free(alias_ac);
@ -1358,6 +1381,7 @@ cmd_ac_uninit(void)
autocomplete_free(receipts_ac); autocomplete_free(receipts_ac);
autocomplete_free(pgp_ac); autocomplete_free(pgp_ac);
autocomplete_free(pgp_log_ac); autocomplete_free(pgp_log_ac);
autocomplete_free(pgp_sendfile_ac);
autocomplete_free(tls_ac); autocomplete_free(tls_ac);
autocomplete_free(titlebar_ac); autocomplete_free(titlebar_ac);
autocomplete_free(titlebar_show_ac); autocomplete_free(titlebar_show_ac);
@ -2226,6 +2250,11 @@ _otr_autocomplete(ProfWin *window, const char *const input, gboolean previous)
return found; return found;
} }
found = autocomplete_param_with_ac(input, "/otr sendfile", otr_sendfile_ac, TRUE, previous);
if (found) {
return found;
}
found = autocomplete_param_with_ac(input, "/otr", otr_ac, TRUE, previous); found = autocomplete_param_with_ac(input, "/otr", otr_ac, TRUE, previous);
if (found) { if (found) {
return found; return found;
@ -2253,6 +2282,11 @@ _pgp_autocomplete(ProfWin *window, const char *const input, gboolean previous)
return found; return found;
} }
found = autocomplete_param_with_ac(input, "/pgp sendfile", pgp_sendfile_ac, TRUE, previous);
if (found) {
return found;
}
#ifdef HAVE_LIBGPGME #ifdef HAVE_LIBGPGME
gboolean result; gboolean result;
gchar **args = parse_args(input, 2, 3, &result); gchar **args = parse_args(input, 2, 3, &result);
@ -2303,6 +2337,11 @@ _omemo_autocomplete(ProfWin *window, const char *const input, gboolean previous)
return found; return found;
} }
found = autocomplete_param_with_ac(input, "/omemo sendfile", omemo_sendfile_ac, TRUE, previous);
if (found) {
return found;
}
jabber_conn_status_t conn_status = connection_get_status(); jabber_conn_status_t conn_status = connection_get_status();
if (conn_status == JABBER_CONNECTED) { if (conn_status == JABBER_CONNECTED) {
@ -2316,7 +2355,6 @@ _omemo_autocomplete(ProfWin *window, const char *const input, gboolean previous)
return found; return found;
} }
#ifdef HAVE_OMEMO #ifdef HAVE_OMEMO
if (window->type == WIN_CHAT) { if (window->type == WIN_CHAT) {
ProfChatWin *chatwin = (ProfChatWin*)window; ProfChatWin *chatwin = (ProfChatWin*)window;

View File

@ -1657,7 +1657,8 @@ static struct cmd_t command_defs[] =
"/pgp start [<contact>]", "/pgp start [<contact>]",
"/pgp end", "/pgp end",
"/pgp log on|off|redact", "/pgp log on|off|redact",
"/pgp char <char>") "/pgp char <char>",
"/pgp sendfile on|off")
CMD_DESC( CMD_DESC(
"Open PGP commands to manage keys, and perform PGP encryption during chat sessions. " "Open PGP commands to manage keys, and perform PGP encryption during chat sessions. "
"See the /account command to set your own PGP key.") "See the /account command to set your own PGP key.")
@ -1670,7 +1671,8 @@ static struct cmd_t command_defs[] =
{ "end", "End PGP encrypted chat with the current recipient." }, { "end", "End PGP encrypted chat with the current recipient." },
{ "log on|off", "Enable or disable plaintext logging of PGP encrypted messages." }, { "log on|off", "Enable or disable plaintext logging of PGP encrypted messages." },
{ "log redact", "Log PGP encrypted messages, but replace the contents with [redacted]. This is the default." }, { "log redact", "Log PGP encrypted messages, but replace the contents with [redacted]. This is the default." },
{ "char <char>", "Set the character to be displayed next to PGP encrypted messages." }) { "char <char>", "Set the character to be displayed next to PGP encrypted messages." },
{ "sendfile on|off", "Allow /sendfile to send unencrypted files while otherwise using PGP session."})
CMD_EXAMPLES( CMD_EXAMPLES(
"/pgp log off", "/pgp log off",
"/pgp setkey buddy@buddychat.org BA19CACE5A9592C5", "/pgp setkey buddy@buddychat.org BA19CACE5A9592C5",
@ -1695,7 +1697,8 @@ static struct cmd_t command_defs[] =
{ "untrust", cmd_otr_untrust }, { "untrust", cmd_otr_untrust },
{ "secret", cmd_otr_secret }, { "secret", cmd_otr_secret },
{ "question", cmd_otr_question }, { "question", cmd_otr_question },
{ "answer", cmd_otr_answer }) { "answer", cmd_otr_answer },
{ "sendfile", cmd_otr_sendfile })
CMD_NOMAINFUNC CMD_NOMAINFUNC
CMD_TAGS( CMD_TAGS(
CMD_TAG_CHAT, CMD_TAG_CHAT,
@ -1712,7 +1715,8 @@ static struct cmd_t command_defs[] =
"/otr answer <answer>", "/otr answer <answer>",
"/otr policy manual|opportunistic|always [<contact>]", "/otr policy manual|opportunistic|always [<contact>]",
"/otr log on|off|redact", "/otr log on|off|redact",
"/otr char <char>") "/otr char <char>",
"/otr sendfile on|off")
CMD_DESC( CMD_DESC(
"Off The Record (OTR) commands to manage keys, and perform OTR encryption during chat sessions.") "Off The Record (OTR) commands to manage keys, and perform OTR encryption during chat sessions.")
CMD_ARGS( CMD_ARGS(
@ -1734,7 +1738,8 @@ static struct cmd_t command_defs[] =
{ "policy always <contact>", "Set the OTR policy to always for a specific contact." }, { "policy always <contact>", "Set the OTR policy to always for a specific contact." },
{ "log on|off", "Enable or disable plaintext logging of OTR encrypted messages." }, { "log on|off", "Enable or disable plaintext logging of OTR encrypted messages." },
{ "log redact", "Log OTR encrypted messages, but replace the contents with [redacted]. This is the default." }, { "log redact", "Log OTR encrypted messages, but replace the contents with [redacted]. This is the default." },
{ "char <char>", "Set the character to be displayed next to OTR encrypted messages." }) { "char <char>", "Set the character to be displayed next to OTR encrypted messages." },
{ "sendfile on|off", "Allow /sendfile to send unencrypted files while in an OTR session."})
CMD_EXAMPLES( CMD_EXAMPLES(
"/otr log off", "/otr log off",
"/otr policy manual", "/otr policy manual",
@ -2236,7 +2241,8 @@ static struct cmd_t command_defs[] =
{ "fingerprint", cmd_omemo_fingerprint }, { "fingerprint", cmd_omemo_fingerprint },
{ "char", cmd_omemo_char }, { "char", cmd_omemo_char },
{ "policy", cmd_omemo_policy }, { "policy", cmd_omemo_policy },
{ "clear_device_list", cmd_omemo_clear_device_list }) { "clear_device_list", cmd_omemo_clear_device_list },
{ "sendfile", cmd_omemo_sendfile} )
CMD_NOMAINFUNC CMD_NOMAINFUNC
CMD_TAGS( CMD_TAGS(
CMD_TAG_CHAT, CMD_TAG_CHAT,
@ -2250,6 +2256,7 @@ static struct cmd_t command_defs[] =
"/omemo fingerprint [<contact>]", "/omemo fingerprint [<contact>]",
"/omemo char <char>", "/omemo char <char>",
"/omemo policy manual|automatic|always", "/omemo policy manual|automatic|always",
"/omemo sendfile on|off",
"/omemo clear_device_list") "/omemo clear_device_list")
CMD_DESC( CMD_DESC(
"OMEMO commands to manage keys, and perform encryption during chat sessions.") "OMEMO commands to manage keys, and perform encryption during chat sessions.")
@ -2264,6 +2271,7 @@ static struct cmd_t command_defs[] =
{ "policy manual", "Set the global OMEMO policy to manual, OMEMO sessions must be started manually." }, { "policy manual", "Set the global OMEMO policy to manual, OMEMO sessions must be started manually." },
{ "policy automatic", "Set the global OMEMO policy to opportunistic, an OMEMO session will be attempted upon starting a conversation." }, { "policy automatic", "Set the global OMEMO policy to opportunistic, an OMEMO session will be attempted upon starting a conversation." },
{ "policy always", "Set the global OMEMO policy to always, an error will be displayed if an OMEMO session cannot be initiated upon starting a conversation." }, { "policy always", "Set the global OMEMO policy to always, an error will be displayed if an OMEMO session cannot be initiated upon starting a conversation." },
{ "sendfile on|off", "Allow /sendfile to send unencrypted files while in an OMEMO session."},
{ "clear_device_list", "Clear your own device list on server side. Each client will reannounce itself when connected back."}) { "clear_device_list", "Clear your own device list on server side. Each client will reannounce itself when connected back."})
CMD_EXAMPLES( CMD_EXAMPLES(
"/omemo gen", "/omemo gen",

View File

@ -4797,6 +4797,47 @@ cmd_sendfile(ProfWin *window, const char *const command, gchar **args)
return TRUE; return TRUE;
} }
switch (window->type) {
case WIN_MUC:
{
ProfMucWin *mucwin = (ProfMucWin*)window;
assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK);
// only omemo, no pgp/otr available in MUCs
if (mucwin->is_omemo && !prefs_get_boolean(PREF_OMEMO_SENDFILE)) {
cons_show_error("Uploading unencrypted files disabled. See /omemo sendfile, /otr sendfile, /pgp sendfile.");
win_println(window, THEME_ERROR, '-', "Sending encrypted files via http_upload is not possible yet.");
free(filename);
return TRUE;
}
break;
}
case WIN_CHAT:
{
ProfChatWin *chatwin = (ProfChatWin*)window;
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
if ((chatwin->is_omemo && !prefs_get_boolean(PREF_OMEMO_SENDFILE))
|| (chatwin->pgp_send && !prefs_get_boolean(PREF_PGP_SENDFILE))
|| (chatwin->is_otr && !prefs_get_boolean(PREF_OTR_SENDFILE))) {
cons_show_error("Uploading unencrypted files disabled. See /omemo sendfile, /otr sendfile, /pgp sendfile.");
win_println(window, THEME_ERROR, '-', "Sending encrypted files via http_upload is not possible yet.");
free(filename);
return TRUE;
}
break;
}
case WIN_PRIVATE:
{
//we don't support encryption in private muc windows
break;
}
default:
cons_show_error("Unsupported window for file transmission.");
free(filename);
return TRUE;
}
if (access(filename, R_OK) != 0) { if (access(filename, R_OK) != 0) {
cons_show_error("Uploading '%s' failed: File not found!", filename); cons_show_error("Uploading '%s' failed: File not found!", filename);
free(filename); free(filename);
@ -7296,6 +7337,11 @@ cmd_pgp(ProfWin *window, const char *const command, gchar **args)
return TRUE; return TRUE;
} }
if (g_strcmp0(args[0], "sendfile") == 0) {
_cmd_set_boolean_preference(args[1], command, "Sending unencrypted files using /sendfile while otherwise using PGP", PREF_PGP_SENDFILE);
return TRUE;
}
cons_bad_cmd_usage(command); cons_bad_cmd_usage(command);
return TRUE; return TRUE;
#else #else
@ -7769,6 +7815,19 @@ cmd_otr_answer(ProfWin *window, const char *const command, gchar **args)
#endif #endif
} }
gboolean
cmd_otr_sendfile(ProfWin *window, const char *const command, gchar **args)
{
#ifdef HAVE_LIBOTR
_cmd_set_boolean_preference(args[1], command, "Sending unencrypted files in an OTR session via /sendfile", PREF_OTR_SENDFILE);
return TRUE;
#else
cons_show("This version of Profanity has not been built with OTR support enabled");
return TRUE;
#endif
}
gboolean gboolean
cmd_command_list(ProfWin *window, const char *const command, gchar **args) cmd_command_list(ProfWin *window, const char *const command, gchar **args)
{ {
@ -8540,6 +8599,19 @@ cmd_omemo_policy(ProfWin *window, const char *const command, gchar **args)
#endif #endif
} }
gboolean
cmd_omemo_sendfile(ProfWin *window, const char *const command, gchar **args)
{
#ifdef HAVE_OMEMO
_cmd_set_boolean_preference(args[1], command, "Sending unencrypted files in an OMEMO session via /sendfile", PREF_OMEMO_SENDFILE);
return TRUE;
#else
cons_show("This version of Profanity has not been built with OMEMO support enabled");
return TRUE;
#endif
}
gboolean gboolean
cmd_save(ProfWin *window, const char *const command, gchar **args) cmd_save(ProfWin *window, const char *const command, gchar **args)
{ {

View File

@ -201,6 +201,7 @@ gboolean cmd_otr_untrust(ProfWin *window, const char *const command, gchar **arg
gboolean cmd_otr_secret(ProfWin *window, const char *const command, gchar **args); gboolean cmd_otr_secret(ProfWin *window, const char *const command, gchar **args);
gboolean cmd_otr_question(ProfWin *window, const char *const command, gchar **args); gboolean cmd_otr_question(ProfWin *window, const char *const command, gchar **args);
gboolean cmd_otr_answer(ProfWin *window, const char *const command, gchar **args); gboolean cmd_otr_answer(ProfWin *window, const char *const command, gchar **args);
gboolean cmd_otr_sendfile(ProfWin *window, const char *const command, gchar **args);
gboolean cmd_wins(ProfWin *window, const char *const command, gchar **args); gboolean cmd_wins(ProfWin *window, const char *const command, gchar **args);
gboolean cmd_wins_unread(ProfWin *window, const char *const command, gchar **args); gboolean cmd_wins_unread(ProfWin *window, const char *const command, gchar **args);
@ -219,6 +220,7 @@ gboolean cmd_omemo_trust(ProfWin *window, const char *const command, gchar **arg
gboolean cmd_omemo_untrust(ProfWin *window, const char *const command, gchar **args); gboolean cmd_omemo_untrust(ProfWin *window, const char *const command, gchar **args);
gboolean cmd_omemo_policy(ProfWin *window, const char *const command, gchar **args); gboolean cmd_omemo_policy(ProfWin *window, const char *const command, gchar **args);
gboolean cmd_omemo_clear_device_list(ProfWin *window, const char *const command, gchar **args); gboolean cmd_omemo_clear_device_list(ProfWin *window, const char *const command, gchar **args);
gboolean cmd_omemo_sendfile(ProfWin *window, const char *const command, gchar **args);
gboolean cmd_save(ProfWin *window, const char *const command, gchar **args); gboolean cmd_save(ProfWin *window, const char *const command, gchar **args);
gboolean cmd_reload(ProfWin *window, const char *const command, gchar **args); gboolean cmd_reload(ProfWin *window, const char *const command, gchar **args);

View File

@ -1790,8 +1790,10 @@ _get_group(preference_t pref)
return PREF_GROUP_CONNECTION; return PREF_GROUP_CONNECTION;
case PREF_OTR_LOG: case PREF_OTR_LOG:
case PREF_OTR_POLICY: case PREF_OTR_POLICY:
case PREF_OTR_SENDFILE:
return PREF_GROUP_OTR; return PREF_GROUP_OTR;
case PREF_PGP_LOG: case PREF_PGP_LOG:
case PREF_PGP_SENDFILE:
return PREF_GROUP_PGP; return PREF_GROUP_PGP;
case PREF_BOOKMARK_INVITE: case PREF_BOOKMARK_INVITE:
case PREF_ROOM_LIST_CACHE: case PREF_ROOM_LIST_CACHE:
@ -1800,6 +1802,7 @@ _get_group(preference_t pref)
return PREF_GROUP_PLUGINS; return PREF_GROUP_PLUGINS;
case PREF_OMEMO_LOG: case PREF_OMEMO_LOG:
case PREF_OMEMO_POLICY: case PREF_OMEMO_POLICY:
case PREF_OMEMO_SENDFILE:
return PREF_GROUP_OMEMO; return PREF_GROUP_OMEMO;
default: default:
return NULL; return NULL;
@ -1915,6 +1918,8 @@ _get_key(preference_t pref)
return "log"; return "log";
case PREF_OTR_POLICY: case PREF_OTR_POLICY:
return "policy"; return "policy";
case PREF_OTR_SENDFILE:
return "sendfile";
case PREF_LOG_ROTATE: case PREF_LOG_ROTATE:
return "rotate"; return "rotate";
case PREF_LOG_SHARED: case PREF_LOG_SHARED:
@ -1999,6 +2004,8 @@ _get_key(preference_t pref)
return "titlebar.muc.title"; return "titlebar.muc.title";
case PREF_PGP_LOG: case PREF_PGP_LOG:
return "log"; return "log";
case PREF_PGP_SENDFILE:
return "sendfile";
case PREF_TLS_CERTPATH: case PREF_TLS_CERTPATH:
return "tls.certpath"; return "tls.certpath";
case PREF_TLS_SHOW: case PREF_TLS_SHOW:
@ -2037,6 +2044,8 @@ _get_key(preference_t pref)
return "log"; return "log";
case PREF_OMEMO_POLICY: case PREF_OMEMO_POLICY:
return "policy"; return "policy";
case PREF_OMEMO_SENDFILE:
return "sendfile";
case PREF_CORRECTION_ALLOW: case PREF_CORRECTION_ALLOW:
return "correction.allow"; return "correction.allow";
default: default:

View File

@ -135,12 +135,14 @@ typedef enum {
PREF_LOG_SHARED, PREF_LOG_SHARED,
PREF_OTR_LOG, PREF_OTR_LOG,
PREF_OTR_POLICY, PREF_OTR_POLICY,
PREF_OTR_SENDFILE,
PREF_RESOURCE_TITLE, PREF_RESOURCE_TITLE,
PREF_RESOURCE_MESSAGE, PREF_RESOURCE_MESSAGE,
PREF_INPBLOCK_DYNAMIC, PREF_INPBLOCK_DYNAMIC,
PREF_ENC_WARN, PREF_ENC_WARN,
PREF_TITLEBAR_MUC_TITLE, PREF_TITLEBAR_MUC_TITLE,
PREF_PGP_LOG, PREF_PGP_LOG,
PREF_PGP_SENDFILE,
PREF_TLS_CERTPATH, PREF_TLS_CERTPATH,
PREF_TLS_SHOW, PREF_TLS_SHOW,
PREF_LASTACTIVITY, PREF_LASTACTIVITY,
@ -160,6 +162,7 @@ typedef enum {
PREF_STATUSBAR_ROOM, PREF_STATUSBAR_ROOM,
PREF_OMEMO_LOG, PREF_OMEMO_LOG,
PREF_OMEMO_POLICY, PREF_OMEMO_POLICY,
PREF_OMEMO_SENDFILE,
PREF_OCCUPANTS_WRAP, PREF_OCCUPANTS_WRAP,
PREF_CORRECTION_ALLOW, PREF_CORRECTION_ALLOW,
} preference_t; } preference_t;

View File

@ -2070,6 +2070,12 @@ cons_show_otr_prefs(void)
char ch = prefs_get_otr_char(); char ch = prefs_get_otr_char();
cons_show("OTR char (/otr char) : %c", ch); cons_show("OTR char (/otr char) : %c", ch);
if (prefs_get_boolean(PREF_OTR_SENDFILE)) {
cons_show("Allow sending unencrypted files in an OTR session via /sendfile (/otr sendfile): ON");
} else {
cons_show("Allow sending unencrypted files in an OTR session via /sendfile (/otr sendfile): OFF");
}
cons_alert(); cons_alert();
} }
@ -2092,6 +2098,12 @@ cons_show_pgp_prefs(void)
char ch = prefs_get_pgp_char(); char ch = prefs_get_pgp_char();
cons_show("PGP char (/pgp char) : %c", ch); cons_show("PGP char (/pgp char) : %c", ch);
if (prefs_get_boolean(PREF_PGP_SENDFILE)) {
cons_show("Allow sending unencrypted files via /sendfile while otherwise using PGP (/pgp sendfile): ON");
} else {
cons_show("Allow sending unencrypted files via /sendfile while otherwise using PGP (/pgp sendfile): OFF");
}
cons_alert(); cons_alert();
} }
@ -2118,6 +2130,12 @@ cons_show_omemo_prefs(void)
char ch = prefs_get_omemo_char(); char ch = prefs_get_omemo_char();
cons_show("OMEMO char (/omemo char) : %c", ch); cons_show("OMEMO char (/omemo char) : %c", ch);
if (prefs_get_boolean(PREF_OMEMO_SENDFILE)) {
cons_show("Allow sending unencrypted files in an OMEMO session via /sendfile (/omemo sendfile): ON");
} else {
cons_show("Allow sending unencrypted files in an OMEMO session via /sendfile (/omemo sendfile): OFF");
}
cons_alert(); cons_alert();
} }