[empathy: 26/35] Hook up abusive argument into TpContactList backend



commit 103b4d5da19bf7ebf648658b8ff0ccab88aa24bd
Author: Danielle Madeley <danielle madeley collabora co uk>
Date:   Mon Feb 14 12:00:56 2011 +1100

    Hook up abusive argument into TpContactList backend

 libempathy-gtk/empathy-contact-dialogs.c |    6 ++++--
 libempathy-gtk/empathy-contact-menu.c    |    6 +++---
 libempathy-gtk/empathy-individual-view.c |    7 +++++--
 libempathy/empathy-contact-list.c        |    5 +++--
 libempathy/empathy-contact-list.h        |    6 ++++--
 libempathy/empathy-contact-manager.c     |    6 ++++--
 libempathy/empathy-individual-manager.c  |    5 +++--
 libempathy/empathy-individual-manager.h  |    3 ++-
 libempathy/empathy-tp-contact-list.c     |    3 ++-
 9 files changed, 30 insertions(+), 17 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c
index 73a458c..737a449 100644
--- a/libempathy-gtk/empathy-contact-dialogs.c
+++ b/libempathy-gtk/empathy-contact-dialogs.c
@@ -85,15 +85,17 @@ subscription_dialog_response_cb (GtkDialog *dialog,
 					     contact, "");
 	}
 	else if (response == GTK_RESPONSE_REJECT) {
+		gboolean abusive;
+
 		/* confirm the blocking */
 		if (empathy_block_contact_dialog_show (GTK_WINDOW (dialog),
-						       contact, NULL)) {
+						       contact, &abusive)) {
 			empathy_contact_list_remove (
 					EMPATHY_CONTACT_LIST (manager),
 					contact, "");
 			empathy_contact_list_set_blocked (
 					EMPATHY_CONTACT_LIST (manager),
-					contact, TRUE);
+					contact, TRUE, abusive);
 		} else {
 			/* if they don't confirm, return back to the
 			 * first dialog */
diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c
index 7f3091a..9f36cf5 100644
--- a/libempathy-gtk/empathy-contact-menu.c
+++ b/libempathy-gtk/empathy-contact-menu.c
@@ -234,7 +234,7 @@ empathy_contact_block_menu_item_toggled (GtkCheckMenuItem *item,
 {
 	static guint block_signal = 0;
 	EmpathyContactManager *manager;
-	gboolean blocked;
+	gboolean blocked, abusive;
 
 	if (block_signal > 0)
 		return;
@@ -252,13 +252,13 @@ empathy_contact_block_menu_item_toggled (GtkCheckMenuItem *item,
 			"window");
 
 		if (!empathy_block_contact_dialog_show (GTK_WINDOW (parent),
-					contact, NULL))
+					contact, &abusive))
 			return;
 	}
 
 	manager = empathy_contact_manager_dup_singleton ();
 	empathy_contact_list_set_blocked (EMPATHY_CONTACT_LIST (manager),
-					  contact, blocked);
+					  contact, blocked, abusive);
 	g_object_unref (manager);
 
 	/* update the toggle with the blocked status */
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index cea55a2..172b1fa 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -2448,11 +2448,14 @@ individual_view_remove_activate_cb (GtkMenuItem *menuitem,
 
       if (res == GTK_RESPONSE_YES || res == GTK_RESPONSE_REJECT)
         {
+          gboolean abusive;
+
           if (res == GTK_RESPONSE_REJECT &&
-              empathy_block_individual_dialog_show (parent, individual, NULL))
+              empathy_block_individual_dialog_show (parent, individual,
+                &abusive))
             {
               empathy_individual_manager_set_blocked (manager, individual,
-                  TRUE);
+                  TRUE, abusive);
             }
           else
             {
diff --git a/libempathy/empathy-contact-list.c b/libempathy/empathy-contact-list.c
index d8af893..d288667 100644
--- a/libempathy/empathy-contact-list.c
+++ b/libempathy/empathy-contact-list.c
@@ -282,12 +282,13 @@ empathy_contact_list_remove_from_favourites (EmpathyContactList *list,
 void
 empathy_contact_list_set_blocked (EmpathyContactList *list,
 				  EmpathyContact     *contact,
-				  gboolean            blocked)
+				  gboolean            blocked,
+				  gboolean            abusive)
 {
 	EmpathyContactListIface *iface = EMPATHY_CONTACT_LIST_GET_IFACE (list);
 
 	if (iface->set_blocked != NULL)
-		iface->set_blocked (list, contact, blocked);
+		iface->set_blocked (list, contact, blocked, abusive);
 }
 
 gboolean
diff --git a/libempathy/empathy-contact-list.h b/libempathy/empathy-contact-list.h
index 8be93ba..cf523bf 100644
--- a/libempathy/empathy-contact-list.h
+++ b/libempathy/empathy-contact-list.h
@@ -81,7 +81,8 @@ struct _EmpathyContactListIface {
 					       EmpathyContact     *contact);
 	void             (*set_blocked)       (EmpathyContactList *list,
 			                       EmpathyContact     *contact,
-					       gboolean            blocked);
+					       gboolean            blocked,
+					       gboolean            abusive);
 	gboolean         (*get_blocked)       (EmpathyContactList *list,
 			                       EmpathyContact     *contact);
 };
