Skip to content

Commit

Permalink
Merge pull request #1887 from profanity-im/fix-omemo-keyfile-loading
Browse files Browse the repository at this point in the history
Fix OMEMO keyfile loading
  • Loading branch information
jubalh authored Sep 11, 2023
2 parents 394c935 + 5b6b513 commit 0de0594
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/omemo/omemo.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,24 +230,22 @@ omemo_on_connect(ProfAccount* account)
return;
}

if (!load_custom_keyfile(&omemo_ctx.identity, g_strdup_printf("%s/%s", omemo_dir, "identity.txt")) || !_load_identity()) {
return;
if (load_custom_keyfile(&omemo_ctx.identity, g_strdup_printf("%s/%s", omemo_dir, "identity.txt"))) {
if (!_load_identity())
return;
}

if (!load_custom_keyfile(&omemo_ctx.trust, g_strdup_printf("%s/%s", omemo_dir, "trust.txt"))) {
return;
if (load_custom_keyfile(&omemo_ctx.trust, g_strdup_printf("%s/%s", omemo_dir, "trust.txt"))) {
_load_trust();
}
_load_trust();

if (!load_custom_keyfile(&omemo_ctx.sessions, g_strdup_printf("%s/%s", omemo_dir, "sessions.txt"))) {
return;
if (load_custom_keyfile(&omemo_ctx.sessions, g_strdup_printf("%s/%s", omemo_dir, "sessions.txt"))) {
_load_sessions();
}
_load_sessions();

if (!load_custom_keyfile(&omemo_ctx.knowndevices, g_strdup_printf("%s/%s", omemo_dir, "known_devices.txt"))) {
return;
if (load_custom_keyfile(&omemo_ctx.knowndevices, g_strdup_printf("%s/%s", omemo_dir, "known_devices.txt"))) {
_load_known_devices();
}
_load_known_devices();

omemo_devicelist_subscribe();
}
Expand Down

0 comments on commit 0de0594

Please sign in to comment.