]> git.0d.be Git - empathy.git/commitdiff
Add block confirmation to the authorise publication dialog
authorDanielle Madeley <danielle.madeley@collabora.co.uk>
Fri, 11 Feb 2011 04:27:05 +0000 (15:27 +1100)
committerChandni Verma <chandniverma2112@gmail.com>
Tue, 8 Mar 2011 04:04:56 +0000 (09:34 +0530)
libempathy-gtk/empathy-contact-dialogs.c

index 8408ed6ca69109364027f195580730d9af711841..73a458cb9e83c5e960bdf779c0f429714b17123d 100644 (file)
@@ -80,19 +80,31 @@ subscription_dialog_response_cb (GtkDialog *dialog,
                empathy_contact_set_alias (contact,
                        empathy_contact_widget_get_alias (contact_widget));
        }
-       else if (response == GTK_RESPONSE_NO ||
-                response == GTK_RESPONSE_REJECT) {
+       else if (response == GTK_RESPONSE_NO) {
                empathy_contact_list_remove (EMPATHY_CONTACT_LIST (manager),
                                             contact, "");
-
-               if (response == GTK_RESPONSE_REJECT) {
+       }
+       else if (response == GTK_RESPONSE_REJECT) {
+               /* confirm the blocking */
+               if (empathy_block_contact_dialog_show (GTK_WINDOW (dialog),
+                                                      contact, NULL)) {
+                       empathy_contact_list_remove (
+                                       EMPATHY_CONTACT_LIST (manager),
+                                       contact, "");
                        empathy_contact_list_set_blocked (
-                               EMPATHY_CONTACT_LIST (manager), contact, TRUE);
+                                       EMPATHY_CONTACT_LIST (manager),
+                                       contact, TRUE);
+               } else {
+                       /* if they don't confirm, return back to the
+                        * first dialog */
+                       goto finally;
                }
        }
 
        subscription_dialogs = g_list_remove (subscription_dialogs, dialog);
        gtk_widget_destroy (GTK_WIDGET (dialog));
+
+finally:
        g_object_unref (manager);
 }