@@ -125,7 +126,8 @@ void     empathy_contact_list_remove_from_favourites
 
 void     empathy_contact_list_set_blocked       (EmpathyContactList *list,
 		                                 EmpathyContact     *contact,
-						 gboolean            blocked);
+						 gboolean            blocked,
+						 gboolean            abusive);
 gboolean empathy_contact_list_get_blocked       (EmpathyContactList *list,
 						 EmpathyContact     *contact);
 
diff --git a/libempathy/empathy-contact-manager.c b/libempathy/empathy-contact-manager.c
index 2242159..b00f824 100644
--- a/libempathy/empathy-contact-manager.c
+++ b/libempathy/empathy-contact-manager.c
@@ -867,7 +867,8 @@ contact_manager_remove_group (EmpathyContactList *manager,
 static void
 contact_manager_set_blocked (EmpathyContactList *manager,
 			     EmpathyContact     *contact,
-			     gboolean            blocked)
+			     gboolean            blocked,
+			     gboolean            abusive)
 {
 	EmpathyContactManagerPriv *priv = GET_PRIV (manager);
 	EmpathyContactList        *list;
@@ -879,7 +880,8 @@ contact_manager_set_blocked (EmpathyContactList *manager,
 	list = g_hash_table_lookup (priv->lists, connection);
 
 	if (list != NULL) {
-		empathy_contact_list_set_blocked (list, contact, blocked);
+		empathy_contact_list_set_blocked (list, contact,
+						  blocked, abusive);
 	}
 }
 
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index 71d15bb..d56570c 100644
--- a/libempathy/empathy-individual-manager.c
+++ b/libempathy/empathy-individual-manager.c
@@ -532,7 +532,8 @@ empathy_individual_manager_supports_blocking (EmpathyIndividualManager *self,
 void
 empathy_individual_manager_set_blocked (EmpathyIndividualManager *self,
     FolksIndividual *individual,
-    gboolean blocked)
+    gboolean blocked,
+    gboolean abusive)
 {
   EmpathyIndividualManagerPriv *priv;
   GList *personas, *l;
@@ -558,7 +559,7 @@ empathy_individual_manager_set_blocked (EmpathyIndividualManager *self,
       manager = empathy_contact_manager_dup_singleton ();
       empathy_contact_list_set_blocked (
           EMPATHY_CONTACT_LIST (manager),
-          contact, blocked);
+          contact, blocked, abusive);
 
       g_object_unref (manager);
       g_object_unref (contact);
diff --git a/libempathy/empathy-individual-manager.h b/libempathy/empathy-individual-manager.h
index 75411b4..1fec67d 100644
--- a/libempathy/empathy-individual-manager.h
+++ b/libempathy/empathy-individual-manager.h
@@ -87,7 +87,8 @@ gboolean empathy_individual_manager_supports_blocking (
 
 void empathy_individual_manager_set_blocked (EmpathyIndividualManager *self,
     FolksIndividual *individual,
-    gboolean blocked);
+    gboolean blocked,
+    gboolean abusive);
 
 G_END_DECLS
 #endif /* __EMPATHY_INDIVIDUAL_MANAGER_H__ */
diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c
index ec4f172..9b3383d 100644
--- a/libempathy/empathy-tp-contact-list.c
+++ b/libempathy/empathy-tp-contact-list.c
@@ -1313,7 +1313,8 @@ tp_contact_list_get_flags (EmpathyContactList *list)
 static void
 tp_contact_list_set_blocked (EmpathyContactList *list,
 			     EmpathyContact     *contact,
-			     gboolean            blocked)
+			     gboolean            blocked,
+			     gboolean            abusive)
 {
 	EmpathyTpContactListPriv *priv = GET_PRIV (list);
 	TpHandle handle = empathy_contact_get_handle (contact);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]