Remove OMEMO session when untrusting a fingerprint

We have to store known_devices in a long term fashion otherwise we might
not be able to delete session if it is remove from device list server
side.
This commit is contained in:
Paul Fariello
2019-06-07 21:00:32 +02:00
parent 172436a83f
commit 5731a7c472
2 changed files with 122 additions and 16 deletions

View File

@@ -148,7 +148,14 @@ delete_session(const signal_protocol_address *address, void *user_data)
return SG_SUCCESS;
}
return g_hash_table_remove(device_store, GINT_TO_POINTER(address->device_id));
g_hash_table_remove(device_store, GINT_TO_POINTER(address->device_id));
char *device_id_str = g_strdup_printf("%d", address->device_id);
g_key_file_remove_key(omemo_sessions_keyfile(), address->name, device_id_str, NULL);
g_free(device_id_str);
omemo_sessions_keyfile_save();
return SG_SUCCESS;
}
int