diff options
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-chat.c | 28 | ||||
-rw-r--r-- | libempathy-gtk/empathy-contact-list-view.c | 2 | ||||
-rw-r--r-- | libempathy-gtk/empathy-contact-menu.c | 3 | ||||
-rw-r--r-- | libempathy-gtk/empathy-individual-menu.c | 3 | ||||
-rw-r--r-- | libempathy-gtk/empathy-individual-view.c | 2 | ||||
-rw-r--r-- | libempathy-gtk/empathy-new-message-dialog.c | 10 |
6 files changed, 19 insertions, 29 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index dd140587c..71fb2e880 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -228,18 +228,11 @@ chat_set_property (GObject *object, } static void -reconnected_connection_ready_cb (TpConnection *connection, - const GError *error, - gpointer user_data) +account_reconnected (EmpathyChat *chat, + TpAccount *account) { - EmpathyChat *chat = user_data; EmpathyChatPriv *priv = GET_PRIV (chat); - if (error != NULL) { - DEBUG ("connection is not ready: %s", error->message); - goto out; - } - DEBUG ("Account reconnected, request a new Text channel"); /* FIXME: Ideally we should ask to handle ourself the channel so we can @@ -248,12 +241,11 @@ reconnected_connection_ready_cb (TpConnection *connection, switch (priv->handle_type) { case TP_HANDLE_TYPE_CONTACT: empathy_dispatcher_chat_with_contact_id ( - connection, priv->id, EMPATHY_DISPATCHER_NON_USER_ACTION, - NULL, NULL); + account, priv->id, EMPATHY_DISPATCHER_NON_USER_ACTION); break; case TP_HANDLE_TYPE_ROOM: - empathy_dispatcher_join_muc (connection, - priv->id, EMPATHY_DISPATCHER_NON_USER_ACTION); + empathy_dispatcher_join_muc (account, priv->id, + EMPATHY_DISPATCHER_NON_USER_ACTION); break; case TP_HANDLE_TYPE_NONE: case TP_HANDLE_TYPE_LIST: @@ -263,7 +255,6 @@ reconnected_connection_ready_cb (TpConnection *connection, break; } -out: g_object_unref (chat); } @@ -290,8 +281,8 @@ chat_new_connection_cb (TpAccount *account, return; g_object_ref (chat); - tp_connection_call_when_ready (connection, reconnected_connection_ready_cb, - chat); + + account_reconnected (chat, account); } static void @@ -719,8 +710,9 @@ chat_command_join (EmpathyChat *chat, TpConnection *connection; connection = empathy_tp_chat_get_connection (priv->tp_chat); - empathy_dispatcher_join_muc (connection, rooms[i], - gtk_get_current_event_time ()); + empathy_dispatcher_join_muc ( + empathy_get_account_for_connection (connection), rooms[i], + gtk_get_current_event_time ()); } i++; } diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c index f36718c83..ce586420e 100644 --- a/libempathy-gtk/empathy-contact-list-view.c +++ b/libempathy-gtk/empathy-contact-list-view.c @@ -892,7 +892,7 @@ contact_list_view_row_activated (GtkTreeView *view, if (contact) { DEBUG ("Starting a chat"); empathy_dispatcher_chat_with_contact (contact, - gtk_get_current_event_time (), NULL, NULL); + gtk_get_current_event_time ()); g_object_unref (contact); } } diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c index a75fe8fab..651622554 100644 --- a/libempathy-gtk/empathy-contact-menu.c +++ b/libempathy-gtk/empathy-contact-menu.c @@ -216,8 +216,7 @@ static void empathy_contact_chat_menu_item_activated (GtkMenuItem *item, EmpathyContact *contact) { - empathy_dispatcher_chat_with_contact (contact, gtk_get_current_event_time (), - NULL, NULL); + empathy_dispatcher_chat_with_contact (contact, gtk_get_current_event_time ()); } GtkWidget * diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c index c3edf06c7..092208b61 100644 --- a/libempathy-gtk/empathy-individual-menu.c +++ b/libempathy-gtk/empathy-individual-menu.c @@ -245,8 +245,7 @@ empathy_individual_chat_menu_item_activated (GtkMenuItem *item, g_return_if_fail (contact != NULL); - empathy_dispatcher_chat_with_contact (contact, gtk_get_current_event_time (), - NULL, NULL); + empathy_dispatcher_chat_with_contact (contact, gtk_get_current_event_time ()); g_object_unref (contact); } diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c index 83811750b..716886dbc 100644 --- a/libempathy-gtk/empathy-individual-view.c +++ b/libempathy-gtk/empathy-individual-view.c @@ -925,7 +925,7 @@ individual_view_row_activated (GtkTreeView *view, DEBUG ("Starting a chat"); empathy_dispatcher_chat_with_contact (contact, - gtk_get_current_event_time (), NULL, NULL); + gtk_get_current_event_time ()); } g_object_unref (individual); diff --git a/libempathy-gtk/empathy-new-message-dialog.c b/libempathy-gtk/empathy-new-message-dialog.c index 21480a787..a17481437 100644 --- a/libempathy-gtk/empathy-new-message-dialog.c +++ b/libempathy-gtk/empathy-new-message-dialog.c @@ -60,18 +60,18 @@ G_DEFINE_TYPE(EmpathyNewMessageDialog, empathy_new_message_dialog, static void empathy_new_message_dialog_response (GtkDialog *dialog, int response_id) { - TpConnection *connection; + TpAccount *account; const gchar *contact_id; if (response_id != GTK_RESPONSE_ACCEPT) goto out; contact_id = empathy_contact_selector_dialog_get_selected ( - EMPATHY_CONTACT_SELECTOR_DIALOG (dialog), &connection, NULL); + EMPATHY_CONTACT_SELECTOR_DIALOG (dialog), NULL, &account); - if (EMP_STR_EMPTY (contact_id) || connection == NULL) goto out; + if (EMP_STR_EMPTY (contact_id) || account == NULL) goto out; - empathy_dispatcher_chat_with_contact_id (connection, contact_id, - gtk_get_current_event_time (), NULL, NULL); + empathy_dispatcher_chat_with_contact_id (account, contact_id, + gtk_get_current_event_time ()); out: gtk_widget_destroy (GTK_WIDGET (dialog)); |