about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-07-04 17:41:56 +0200
committerMichael Vetter <jubalh@iodoru.org>2020-07-04 17:41:56 +0200
commitd2c3aa566b81a03b112f0192cf10681c523bbfe9 (patch)
tree5e4334589ab3f456198a8b6d07927111d409c4b7 /src
parentbf170d6c9168f987ab4431e733bf1d120af54df3 (diff)
parent193282a4fc45d9ee7bc2abf7e630de680314b8a9 (diff)
downloadprofani-tty-d2c3aa566b81a03b112f0192cf10681c523bbfe9.tar.gz
Merge branch 'master' of github.com:profanity-im/profanity
Diffstat (limited to 'src')
-rw-r--r--src/omemo/omemo.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/omemo/omemo.c b/src/omemo/omemo.c
index 9db8eb69..09782d66 100644
--- a/src/omemo/omemo.c
+++ b/src/omemo/omemo.c
@@ -395,18 +395,20 @@ omemo_start_sessions(void)
 void
 omemo_start_session(const char *const barejid)
 {
-    log_info("OMEMO: start session with %s", barejid);
-    GList *device_list = g_hash_table_lookup(omemo_ctx.device_list, barejid);
-    if (!device_list) {
-        log_info("OMEMO: missing device list for %s", barejid);
-        omemo_devicelist_request(barejid);
-        g_hash_table_insert(omemo_ctx.device_list_handler, strdup(barejid), _handle_device_list_start_session);
-        return;
-    }
+    if( omemo_loaded() ) {
+        log_info("OMEMO: start session with %s", barejid);
+        GList *device_list = g_hash_table_lookup(omemo_ctx.device_list, barejid);
+        if (!device_list) {
+            log_info("OMEMO: missing device list for %s", barejid);
+            omemo_devicelist_request(barejid);
+            g_hash_table_insert(omemo_ctx.device_list_handler, strdup(barejid), _handle_device_list_start_session);
+            return;
+        }
 
-    GList *device_id;
-    for (device_id = device_list; device_id != NULL; device_id = device_id->next) {
-        omemo_bundle_request(barejid, GPOINTER_TO_INT(device_id->data), omemo_start_device_session_handle_bundle, free, strdup(barejid));
+        GList *device_id;
+        for (device_id = device_list; device_id != NULL; device_id = device_id->next) {
+            omemo_bundle_request(barejid, GPOINTER_TO_INT(device_id->data), omemo_start_device_session_handle_bundle, free, strdup(barejid));
+        }
     }
 }