diff --git a/gtk-ui.c b/gtk-ui.c index 8988d15..c303575 100644 --- a/gtk-ui.c +++ b/gtk-ui.c @@ -213,7 +213,7 @@ static void generate(GtkWidget *widget, gpointer data) { } // Do we actually have to create both keys at the same time? - long_term_keys_create_privkey_v4(purple_account_to_client_id(account)); + long_term_keys_create_privkey_v4(purple_account_to_otrng_client(account)); long_term_keys_create_private_key_v3(purple_account_to_otrng_client(account)); } diff --git a/long_term_keys.c b/long_term_keys.c index bc46025..0e0d3f2 100644 --- a/long_term_keys.c +++ b/long_term_keys.c @@ -35,15 +35,15 @@ extern otrng_global_state_s *otrng_state; /* Generate a private key for the given accountname/protocol */ -void long_term_keys_create_privkey_v4(const otrng_client_id_s opdata) { - PurpleAccount *account = client_id_to_purple_account(opdata); +void long_term_keys_create_privkey_v4(otrng_client_s *client) { + PurpleAccount *account = client_id_to_purple_account(client->client_id); if (otrng_succeeded(otrng_global_state_generate_private_key( otrng_state, purple_account_to_client_id(account)))) { otrng_ui_update_fingerprint(); } } -static void load_private_key_v4(const otrng_client_id_s opdata) { +static void load_private_key_v4(otrng_client_s *client) { persistance_read_private_keys_v4(otrng_state); } @@ -51,8 +51,8 @@ static void store_private_key_v4(otrng_client_s *client) { persistance_write_privkey_v4_FILEp(otrng_state); } -static void create_forging_key(const otrng_client_id_s opdata) { - otrng_global_state_generate_forging_key(otrng_state, opdata); +static void create_forging_key(otrng_client_s *client) { + otrng_global_state_generate_forging_key(otrng_state, client->client_id); } static void load_forging_key(struct otrng_client_s *client) { diff --git a/long_term_keys.h b/long_term_keys.h index 5abf985..0f7a4c4 100644 --- a/long_term_keys.h +++ b/long_term_keys.h @@ -26,9 +26,9 @@ #include #include -void long_term_keys_load_private_key_v4(const otrng_client_id_s opdata); +void long_term_keys_load_private_key_v4(otrng_client_s *client); -void long_term_keys_create_privkey_v4(const otrng_client_id_s opdata); +void long_term_keys_create_privkey_v4(otrng_client_s *client); void long_term_keys_set_callbacks(otrng_client_callbacks_s *); diff --git a/plugin-all.c b/plugin-all.c index ae54368..2c26301 100644 --- a/plugin-all.c +++ b/plugin-all.c @@ -243,8 +243,8 @@ static void create_privkey_cb(void *opdata, const char *account_name, // This should never happen, so make this an empty callback for now } -static void create_instag_cb(const otrng_client_id_s opdata) { - otrng_plugin_create_instag(client_id_to_purple_account(opdata)); +static void create_instag_cb(otrng_client_s *client) { + otrng_plugin_create_instag(client_id_to_purple_account(client->client_id)); } static int is_logged_in_cb(void *opdata, const char *accountname, @@ -1518,20 +1518,10 @@ get_shared_session_state_cb(const otrng_s *conv) { }; } -static otrng_result -get_account_and_protocol_cb(char **account_name, char **protocol_name, - const otrng_client_id_s client_id) { - *account_name = g_strdup(client_id.account); - *protocol_name = g_strdup(client_id.protocol); - - return OTRNG_SUCCESS; -} - static otrng_client_callbacks_s *otrng_plugin_client_callbacks_new(void) { otrng_client_callbacks_s *cb = otrng_xmalloc_z(sizeof(otrng_client_callbacks_s)); - cb->get_account_and_protocol = get_account_and_protocol_cb; cb->create_instag = create_instag_cb; cb->gone_secure = gone_secure_v4; cb->gone_insecure = gone_insecure_v4; diff --git a/profiles.c b/profiles.c index 679bdc4..8c7458a 100644 --- a/profiles.c +++ b/profiles.c @@ -28,31 +28,27 @@ extern otrng_global_state_s *otrng_state; -static void create_client_profile(otrng_client_s *client, - const otrng_client_id_s opdata) { - otrng_global_state_generate_client_profile(otrng_state, opdata); +static void create_client_profile(otrng_client_s *client) { + otrng_global_state_generate_client_profile(otrng_state, client->client_id); } -static void load_client_profile(const otrng_client_id_s client_opdata) { +static void load_client_profile(otrng_client_s *client) { persistance_read_client_profile(otrng_state); } -static void create_prekey_profile(otrng_client_s *client, - const otrng_client_id_s opdata) { - otrng_global_state_generate_prekey_profile(otrng_state, opdata); +static void create_prekey_profile(otrng_client_s *client) { + otrng_global_state_generate_prekey_profile(otrng_state, client->client_id); } -static void load_prekey_profile(const otrng_client_id_s client_opdata) { +static void load_prekey_profile(otrng_client_s *client) { persistance_read_prekey_profile(otrng_state); } -static void store_client_profile(otrng_client_s *client, - const otrng_client_id_s client_opdata) { +static void store_client_profile(otrng_client_s *client) { persistance_write_client_profile_FILEp(otrng_state); } -static void store_prekey_profile(otrng_client_s *client, - const otrng_client_id_s client_opdata) { +static void store_prekey_profile(otrng_client_s *client) { persistance_write_prekey_profile_FILEp(otrng_state); }