From bdbc83f39d0a0909d1a4a0c052969f0d6e65d511 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Fri, 9 Jan 2009 16:14:37 +0000 Subject: Don't initialise variables by calling functions when declaring them Signed-off-by: Sjoerd Simons svn path=/trunk/; revision=2173 --- libempathy/empathy-dispatcher.c | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'libempathy') diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c index 986213cd8..7ea3515ea 100644 --- a/libempathy/empathy-dispatcher.c +++ b/libempathy/empathy-dispatcher.c @@ -1045,14 +1045,20 @@ void empathy_dispatcher_chat_with_contact (EmpathyContact *contact, EmpathyDispatcherRequestCb *callback, gpointer user_data) { - EmpathyDispatcher *dispatcher = empathy_get_dispatcher(); - EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher); - McAccount *account = empathy_contact_get_account (contact); - TpConnection *connection = g_hash_table_lookup (priv->accounts, account); - ConnectionData *connection_data = - g_hash_table_lookup (priv->connections, connection); + EmpathyDispatcher *dispatcher; + EmpathyDispatcherPriv *priv; + McAccount *account; + TpConnection *connection; + ConnectionData *connection_data; DispatcherRequestData *request_data; + dispatcher = empathy_get_dispatcher(); + priv = GET_PRIV (dispatcher); + + account = empathy_contact_get_account (contact); + connection = g_hash_table_lookup (priv->accounts, account); + connection_data = g_hash_table_lookup (priv->connections, connection); + /* The contact handle might not be known yet */ request_data = new_dispatcher_request_data (dispatcher, connection, TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_CONTACT, 0, NULL, @@ -1122,14 +1128,20 @@ void empathy_dispatcher_join_muc (McAccount *account, const gchar *roomname, EmpathyDispatcherRequestCb *callback, gpointer user_data) { - EmpathyDispatcher *dispatcher = empathy_get_dispatcher(); - EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher); + EmpathyDispatcher *dispatcher; + EmpathyDispatcherPriv *priv; DispatcherRequestData *request_data; - TpConnection *connection = g_hash_table_lookup (priv->accounts, account); - ConnectionData *connection_data = - g_hash_table_lookup (priv->connections, connection); + TpConnection *connection; + ConnectionData *connection_data; const gchar *names[] = { roomname, NULL }; + dispatcher = empathy_get_dispatcher(); + priv = GET_PRIV (dispatcher); + + connection = g_hash_table_lookup (priv->accounts, account); + connection_data = g_hash_table_lookup (priv->connections, connection); + + /* Don't know the room handle yet */ request_data = new_dispatcher_request_data (dispatcher, connection, TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_ROOM, 0, NULL, -- cgit v1.2.3