diff options
| author | Paul Fariello <paul@fariello.eu> | 2019-02-19 20:03:50 +0140 |
|---|---|---|
| committer | Paul Fariello <paul@fariello.eu> | 2019-04-10 15:37:22 +0200 |
| commit | 2602cbf7852fa4317d961316b601a383b9077079 (patch) | |
| tree | 31a21338b33a2efa61db9a9da67b7f922ac6b22d /src/command | |
| parent | 519cf295f31d77bec45644424f7212e9fb2692e8 (diff) | |
| download | profani-tty-2602cbf7852fa4317d961316b601a383b9077079.tar.gz | |
Move OMEMO initialization to profanity intialization
Also store identity keys into account
Diffstat (limited to 'src/command')
| -rw-r--r-- | src/command/cmd_defs.c | 11 | ||||
| -rw-r--r-- | src/command/cmd_funcs.c | 13 | ||||
| -rw-r--r-- | src/command/cmd_funcs.h | 2 |
3 files changed, 14 insertions, 12 deletions
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index 23ab2ebf..af30db34 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -2333,19 +2333,22 @@ static struct cmd_t command_defs[] = { "/omemo", parse_args, 1, 3, NULL, CMD_SUBFUNCS( - { "init", cmd_omemo_init }) + { "gen", cmd_omemo_gen }) CMD_NOMAINFUNC CMD_TAGS( CMD_TAG_CHAT, CMD_TAG_UI) CMD_SYN( - "/omemo init") + "/omemo gen", + "/omemo start [<contact>]") CMD_DESC( "Omemo commands to manage keys, and perform encryption during chat sessions.") CMD_ARGS( - { "init", "Initialize omemo" }) + { "gen", "Generate OMEMO crytographic materials for current account." }, + { "start [<contact>]", "Start an OMEMO session with contact, or current recipient if omitted." }) CMD_EXAMPLES( - "/omemo init") + "/omemo gen", + "/omemo start buddy@buddychat.org") }, }; diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 97ce2025..08aa88df 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -85,7 +85,7 @@ #include "pgp/gpg.h" #endif -#ifdef HAVE_LIBSIGNAL_PROTOCOL +#ifdef HAVE_OMEMO #include "omemo/omemo.h" #endif @@ -7878,20 +7878,19 @@ _cmd_set_boolean_preference(gchar *arg, const char *const command, } gboolean -cmd_omemo_init(ProfWin *window, const char *const command, gchar **args) +cmd_omemo_gen(ProfWin *window, const char *const command, gchar **args) { -#ifdef HAVE_LIBSIGNAL_PROTOCOL +#ifdef HAVE_OMEMO if (connection_get_status() != JABBER_CONNECTED) { - cons_show("You must be connected with an account to initialize omemo"); + cons_show("You must be connected with an account to initialize OMEMO"); return TRUE; } ProfAccount *account = accounts_get_account(session_get_account_name()); - omemo_init(account); - cons_show("Initialized omemo"); + omemo_generate_crypto_materials(account); return TRUE; #else - cons_show("This version of Profanity has not been built with Omemo support enabled"); + cons_show("This version of Profanity has not been built with OMEMO support enabled"); return TRUE; #endif } diff --git a/src/command/cmd_funcs.h b/src/command/cmd_funcs.h index fb81721d..650c9eaf 100644 --- a/src/command/cmd_funcs.h +++ b/src/command/cmd_funcs.h @@ -214,6 +214,6 @@ gboolean cmd_wins_swap(ProfWin *window, const char *const command, gchar **args) gboolean cmd_form_field(ProfWin *window, char *tag, gchar **args); -gboolean cmd_omemo_init(ProfWin *window, const char *const command, gchar **args); +gboolean cmd_omemo_gen(ProfWin *window, const char *const command, gchar **args); #endif |