From 63b5db096a4a8e706bf9d2b7043aa6c9fe5d5697 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 7 Jun 2010 12:24:06 +0200 Subject: dispatch-operation: factor out channel_wrapper_ready --- libempathy/empathy-dispatch-operation.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'libempathy') diff --git a/libempathy/empathy-dispatch-operation.c b/libempathy/empathy-dispatch-operation.c index f6cc0d6ef..68143c55b 100644 --- a/libempathy/empathy-dispatch-operation.c +++ b/libempathy/empathy-dispatch-operation.c @@ -432,6 +432,18 @@ empathy_dispatch_operation_set_status (EmpathyDispatchOperation *self, } } +static void +channel_wrapper_ready (EmpathyDispatchOperation *self) +{ + EmpathyDispatchOperationPriv *priv = GET_PRIV (self); + + g_signal_handler_disconnect (priv->channel_wrapper, priv->ready_handler); + priv->ready_handler = 0; + + empathy_dispatch_operation_set_status (self, + EMPATHY_DISPATCHER_OPERATION_STATE_PENDING); +} + static void empathy_dispatcher_operation_tp_chat_ready_cb (GObject *object, GParamSpec *spec, gpointer user_data) @@ -442,11 +454,7 @@ empathy_dispatcher_operation_tp_chat_ready_cb (GObject *object, if (!empathy_tp_chat_is_ready (EMPATHY_TP_CHAT (priv->channel_wrapper))) return; - g_signal_handler_disconnect (priv->channel_wrapper, priv->ready_handler); - priv->ready_handler = 0; - - empathy_dispatch_operation_set_status (self, - EMPATHY_DISPATCHER_OPERATION_STATE_PENDING); + channel_wrapper_ready (self); } static void -- cgit v1.2.3