diff options
author | Paul Fariello <paul@fariello.eu> | 2019-04-15 22:09:47 +0200 |
---|---|---|
committer | Paul Fariello <paul@fariello.eu> | 2019-04-17 14:03:14 +0200 |
commit | 5f015e32b263de6ebcaf9a3c6c2ffcad238410a0 (patch) | |
tree | a1aed9f92fe491d6e0af30b1c35b46c748ac8796 /src/ui/mucwin.c | |
parent | 9574127177a8e975add3cef523e85f6e75fe4585 (diff) | |
download | profani-tty-5f015e32b263de6ebcaf9a3c6c2ffcad238410a0.tar.gz |
Add OMEMO policy
There is 3 policy: - manual: OMEMO session are only started manually - automatic: OMEMO session are only started if they have been started manually before - always: OMEMO session are always started unless they have been ended manually before Closes #1040 and fixes #1052
Diffstat (limited to 'src/ui/mucwin.c')
-rw-r--r-- | src/ui/mucwin.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c index cdac610f..fc485b3d 100644 --- a/src/ui/mucwin.c +++ b/src/ui/mucwin.c @@ -44,6 +44,25 @@ #include "ui/window.h" #include "ui/win_types.h" #include "ui/window_list.h" +#ifdef HAVE_OMEMO +#include "omemo/omemo.h" +#endif + +ProfMucWin* +mucwin_new(const char *const barejid) +{ + ProfWin *window = wins_new_muc(barejid); + ProfMucWin *mucwin = (ProfMucWin *)window; + +#ifdef HAVE_OMEMO + if (omemo_automatic_start(barejid)) { + omemo_start_muc_sessions(barejid); + mucwin->is_omemo = TRUE; + } +#endif + + return mucwin; +} void mucwin_role_change(ProfMucWin *mucwin, const char *const role, const char *const actor, const char *const reason) |