[evolution-patches] Exchange connector: patch for #72389
- From: Sushma Rai <rsushma novell com>
- To: Evolution Patches List <evolution-patches lists ximian com>
- Cc: Sarfraaz Ahmed <asarfraaz novell com>
- Subject: [evolution-patches] Exchange connector: patch for #72389
- Date: Tue, 08 Mar 2005 15:15:41 +0530
Hi,
This patch fixes the problem of displaying quota warnings always,
whenever some quota limits are set for the user, even if he is
not exceeding the quota.
Please review,
-Sushma.
Index: lib/e2k-global-catalog.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/lib/e2k-global-catalog.c,v
retrieving revision 1.7
diff -u -p -r1.7 e2k-global-catalog.c
--- lib/e2k-global-catalog.c 4 Nov 2004 08:37:46 -0000 1.7
+++ lib/e2k-global-catalog.c 8 Mar 2005 09:30:45 -0000
@@ -617,30 +617,43 @@ static void
get_quota_values (E2kGlobalCatalog *gc, E2kOperation *op,
LDAPMessage *msg, E2kGlobalCatalogEntry *entry)
{
- char **values;
+ char **quota_setting_values, **quota_limit_values;
- values = ldap_get_values (gc->priv->ldap, msg, "mDBStorageQuota");
- if (values) {
- entry->quota_warn = atoi(values[0]);
- E2K_GC_DEBUG_MSG(("GC: mDBStorageQuota %s\n", values[0]));
- entry->mask |= E2K_GLOBAL_CATALOG_LOOKUP_QUOTA;
- ldap_value_free (values);
+ /* Check if mailbox store default values are used */
+ quota_setting_values = ldap_get_values (gc->priv->ldap, msg, "mDBUseDefaults");
+ if (!quota_setting_values) {
+ entry->quota_warn = entry->quota_nosend = entry->quota_norecv = 0;
+ return;
}
- values = ldap_get_values (gc->priv->ldap, msg, "mDBOverQuotaLimit");
- if (values) {
- entry->quota_nosend = atoi(values[0]);
- E2K_GC_DEBUG_MSG(("GC: mDBOverQuotaLimit %s\n", values[0]));
- entry->mask |= E2K_GLOBAL_CATALOG_LOOKUP_QUOTA;
- ldap_value_free (values);
- }
+ entry->mask |= E2K_GLOBAL_CATALOG_LOOKUP_QUOTA;
+ E2K_GC_DEBUG_MSG(("GC: mDBUseDefaults %s\n", quota_setting_values[0]));
- values = ldap_get_values (gc->priv->ldap, msg, "mDBOverHardQuotaLimit");
- if (values) {
- entry->quota_norecv = atoi(values[0]);
- E2K_GC_DEBUG_MSG(("GC: mDBHardQuotaLimit %s\n", values[0]));
- entry->mask |= E2K_GLOBAL_CATALOG_LOOKUP_QUOTA;
- ldap_value_free (values);
+ if (!strcmp (quota_setting_values[0], "TRUE")) {
+ /* use global mailbox store settings */
+ E2K_GC_DEBUG_MSG(("GC: Using global mailbox store limits\n"));
+ }
+ ldap_value_free (quota_setting_values);
+
+ quota_limit_values = ldap_get_values (gc->priv->ldap, msg, "mDBStorageQuota");
+ if (quota_limit_values) {
+ entry->quota_warn = atoi(quota_limit_values[0]);
+ E2K_GC_DEBUG_MSG(("GC: mDBStorageQuota %s\n", quota_limit_values[0]));
+ ldap_value_free (quota_limit_values);
+ }
+
+ quota_limit_values = ldap_get_values (gc->priv->ldap, msg, "mDBOverQuotaLimit");
+ if (quota_limit_values) {
+ entry->quota_nosend = atoi(quota_limit_values[0]);
+ E2K_GC_DEBUG_MSG(("GC: mDBOverQuotaLimit %s\n", quota_limit_values[0]));
+ ldap_value_free (quota_limit_values);
+ }
+
+ quota_limit_values = ldap_get_values (gc->priv->ldap, msg, "mDBOverHardQuotaLimit");
+ if (quota_limit_values) {
+ entry->quota_norecv = atoi(quota_limit_values[0]);
+ E2K_GC_DEBUG_MSG(("GC: mDBHardQuotaLimit %s\n", quota_limit_values[0]));
+ ldap_value_free (quota_limit_values);
}
}
@@ -732,6 +745,7 @@ e2k_global_catalog_lookup (E2kGlobalCata
if (lookup_flags & E2K_GLOBAL_CATALOG_LOOKUP_DELEGATORS)
g_ptr_array_add (attrs, "publicDelegatesBL");
if (lookup_flags & E2K_GLOBAL_CATALOG_LOOKUP_QUOTA) {
+ g_ptr_array_add (attrs, "mDBUseDefaults");
g_ptr_array_add (attrs, "mDBStorageQuota");
g_ptr_array_add (attrs, "mDBOverQuotaLimit");
g_ptr_array_add (attrs, "mDBOverHardQuotaLimit");
Index: storage/exchange-account.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/storage/exchange-account.c,v
retrieving revision 1.37
diff -u -p -r1.37 exchange-account.c
--- storage/exchange-account.c 7 Mar 2005 05:35:05 -0000 1.37
+++ storage/exchange-account.c 8 Mar 2005 09:30:55 -0000
@@ -1237,11 +1237,15 @@ setup_account_hierarchies (ExchangeAccou
return FALSE;
}
+ account->mbox_size = exchange_hierarchy_webdav_get_total_folder_size (
+ EXCHANGE_HIERARCHY_WEBDAV (personal_hier));
+
fresult = exchange_hierarchy_scan_subtree (
account->priv->favorites_hierarchy,
account->priv->favorites_hierarchy->toplevel,
(offline == OFFLINE_MODE));
- if (fresult != EXCHANGE_ACCOUNT_FOLDER_OK) {
+ if (fresult != EXCHANGE_ACCOUNT_FOLDER_OK &&
+ fresult != EXCHANGE_ACCOUNT_FOLDER_DOES_NOT_EXIST) {
account->priv->connecting = FALSE;
return FALSE;
}
@@ -1472,7 +1476,7 @@ exchange_account_connect (ExchangeAccoun
if (!setup_account_hierarchies (account))
return NULL;
-
+
/* Find the password expiery peripod and display warning */
find_passwd_exp_period(account, entry);
@@ -1484,14 +1488,18 @@ exchange_account_connect (ExchangeAccoun
E2K_GLOBAL_CATALOG_LOOKUP_QUOTA,
&entry);
e2k_operation_free (&gcop);
-
+
+ /* FIXME: quota warnings are not yet marked for translation!! */
+ /* FIXME: warning message should have quota limit value and optionally current
+ * usage
+ */
if (gcstatus == E2K_GLOBAL_CATALOG_OK) {
- if (entry->quota_norecv) {
+ if (entry->quota_norecv && account->mbox_size >= entry->quota_norecv) {
quota_msg = g_strdup_printf ("You have exceeded your quota for storing mails on this server. Your current usage is : %d . You will not be able to either send or recieve mails now\n", entry->quota_norecv);
- } else if (entry->quota_nosend) {
+ } else if (entry->quota_nosend && account->mbox_size >= entry->quota_nosend) {
quota_msg = g_strdup_printf ("You are nearing your quota available for storing mails on this server. Your current usage is : %d . You will not be able to send mails till you clear up some space by deleting some mails.\n", entry->quota_nosend);
- } else if (entry->quota_warn) {
+ } else if (entry->quota_warn && account->mbox_size >= entry->quota_warn) {
quota_msg = g_strdup_printf ("You are nearing your quota available for storing mails on this server. Your current usage is : %d . Try to clear up some space by deleting some mails.\n", entry->quota_warn);
}
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-exchange/ChangeLog,v
retrieving revision 1.284
diff -u -p -r1.284 ChangeLog
--- ChangeLog 7 Mar 2005 05:35:05 -0000 1.284
+++ ChangeLog 8 Mar 2005 09:31:05 -0000
@@ -1,3 +1,17 @@
+2005-03-08 Sushma Rai <rsushma novell com>
+
+ * lib/e2k-global-catalog.c (get_quota_values): Reading "mDBUseDefaults"
+ attribute to check if the user level quota settings are enabled or
+ not.
+ (e2k_global_catalog_lookup): Added "mDBUseDefaults" attributed to quota
+ attributes list.
+
+ * storage/exchange-account.c (setup_account_hierarchies): Reading total
+ size for all the personal folders. Not returining "FALSE" in case no
+ favorite folders exists. Not an error condition.
+ (exchange_account_connect): Printing the quota warning, only if user's
+ mail box size exceeds the quota limit set. Fixes #72389
+
2005-03-07 Sushma Rai <rsushma novell com>
* storage/exchange-account.c (exchange_account_new): Setting the
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]