about summary refs log tree commit diff stats
path: root/src/omemo
diff options
context:
space:
mode:
authorPaul Fariello <paul@fariello.eu>2019-03-15 19:32:28 +0140
committerPaul Fariello <paul@fariello.eu>2019-04-10 17:12:31 +0200
commitcf528383bd78306f41b4645eff0d286a017d2d71 (patch)
tree74b8747f55d82049268f6739e3e5c74c6f161897 /src/omemo
parent21f247d0eb67b90e0e012575c758b0f663d3b292 (diff)
downloadprofani-tty-cf528383bd78306f41b4645eff0d286a017d2d71.tar.gz
Allow to start OMEMO in MUC
Diffstat (limited to 'src/omemo')
-rw-r--r--src/omemo/omemo.c13
-rw-r--r--src/omemo/omemo.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/src/omemo/omemo.c b/src/omemo/omemo.c
index 62478e5d..29899cc1 100644
--- a/src/omemo/omemo.c
+++ b/src/omemo/omemo.c
@@ -294,6 +294,19 @@ omemo_start_session(const char *const barejid)
     }
 }
 
+void
+omemo_start_muc_sessions(const char *const barejid)
+{
+    GList *roster = muc_roster(barejid);
+    GList *iter;
+    for (iter = roster; iter != NULL; iter = iter->next) {
+        Occupant *occupant = (Occupant *)iter->data;
+        Jid *jid = jid_create(occupant->jid);
+        omemo_start_session(jid->barejid);
+        jid_destroy(jid);
+    }
+}
+
 gboolean
 omemo_loaded(void)
 {
diff --git a/src/omemo/omemo.h b/src/omemo/omemo.h
index 3cf8ea52..6686cee2 100644
--- a/src/omemo/omemo.h
+++ b/src/omemo/omemo.h
@@ -36,6 +36,7 @@ void omemo_trust(const char *const jid, const char *const fingerprint);
 void omemo_untrust(const char *const jid, const char *const fingerprint);
 
 void omemo_start_session(const char *const barejid);
+void omemo_start_muc_sessions(const char *const barejid);
 void omemo_start_device_session(const char *const jid, uint32_t device_id, GList *prekeys, uint32_t signed_prekey_id, const unsigned char *const signed_prekey, size_t signed_prekey_len, const unsigned char *const signature, size_t signature_len, const unsigned char *const identity_key, size_t identity_key_len);
 
 gboolean omemo_loaded(void);