aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-01-10 00:14:37 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-10 00:14:37 +0800
commitbdbc83f39d0a0909d1a4a0c052969f0d6e65d511 (patch)
treed103bcde08a3e8b7c372af8bf7429771f9ba00b9
parent79b680b4ad1161767b7df52fede2fc6d6a6d9dc4 (diff)
downloadgsoc2013-empathy-bdbc83f39d0a0909d1a4a0c052969f0d6e65d511.tar
gsoc2013-empathy-bdbc83f39d0a0909d1a4a0c052969f0d6e65d511.tar.gz
gsoc2013-empathy-bdbc83f39d0a0909d1a4a0c052969f0d6e65d511.tar.bz2
gsoc2013-empathy-bdbc83f39d0a0909d1a4a0c052969f0d6e65d511.tar.lz
gsoc2013-empathy-bdbc83f39d0a0909d1a4a0c052969f0d6e65d511.tar.xz
gsoc2013-empathy-bdbc83f39d0a0909d1a4a0c052969f0d6e65d511.tar.zst
gsoc2013-empathy-bdbc83f39d0a0909d1a4a0c052969f0d6e65d511.zip
Don't initialise variables by calling functions when declaring them
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> svn path=/trunk/; revision=2173
-rw-r--r--libempathy/empathy-dispatcher.c34
1 files changed, 23 insertions, 11 deletions
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,