aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-11-03 21:08:29 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-11-08 20:33:27 +0800
commit6104a6ca517210e89d441a44ed720168591c0a4e (patch)
tree9dde7f71cccd2ceac75a3a4c685cc20200d0cdac
parente1cf171b3d8b349c1f92773130c94337076ca30b (diff)
downloadgsoc2013-empathy-6104a6ca517210e89d441a44ed720168591c0a4e.tar
gsoc2013-empathy-6104a6ca517210e89d441a44ed720168591c0a4e.tar.gz
gsoc2013-empathy-6104a6ca517210e89d441a44ed720168591c0a4e.tar.bz2
gsoc2013-empathy-6104a6ca517210e89d441a44ed720168591c0a4e.tar.lz
gsoc2013-empathy-6104a6ca517210e89d441a44ed720168591c0a4e.tar.xz
gsoc2013-empathy-6104a6ca517210e89d441a44ed720168591c0a4e.tar.zst
gsoc2013-empathy-6104a6ca517210e89d441a44ed720168591c0a4e.zip
contact-dialog: stop using EmpathyContactManager
https://bugzilla.gnome.org/show_bug.cgi?id=663327
-rw-r--r--libempathy-gtk/empathy-contact-dialogs.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c
index 130fbc224..0df8df7eb 100644
--- a/libempathy-gtk/empathy-contact-dialogs.c
+++ b/libempathy-gtk/empathy-contact-dialogs.c
@@ -30,8 +30,6 @@
#include <telepathy-glib/account-manager.h>
-#include <libempathy/empathy-contact-manager.h>
-#include <libempathy/empathy-contact-list.h>
#include <libempathy/empathy-tp-contact-factory.h>
#include <libempathy/empathy-utils.h>
@@ -67,22 +65,18 @@ subscription_dialog_response_cb (GtkDialog *dialog,
gint response,
GtkWidget *contact_widget)
{
- EmpathyContactManager *manager;
EmpathyContact *contact;
- manager = empathy_contact_manager_dup_singleton ();
contact = empathy_contact_widget_get_contact (contact_widget);
if (response == GTK_RESPONSE_YES) {
- empathy_contact_list_add (EMPATHY_CONTACT_LIST (manager),
- contact, "");
+ empathy_contact_add_to_contact_list (contact, "");
empathy_contact_set_alias (contact,
empathy_contact_widget_get_alias (contact_widget));
}
else if (response == GTK_RESPONSE_NO) {
- empathy_contact_list_remove (EMPATHY_CONTACT_LIST (manager),
- contact, "");
+ empathy_contact_remove_from_contact_list (contact);
}
else if (response == GTK_RESPONSE_REJECT) {
gboolean abusive;
@@ -92,9 +86,7 @@ subscription_dialog_response_cb (GtkDialog *dialog,
NULL, &abusive)) {
TpContact *tp_contact;
- empathy_contact_list_remove (
- EMPATHY_CONTACT_LIST (manager),
- contact, "");
+ empathy_contact_remove_from_contact_list (contact);
tp_contact = empathy_contact_get_tp_contact (contact);
@@ -102,15 +94,12 @@ subscription_dialog_response_cb (GtkDialog *dialog,
} else {
/* if they don't confirm, return back to the
* first dialog */
- goto finally;
+ return;
}
}
subscription_dialogs = g_list_remove (subscription_dialogs, dialog);
gtk_widget_destroy (GTK_WIDGET (dialog));
-
-finally:
- g_object_unref (manager);
}
void
@@ -394,7 +383,6 @@ can_add_contact_to_account (TpAccount *account,
gpointer callback_data,
gpointer user_data)
{
- EmpathyContactManager *contact_manager;
TpConnection *connection;
gboolean result;
@@ -404,10 +392,7 @@ can_add_contact_to_account (TpAccount *account,
return;
}
- contact_manager = empathy_contact_manager_dup_singleton ();
- result = empathy_contact_manager_get_flags_for_connection (
- contact_manager, connection) & EMPATHY_CONTACT_LIST_CAN_ADD;
- g_object_unref (contact_manager);
+ result = tp_connection_get_can_change_contact_list (connection);
callback (result, callback_data);
}
@@ -417,20 +402,16 @@ new_contact_response_cb (GtkDialog *dialog,
gint response,
GtkWidget *contact_widget)
{
- EmpathyContactManager *manager;
EmpathyContact *contact;
- manager = empathy_contact_manager_dup_singleton ();
contact = empathy_contact_widget_get_contact (contact_widget);
if (contact && response == GTK_RESPONSE_OK) {
- empathy_contact_list_add (EMPATHY_CONTACT_LIST (manager),
- contact, "");
+ empathy_contact_add_to_contact_list (contact, "");
}
new_contact_dialog = NULL;
gtk_widget_destroy (GTK_WIDGET (dialog));
- g_object_unref (manager);
}
void