diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> | 2011-03-15 20:38:15 -0400 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> | 2011-03-15 20:38:15 -0400 |
commit | 5f674080ff0ddffc1ff08bab24246d5286d09ded (patch) | |
tree | d11ddec1fcb80d81fd9c0cd34a86095e73eff5b9 /telepathy-logger/observer.c | |
parent | 4e8209969d0a67299c5b2ff6beb21d4c482034f1 (diff) | |
download | telepathy-logger-5f674080ff0ddffc1ff08bab24246d5286d09ded.tar.gz |
Change TplChannel into an interface and port
This change will allow TplTextChannel to inherit TpTextChannel, choose
what feature it wants to be prepared. It also slightly change the action
chain API to better fit GAsync normal signature.
Diffstat (limited to 'telepathy-logger/observer.c')
-rw-r--r-- | telepathy-logger/observer.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/telepathy-logger/observer.c b/telepathy-logger/observer.c index a2bd40b..2645e08 100644 --- a/telepathy-logger/observer.c +++ b/telepathy-logger/observer.c @@ -82,7 +82,8 @@ */ static void tpl_observer_dispose (GObject * obj); -static void got_tpl_text_channel_ready_cb (GObject *obj, GAsyncResult *result, +static void channel_prepared_cb (GObject *obj, + GAsyncResult *result, gpointer user_data); static TplChannelFactory tpl_observer_get_channel_factory (TplObserver *self); @@ -181,7 +182,7 @@ tpl_observer_observe_channels (TpBaseClient *client, g_hash_table_insert (self->priv->preparing_channels, (gchar *) tp_proxy_get_object_path (tpl_chan), tpl_chan); - _tpl_channel_call_when_ready (tpl_chan, got_tpl_text_channel_ready_cb, + _tpl_channel_prepare_async (tpl_chan, channel_prepared_cb, observing_ctx); } @@ -227,23 +228,24 @@ _tpl_observer_register_channel (TplObserver *self, return TRUE; } + static void -got_tpl_text_channel_ready_cb (GObject *obj, +channel_prepared_cb (GObject *obj, GAsyncResult *result, gpointer user_data) { ObservingContext *observing_ctx = user_data; - gboolean success = _tpl_action_chain_new_finish (result); + GError *error = NULL; - if (success) + if (_tpl_action_chain_new_finish (obj, result, &error)) { - PATH_DEBUG (obj, "prepared channel"); - + PATH_DEBUG (obj, "channel prepared"); _tpl_observer_register_channel (observing_ctx->self, TPL_CHANNEL (obj)); } else { - PATH_DEBUG (obj, "failed to prepare"); + PATH_DEBUG (obj, "failed to prepare channel: %s", error->message); + g_error_free (error); } g_hash_table_remove (observing_ctx->self->priv->preparing_channels, |