aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy')
-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,