summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarish Krishnaswamy <kharish@novell.com>2005-02-28 12:54:53 +0000
committerChenthill Palanisamy <pchen@src.gnome.org>2005-02-28 12:54:53 +0000
commit8e4d558538e914e1b68d82dce21d303dc4262cf9 (patch)
treeeeb98264fe19e74957da800e2903328af055e935
parent46cbd746fd7064d1ff5601e7e82ea99e53b1796a (diff)
downloadevolution-data-server-8e4d558538e914e1b68d82dce21d303dc4262cf9.tar.gz
Fixes #72662
2005-02-28 Harish Krishnaswamy <kharish@novell.com> Fixes #72662 * camel-groupwise-folder.c: (groupwise_refresh_info): * camel-groupwise-store.c: (groupwise_get_folder): Use the timestamp from the summary as argument to the getQuickMessagesRequest. * camel-groupwise-summary.[ch] (gw_summary_header_load), (gw_summary_header_save): read/write the timestamp returned by the getQuickMessages 'New' request into/from the gw summary.
-rw-r--r--camel/providers/groupwise/ChangeLog10
-rw-r--r--camel/providers/groupwise/camel-groupwise-folder.c10
-rw-r--r--camel/providers/groupwise/camel-groupwise-store.c36
-rw-r--r--camel/providers/groupwise/camel-groupwise-summary.c3
-rw-r--r--camel/providers/groupwise/camel-groupwise-summary.h1
5 files changed, 38 insertions, 22 deletions
diff --git a/camel/providers/groupwise/ChangeLog b/camel/providers/groupwise/ChangeLog
index ab97fc699..cdf201e24 100644
--- a/camel/providers/groupwise/ChangeLog
+++ b/camel/providers/groupwise/ChangeLog
@@ -1,3 +1,13 @@
+2005-02-28 Harish Krishnaswamy <kharish@novell.com>
+
+ * camel-groupwise-folder.c: (groupwise_refresh_info):
+ * camel-groupwise-store.c: (groupwise_get_folder):
+ Use the timestamp from the summary as argument to the
+ getQuickMessagesRequest.
+ * camel-groupwise-summary.[ch] (gw_summary_header_load),
+ (gw_summary_header_save): read/write the timestamp returned
+ by the getQuickMessages 'New' request into/from the gw summary.
+
2005-02-28 Sankar P <psankar@novell.com>
* camel-groupwise-utils.c: (camel_groupwise_util_item_from_message):
diff --git a/camel/providers/groupwise/camel-groupwise-folder.c b/camel/providers/groupwise/camel-groupwise-folder.c
index 5e043e673..2cec0328d 100644
--- a/camel/providers/groupwise/camel-groupwise-folder.c
+++ b/camel/providers/groupwise/camel-groupwise-folder.c
@@ -633,7 +633,7 @@ groupwise_refresh_info(CamelFolder *folder, CamelException *ex)
char *container_id = NULL ;
char *cache_file_name ;
time_t mod_time = time (0) ;
- char time_string[100] = {0}, *t_str ;
+ char *time_string = NULL, *t_str = NULL ;
const struct tm *tm ;
struct stat buf ;
@@ -652,13 +652,7 @@ groupwise_refresh_info(CamelFolder *folder, CamelException *ex)
gw_folder->need_refresh = TRUE ;
}
- cache_file_name = g_strdup (folder->summary->summary_path) ;
- stat (cache_file_name, &buf) ;
- mod_time = buf.st_mtime ;
- g_free (cache_file_name) ;
-
- tm = gmtime (&mod_time) ;
- strftime (time_string, 100, "%Y-%m-%dT%H:%M:%SZ", tm) ;
+ time_string = ((CamelGroupwiseSummary *) folder->summary)->time_string;
t_str = g_strdup (time_string);
CAMEL_SERVICE_LOCK (gw_store, connect_lock);
diff --git a/camel/providers/groupwise/camel-groupwise-store.c b/camel/providers/groupwise/camel-groupwise-store.c
index 6df3fb89e..92b6fb458 100644
--- a/camel/providers/groupwise/camel-groupwise-store.c
+++ b/camel/providers/groupwise/camel-groupwise-store.c
@@ -479,6 +479,8 @@ groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags,
CamelGroupwiseStore *gw_store = CAMEL_GROUPWISE_STORE (store) ;
CamelGroupwiseStorePrivate *priv = gw_store->priv ;
CamelFolder *folder ;
+ CamelGroupwiseSummary *summary;
+ char *time_string = NULL;
char *storage_path, *folder_dir, *temp_str,*container_id ;
const char *temp_name;
EGwConnectionStatus status ;
@@ -531,31 +533,30 @@ groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags,
if (!mutex)
mutex = g_mutex_new () ;
+ summary = (CamelGroupwiseSummary *) folder->summary;
+ if (summary->time_string && *(summary->time_string))
+ time_string = summary->time_string;
+ else {
+ time_t mod_time = time (0) ;
+ const struct tm *tm;
+ /*TODO get current time here */
+ tm = gmtime (&mod_time);
+ strftime (time_string, 100, "%Y-%m-%dT%H:%M:%SZ", tm);
+ }
summary_count = camel_folder_summary_count (folder->summary) ;
if(summary_count) {
char *cache_file_name ;
time_t mod_time = time (0) ;
- char time_string[100] = {0}, *t_str;
+ char *t_str = NULL;
const struct tm *tm ;
struct stat buf;
-
-
- cache_file_name = g_strdup (folder->summary->summary_path) ;
- stat (cache_file_name, &buf) ;
- g_free (cache_file_name) ;
- mod_time = buf.st_mtime;
- tm = gmtime (&mod_time);
- strftime (time_string, 100, "%Y-%m-%dT%H:%M:%SZ", tm);
- camel_operation_start (NULL, _("Fetching summary information for new messages"));
t_str = g_strdup (time_string);
-
/* FIXME send the time stamp which the server sends */
status = e_gw_connection_get_quick_messages (priv->cnc, container_id,
"distribution attachments subject created",
&t_str, "New", "Mail", NULL, -1, &slist) ;
- g_free (t_str), t_str = NULL;
if (status != E_GW_CONNECTION_STATUS_OK) {
//camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Authentication failed"));
CAMEL_SERVICE_UNLOCK (gw_store, connect_lock) ;
@@ -568,7 +569,11 @@ groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags,
//return NULL ;
}
-
+ /* store t_str into the summary */
+ if (summary->time_string)
+ g_free (summary->time_string);
+ summary->time_string = g_strdup (t_str);
+ g_free (t_str), t_str = NULL;
for ( sl = slist ; sl != NULL; sl = sl->next) {
list = g_list_append (list, sl->data) ;
}
@@ -635,7 +640,10 @@ groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags,
temp = g_list_length (list) ;
count += temp ;
-
+
+ if (summary->time_string)
+ g_free (summary->time_string);
+ summary->time_string = g_strdup (e_gw_connection_get_server_time (priv->cnc));
gw_update_summary (folder, list, ex) ;
if (temp == count)
camel_operation_progress (NULL, 0) ;
diff --git a/camel/providers/groupwise/camel-groupwise-summary.c b/camel/providers/groupwise/camel-groupwise-summary.c
index d0d8d66b9..c7fe37fa5 100644
--- a/camel/providers/groupwise/camel-groupwise-summary.c
+++ b/camel/providers/groupwise/camel-groupwise-summary.c
@@ -161,6 +161,8 @@ gw_summary_header_load (CamelFolderSummary *s, FILE *in)
|| camel_file_util_decode_fixed_int32(in, &ims->validity) == -1)
return -1;
+ if (camel_file_util_decode_string (in, &ims->time_string) == -1)
+ return -1;
return 0 ;
}
@@ -174,6 +176,7 @@ gw_summary_header_save (CamelFolderSummary *s, FILE *out)
return -1;
camel_file_util_encode_fixed_int32(out, CAMEL_GW_SUMMARY_VERSION);
+ camel_file_util_encode_string (out, ims->time_string);
return camel_file_util_encode_fixed_int32(out, ims->validity);
diff --git a/camel/providers/groupwise/camel-groupwise-summary.h b/camel/providers/groupwise/camel-groupwise-summary.h
index 32ea2419e..98e42b70c 100644
--- a/camel/providers/groupwise/camel-groupwise-summary.h
+++ b/camel/providers/groupwise/camel-groupwise-summary.h
@@ -52,6 +52,7 @@ struct _CamelGroupwiseMessageContentInfo {
struct _CamelGroupwiseSummary {
CamelFolderSummary parent ;
+ char *time_string;
guint32 version ;
guint32 validity ;
} ;