[evolution-data-server] Handle quota error messages.



commit ce9cda710a1baadaa9d7a5520d0fc6940db7f6e5
Author: Chenthill Palanisamy <pchenthill novell com>
Date:   Tue Jul 14 13:33:35 2009 +0530

    Handle quota error messages.

 .../backends/groupwise/e-cal-backend-groupwise.c   |   14 +++++++++++---
 servers/groupwise/e-gw-connection.c                |    2 +-
 servers/groupwise/e-gw-connection.h                |    3 ++-
 3 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/calendar/backends/groupwise/e-cal-backend-groupwise.c b/calendar/backends/groupwise/e-cal-backend-groupwise.c
index 1a0394c..86be730 100644
--- a/calendar/backends/groupwise/e-cal-backend-groupwise.c
+++ b/calendar/backends/groupwise/e-cal-backend-groupwise.c
@@ -2054,6 +2054,8 @@ e_cal_backend_groupwise_create_object (ECalBackendSync *backend, EDataCal *cal,
 
 			if (status == E_GW_CONNECTION_STATUS_UNKNOWN_USER)
 				return GNOME_Evolution_Calendar_UnknownUser;
+			else if (status == E_GW_CONNECTION_STATUS_OVER_QUOTA)
+				return GNOME_Evolution_Calendar_PermissionDenied;
 			else
 				return GNOME_Evolution_Calendar_OtherError;
 		}
@@ -2068,7 +2070,7 @@ e_cal_backend_groupwise_create_object (ECalBackendSync *backend, EDataCal *cal,
 		/* Get the item back from server to update the last-modified time */
 		status = update_from_server (cbgw, uid_list, calobj, comp);
 		if (status != E_GW_CONNECTION_STATUS_OK)
-			return GNOME_Evolution_Calendar_OtherError;
+			return GNOME_Evolution_Calendar_OtherError; 
 
 		break;
 	default :
@@ -2209,6 +2211,10 @@ e_cal_backend_groupwise_modify_object (ECalBackendSync *backend, EDataCal *cal,
 					g_object_unref (comp);
 					g_object_unref (cache_comp);
 					g_free (rid);
+
+					if (status == E_GW_CONNECTION_STATUS_OVER_QUOTA)
+						return GNOME_Evolution_Calendar_PermissionDenied;
+
 					return GNOME_Evolution_Calendar_OtherError;
 				}
 				e_cal_backend_cache_put_component (priv->cache, comp);
@@ -2627,10 +2633,12 @@ receive_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalco
 
 	}
 
+	g_object_unref (comp);
 	if (status == E_GW_CONNECTION_STATUS_INVALID_OBJECT) {
-		g_object_unref (comp);
 		return  GNOME_Evolution_Calendar_InvalidObject;
-	}
+	} else if (status == E_GW_CONNECTION_STATUS_OVER_QUOTA)
+		return GNOME_Evolution_Calendar_PermissionDenied;
+
 	return GNOME_Evolution_Calendar_OtherError;
 }
 
diff --git a/servers/groupwise/e-gw-connection.c b/servers/groupwise/e-gw-connection.c
index ca15da1..028b63e 100644
--- a/servers/groupwise/e-gw-connection.c
+++ b/servers/groupwise/e-gw-connection.c
@@ -207,7 +207,7 @@ e_gw_connection_parse_response_status (SoupSoapResponse *response)
 	case 59923: return E_GW_CONNECTION_STATUS_REDIRECT;
 	case 53530: return E_GW_CONNECTION_STATUS_OTHER;
 	/* FIXME: 58652 should be changed with an enum.*/
-	case 58652: return 58652;
+	case 58652: return E_GW_CONNECTION_STATUS_OVER_QUOTA;
 	case 59922: return 59922; /*Very big attachment, get in chunks*/
 		/* FIXME: map all error codes */
 	}
diff --git a/servers/groupwise/e-gw-connection.h b/servers/groupwise/e-gw-connection.h
index ea5394f..7bebdc3 100644
--- a/servers/groupwise/e-gw-connection.h
+++ b/servers/groupwise/e-gw-connection.h
@@ -87,7 +87,8 @@ typedef enum {
 	E_GW_CONNECTION_STATUS_REDIRECT,
 	E_GW_CONNECTION_STATUS_OTHER,
 	E_GW_CONNECTION_STATUS_UNKNOWN,
-	E_GW_CONNECTION_STATUS_INVALID_PASSWORD = 53273
+	E_GW_CONNECTION_STATUS_INVALID_PASSWORD = 53273,
+	E_GW_CONNECTION_STATUS_OVER_QUOTA = 58652
 } EGwConnectionStatus;
 
 #define E_GW_CURSOR_POSITION_CURRENT "current"



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