diff options
| author | Paul Fariello <paul@fariello.eu> | 2019-04-17 11:07:57 +0200 |
|---|---|---|
| committer | Paul Fariello <paul@fariello.eu> | 2019-04-17 13:56:27 +0200 |
| commit | 8c71a74afe7c9fce8e51c17344396ab99676963a (patch) | |
| tree | 068228664ffe5b8995293f52db7c3c424e3d1146 /src/command | |
| parent | 02d0f7fc38f8b8017328a26cb7fc2cc8d2c34cd6 (diff) | |
| download | profani-tty-8c71a74afe7c9fce8e51c17344396ab99676963a.tar.gz | |
Ensure MUC is Non-Anonymous before starting OMEMO
Store MUC anonymous type in mucwin for that purpose.
Fixes #1065
Diffstat (limited to 'src/command')
| -rw-r--r-- | src/command/cmd_funcs.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index fe289f0b..3c55fedb 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -8031,14 +8031,14 @@ cmd_omemo_start(ProfWin *window, const char *const command, gchar **args) ProfMucWin *mucwin = (ProfMucWin*)window; assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK); - /* TODO: Check room is configured correctly, no anonymous and access to - * full jid */ - omemo_start_muc_sessions(mucwin->roomjid); - - mucwin->is_omemo = TRUE; + if (muc_anonymity_type(mucwin->roomjid) == MUC_ANONYMITY_TYPE_NONANONYMOUS) { + omemo_start_muc_sessions(mucwin->roomjid); + mucwin->is_omemo = TRUE; + } else { + win_println(window, THEME_DEFAULT, '!', "MUC must be non-anonymous (i.e. be configured to present real jid to anyone) in order to support OMEMO."); + } } else { win_println(window, THEME_DEFAULT, '-', "You must be in a regular chat window to start an OMEMO session."); - return TRUE; } } |