diff options
author | Sushma Rai <rsushma@src.gnome.org> | 2006-07-22 17:09:20 +0800 |
---|---|---|
committer | Sushma Rai <rsushma@src.gnome.org> | 2006-07-22 17:09:20 +0800 |
commit | 55675f968d10d5c11db24286e4f8a315e616f00f (patch) | |
tree | ffc6648701d8248587541cb74ee5d0e20cd8dfd5 /plugins/exchange-operations/exchange-folder-subscription.c | |
parent | 17e5226c6092aa230a72058ac56a2a9a13e1c7cb (diff) | |
download | gsoc2013-evolution-55675f968d10d5c11db24286e4f8a315e616f00f.tar.gz gsoc2013-evolution-55675f968d10d5c11db24286e4f8a315e616f00f.tar.zst gsoc2013-evolution-55675f968d10d5c11db24286e4f8a315e616f00f.zip |
Checking if a user is subscribing to his own folder. Fixes #311322.
Patch submitted by "Vandana Shenoy .B <shvandana@novell.com>"
svn path=/trunk/; revision=32374
Diffstat (limited to 'plugins/exchange-operations/exchange-folder-subscription.c')
-rw-r--r-- | plugins/exchange-operations/exchange-folder-subscription.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/exchange-operations/exchange-folder-subscription.c b/plugins/exchange-operations/exchange-folder-subscription.c index 122366d9fb..2c75af875b 100644 --- a/plugins/exchange-operations/exchange-folder-subscription.c +++ b/plugins/exchange-operations/exchange-folder-subscription.c @@ -189,6 +189,7 @@ subscribe_to_folder (GtkWidget *dialog, gint response, gpointer data) { SubscriptionInfo *subscription_info = data; gchar *user_email_address = NULL, *folder_name = NULL, *path = NULL; + char *subscriber_email; EFolder *folder = NULL; EDestinationStore *destination_store; GList *destinations; @@ -213,6 +214,18 @@ subscribe_to_folder (GtkWidget *dialog, gint response, gpointer data) if (user_email_address != NULL && *user_email_address != '\0') break; + /* check if user is trying to subscribe to his own folder */ + subscriber_email = exchange_account_get_email_id (subscription_info->account); + if (subscriber_email != NULL && *subscriber_email != '\0') { + if (g_str_equal (subscriber_email, user_email_address)) { + e_error_run (NULL, ERROR_DOMAIN ":folder-exists-error", NULL); + g_free (user_email_address); + gtk_widget_destroy (dialog); + destroy_subscription_info (subscription_info); + return; + } + } + /* It would be nice to insensitivize the OK button appropriately instead of doing this, but unfortunately we can't do this for the Bonobo control. */ |