diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-07-15 13:54:48 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-07-15 16:21:03 +0100 |
commit | e55ca1dfecc1afa60edfc90773217d696b00a8e1 (patch) | |
tree | 5f5182a0a234a880bd1e51d5225e193306f7e71a /src/protocol.c | |
parent | e1f0266cdedfa2e42cda937c2c80ef752a90188c (diff) | |
download | telepathy-haze-e55ca1dfecc1afa60edfc90773217d696b00a8e1.tar.gz |
haze_protocol_translate_parameters: split out of haze_protocol_new_connection
Diffstat (limited to 'src/protocol.c')
-rw-r--r-- | src/protocol.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/protocol.c b/src/protocol.c index 8603d97..09eb463 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -523,19 +523,16 @@ haze_protocol_init (HazeProtocol *self) HazeProtocolPrivate); } -static TpBaseConnection * -haze_protocol_new_connection (TpBaseProtocol *base, - GHashTable *asv, - GError **error) +static GHashTable * +haze_protocol_translate_parameters (HazeProtocol *self, + GHashTable *asv) { - HazeProtocol *self = HAZE_PROTOCOL (base); GHashTable *unused = g_hash_table_new (g_str_hash, g_str_equal); GHashTable *purple_params = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); - const TpCMParamSpec *pspecs = haze_protocol_get_parameters (base); + const TpCMParamSpec *pspecs = haze_protocol_get_parameters ( + (TpBaseProtocol *) self); const TpCMParamSpec *pspec; - HazeConnection *conn; - gchar *name; tp_g_hash_table_update (unused, asv, NULL, NULL); @@ -559,6 +556,19 @@ haze_protocol_new_connection (TpBaseProtocol *base, g_assert (g_hash_table_size (unused) == 0); g_hash_table_unref (unused); + return purple_params; +} + +static TpBaseConnection * +haze_protocol_new_connection (TpBaseProtocol *base, + GHashTable *asv, + GError **error) +{ + HazeProtocol *self = HAZE_PROTOCOL (base); + HazeConnection *conn; + gchar *name; + GHashTable *purple_params = haze_protocol_translate_parameters (self, asv); + g_object_get (self, "name", &name, NULL); |