1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Merge pull request #1387 from DebXWoody/bugfix/1332-omemo

Request Device and Key, when OMEMO is in use
This commit is contained in:
Michael Vetter 2020-07-04 17:41:20 +02:00 committed by GitHub
commit 193282a4fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -396,18 +396,20 @@ omemo_start_sessions(void)
void void
omemo_start_session(const char *const barejid) omemo_start_session(const char *const barejid)
{ {
log_info("OMEMO: start session with %s", barejid); if( omemo_loaded() ) {
GList *device_list = g_hash_table_lookup(omemo_ctx.device_list, barejid); log_info("OMEMO: start session with %s", barejid);
if (!device_list) { GList *device_list = g_hash_table_lookup(omemo_ctx.device_list, barejid);
log_info("OMEMO: missing device list for %s", barejid); if (!device_list) {
omemo_devicelist_request(barejid); log_info("OMEMO: missing device list for %s", barejid);
g_hash_table_insert(omemo_ctx.device_list_handler, strdup(barejid), _handle_device_list_start_session); omemo_devicelist_request(barejid);
return; g_hash_table_insert(omemo_ctx.device_list_handler, strdup(barejid), _handle_device_list_start_session);
} return;
}
GList *device_id; GList *device_id;
for (device_id = device_list; device_id != NULL; device_id = device_id->next) { 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)); omemo_bundle_request(barejid, GPOINTER_TO_INT(device_id->data), omemo_start_device_session_handle_bundle, free, strdup(barejid));
}
} }
} }