OBS User unknown 2009-01-08 17:03:32 +00:00 committed by Git OBS Bridge
parent 77a941842e
commit 948c5f5c81
15 changed files with 1471 additions and 8 deletions

View File

@ -0,0 +1,336 @@
Index: camel/camel-store.c
===================================================================
--- camel/camel-store.c (revision 9841)
+++ camel/camel-store.c (revision 9842)
@@ -322,6 +322,21 @@
}
if (!folder) {
+
+ if (flags & CAMEL_STORE_IS_MIGRATING) {
+ if ((store->flags & CAMEL_STORE_VTRASH) && strcmp(folder_name, CAMEL_VTRASH_NAME) == 0) {
+ if (store->folders)
+ camel_object_bag_abort(store->folders, folder_name);
+ return NULL;
+ }
+
+ if ((store->flags & CAMEL_STORE_VJUNK) && strcmp(folder_name, CAMEL_VJUNK_NAME) == 0) {
+ if (store->folders)
+ camel_object_bag_abort(store->folders, folder_name);
+ return NULL;
+ }
+ }
+
if ((store->flags & CAMEL_STORE_VTRASH) && strcmp(folder_name, CAMEL_VTRASH_NAME) == 0) {
folder = CS_CLASS(store)->get_trash(store, ex);
} else if ((store->flags & CAMEL_STORE_VJUNK) && strcmp(folder_name, CAMEL_VJUNK_NAME) == 0) {
Index: camel/camel-store.h
===================================================================
--- camel/camel-store.h (revision 9841)
+++ camel/camel-store.h (revision 9842)
@@ -115,6 +115,7 @@
#define CAMEL_STORE_FILTER_INBOX (1 << 2)
#define CAMEL_STORE_VJUNK (1 << 3)
#define CAMEL_STORE_PROXY (1 << 4)
+#define CAMEL_STORE_IS_MIGRATING (1 << 5)
struct _CamelDB;
Index: camel/providers/local/camel-local-folder.c
===================================================================
--- camel/providers/local/camel-local-folder.c (revision 9841)
+++ camel/providers/local/camel-local-folder.c (revision 9842)
@@ -289,7 +289,7 @@
}
folder->summary = (CamelFolderSummary *)CLOCALF_CLASS(lf)->create_summary(lf, lf->summary_path, lf->folder_path, lf->index);
- if (camel_local_summary_load((CamelLocalSummary *)folder->summary, forceindex, NULL) == -1) {
+ if (!(flags & CAMEL_STORE_IS_MIGRATING) && camel_local_summary_load((CamelLocalSummary *)folder->summary, forceindex, NULL) == -1) {
/* ? */
if (camel_local_summary_check((CamelLocalSummary *)folder->summary, lf->changes, ex) == 0) {
/* we sync here so that any hard work setting up the folder isn't lost */
Index: camel/camel-db.c
===================================================================
--- camel/camel-db.c (revision 9841)
+++ camel/camel-db.c (revision 9842)
@@ -47,6 +47,8 @@
static GStaticRecMutex trans_lock = G_STATIC_REC_MUTEX_INIT;
+static int write_mir (CamelDB *cdb, const char *folder_name, CamelMIRecord *record, CamelException *ex, gboolean delete_old_record);
+
static int
cdb_sql_exec (sqlite3 *db, const char* stmt, CamelException *ex)
{
@@ -812,13 +814,29 @@
return ret;
}
+
+int
+camel_db_write_fresh_message_info_record (CamelDB *cdb, const char *folder_name, CamelMIRecord *record, CamelException *ex)
+{
+ return write_mir (cdb, folder_name, record, ex, FALSE);
+}
+
+
int
camel_db_write_message_info_record (CamelDB *cdb, const char *folder_name, CamelMIRecord *record, CamelException *ex)
{
+ return write_mir (cdb, folder_name, record, ex, TRUE);
+}
+
+static int
+write_mir (CamelDB *cdb, const char *folder_name, CamelMIRecord *record, CamelException *ex, gboolean delete_old_record)
+{
int ret;
char *del_query;
char *ins_query;
+ /* FIXME: We should migrate from this DELETE followed by INSERT model to an INSERT OR REPLACE model as pointed out by pvanhoof */
+
/* NB: UGLIEST Hack. We can't modify the schema now. We are using msg_security (an unsed one to notify of FLAGGED/Dirty infos */
ins_query = sqlite3_mprintf ("INSERT INTO %Q VALUES (%Q, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %ld, %ld, %Q, %Q, %Q, %Q, %Q, %Q, %Q, %Q, %Q, %Q, %Q, %Q, %Q )",
@@ -832,7 +850,8 @@
record->part, record->labels, record->usertags,
record->cinfo, record->bdata);
- del_query = sqlite3_mprintf ("DELETE FROM %Q WHERE uid = %Q", folder_name, record->uid);
+ if (delete_old_record)
+ del_query = sqlite3_mprintf ("DELETE FROM %Q WHERE uid = %Q", folder_name, record->uid);
#if 0
char *upd_query;
@@ -842,12 +861,14 @@
g_free (upd_query);
#else
- ret = camel_db_add_to_transaction (cdb, del_query, ex);
+ if (delete_old_record)
+ ret = camel_db_add_to_transaction (cdb, del_query, ex);
ret = camel_db_add_to_transaction (cdb, ins_query, ex);
#endif
- sqlite3_free (del_query);
+ if (delete_old_record)
+ sqlite3_free (del_query);
sqlite3_free (ins_query);
return ret;
@@ -1198,3 +1219,39 @@
CAMEL_DB_RELEASE_SQLITE_MEMORY;
return ret;
}
+
+int camel_db_start_in_memory_transactions (CamelDB *cdb, CamelException *ex)
+{
+ int ret;
+ char *cmd = sqlite3_mprintf ("ATTACH DATABASE ':memory:' AS %s", CAMEL_DB_IN_MEMORY_DB);
+
+ ret = camel_db_command (cdb, cmd, ex);
+ sqlite3_free (cmd);
+
+ cmd = sqlite3_mprintf ("CREATE TEMPORARY TABLE %Q ( uid TEXT PRIMARY KEY , flags INTEGER , msg_type INTEGER , read INTEGER , deleted INTEGER , replied INTEGER , important INTEGER , junk INTEGER , attachment INTEGER , msg_security INTEGER , size INTEGER , dsent NUMERIC , dreceived NUMERIC , subject TEXT , mail_from TEXT , mail_to TEXT , mail_cc TEXT , mlist TEXT , followup_flag TEXT , followup_completed_on TEXT , followup_due_by TEXT , part TEXT , labels TEXT , usertags TEXT , cinfo TEXT , bdata TEXT )", CAMEL_DB_IN_MEMORY_TABLE);
+ ret = camel_db_command (cdb, cmd, ex);
+ if (ret != 0 )
+ abort ();
+ sqlite3_free (cmd);
+
+ return ret;
+}
+
+int camel_db_flush_in_memory_transactions (CamelDB *cdb, const char * folder_name, CamelException *ex)
+{
+ int ret;
+ char *cmd = sqlite3_mprintf ("INSERT INTO %Q SELECT * FROM %Q", folder_name, CAMEL_DB_IN_MEMORY_TABLE);
+
+ ret = camel_db_command (cdb, cmd, ex);
+ sqlite3_free (cmd);
+
+ cmd = sqlite3_mprintf ("DROP TABLE %Q", CAMEL_DB_IN_MEMORY_TABLE);
+ ret = camel_db_command (cdb, cmd, ex);
+ sqlite3_free (cmd);
+
+ cmd = sqlite3_mprintf ("DETACH %Q", CAMEL_DB_IN_MEMORY_DB);
+ ret = camel_db_command (cdb, cmd, ex);
+ sqlite3_free (cmd);
+
+ return ret;
+}
Index: camel/camel-db.h
===================================================================
--- camel/camel-db.h (revision 9841)
+++ camel/camel-db.h (revision 9842)
@@ -4,8 +4,14 @@
#define __CAMEL_DB_H
#include <sqlite3.h>
#include <glib.h>
+
#define CAMEL_DB_FILE "folders.db"
+/* Hopefully no one will create a folder named EVO_IN_meM_hAnDlE */
+#define CAMEL_DB_IN_MEMORY_TABLE "EVO_IN_meM_hAnDlE.temp"
+#define CAMEL_DB_IN_MEMORY_DB "EVO_IN_meM_hAnDlE"
+#define CAMEL_DB_IN_MEMORY_TABLE_LIMIT 100000
+
#include "camel-exception.h"
typedef struct _CamelDBPrivate CamelDBPrivate;
@@ -132,6 +138,7 @@
int camel_db_prepare_message_info_table (CamelDB *cdb, const char *folder_name, CamelException *ex);
int camel_db_write_message_info_record (CamelDB *cdb, const char *folder_name, CamelMIRecord *record, CamelException *ex);
+int camel_db_write_fresh_message_info_record (CamelDB *cdb, const char *folder_name, CamelMIRecord *record, CamelException *ex);
int camel_db_read_message_info_records (CamelDB *cdb, const char *folder_name, gpointer p, CamelDBSelectCB read_mir_callback, CamelException *ex);
int camel_db_read_message_info_record_with_uid (CamelDB *cdb, const char *folder_name, const char *uid, gpointer p, CamelDBSelectCB read_mir_callback, CamelException *ex);
@@ -168,5 +175,9 @@
int camel_db_set_collate (CamelDB *cdb, const char *col, const char *collate, CamelDBCollate func);
/* Migration APIS */
int camel_db_migrate_vfolders_to_14(CamelDB *cdb, const char *folder, CamelException *ex);
+
+int camel_db_start_in_memory_transactions (CamelDB *cdb, CamelException *ex);
+int camel_db_flush_in_memory_transactions (CamelDB *cdb, const char * folder_name, CamelException *ex);
+
#endif
Index: camel/camel-folder-summary.c
===================================================================
--- camel/camel-folder-summary.c (revision 9841)
+++ camel/camel-folder-summary.c (revision 9842)
@@ -129,7 +129,7 @@
static int content_info_save(CamelFolderSummary *, FILE *, CamelMessageContentInfo *);
static void content_info_free(CamelFolderSummary *, CamelMessageContentInfo *);
-static int save_message_infos_to_db (CamelFolderSummary *s, CamelException *ex);
+static int save_message_infos_to_db (CamelFolderSummary *s, gboolean fresh_mir, CamelException *ex);
static int camel_read_mir_callback (void * ref, int ncol, char ** cols, char ** name);
static char *next_uid_string(CamelFolderSummary *s);
@@ -1237,23 +1237,20 @@
if (fclose (in) != 0)
return -1;
+ record = (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_to_db (s, &ex));
+ if (!record) {
+ return -1;
+ }
- camel_db_begin_transaction (cdb, &ex);
+ ret = save_message_infos_to_db (s, TRUE, &ex);
- ret = save_message_infos_to_db (s, &ex);
-
if (ret != 0) {
- camel_db_abort_transaction (cdb, &ex);
return -1;
}
- camel_db_end_transaction (cdb, &ex);
-
- record = (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_to_db (s, &ex));
- if (!record) {
- return -1;
- }
+ camel_db_begin_transaction (cdb, &ex);
ret = camel_db_write_folder_info_record (cdb, record, &ex);
+ camel_db_end_transaction (cdb, &ex);
g_free (record->bdata);
g_free (record);
@@ -1321,17 +1318,24 @@
return 0;
}
+typedef struct {
+ CamelException *ex;
+ gboolean migration;
+ int progress;
+} SaveToDBArgs;
+
static void
save_to_db_cb (gpointer key, gpointer value, gpointer data)
{
- CamelException *ex = (CamelException *)data;
+ SaveToDBArgs *args = (SaveToDBArgs *) data;
+ CamelException *ex = args->ex;
CamelMessageInfoBase *mi = (CamelMessageInfoBase *)value;
CamelFolderSummary *s = (CamelFolderSummary *)mi->summary;
char *folder_name = s->folder->full_name;
CamelDB *cdb = s->folder->parent_store->cdb_w;
CamelMIRecord *mir;
- if (!mi->dirty)
+ if (!args->migration && !mi->dirty)
return;
mir = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_to_db (s, (CamelMessageInfo *)mi);
@@ -1345,30 +1349,52 @@
}
}
- if (camel_db_write_message_info_record (cdb, folder_name, mir, ex) != 0) {
- camel_db_camel_mir_free (mir);
- return;
+ if (!args->migration) {
+ if (camel_db_write_message_info_record (cdb, folder_name, mir, ex) != 0) {
+ camel_db_camel_mir_free (mir);
+ return;
+ }
+ } else {
+ if (camel_db_write_fresh_message_info_record (cdb, CAMEL_DB_IN_MEMORY_TABLE, mir, ex) != 0) {
+ camel_db_camel_mir_free (mir);
+ return;
+ }
+
+ if (args->progress > CAMEL_DB_IN_MEMORY_TABLE_LIMIT) {
+ g_print ("BULK INsert limit reached \n");
+ camel_db_flush_in_memory_transactions (cdb, folder_name, ex);
+ camel_db_start_in_memory_transactions (cdb, ex);
+ args->progress = 0;
+ } else {
+ args->progress ++;
+ }
}
/* Reset the flags */
mi->dirty = FALSE;
+ mi->flags &= ~CAMEL_MESSAGE_FOLDER_FLAGGED;
camel_db_camel_mir_free (mir);
}
static int
-save_message_infos_to_db (CamelFolderSummary *s, CamelException *ex)
+save_message_infos_to_db (CamelFolderSummary *s, gboolean fresh_mirs, CamelException *ex)
{
CamelDB *cdb = s->folder->parent_store->cdb_w;
char *folder_name;
+ SaveToDBArgs args;
+ args.ex = ex;
+ args.migration = fresh_mirs;
+ args.progress = 0;
+
folder_name = s->folder->full_name;
if (camel_db_prepare_message_info_table (cdb, folder_name, ex) != 0) {
return -1;
}
CAMEL_SUMMARY_LOCK(s, summary_lock);
/* Push MessageInfo-es */
- g_hash_table_foreach (s->loaded_infos, save_to_db_cb, ex);
+ g_hash_table_foreach (s->loaded_infos, save_to_db_cb, &args);
CAMEL_SUMMARY_UNLOCK(s, summary_lock);
/* FIXME[disk-summary] make sure we free the message infos that are loaded
* are freed if not used anymore or should we leave that to the timer? */
@@ -1398,7 +1424,7 @@
camel_db_begin_transaction (cdb, ex);
- ret = save_message_infos_to_db (s, ex);
+ ret = save_message_infos_to_db (s, FALSE, ex);
if (ret != 0) {
camel_db_abort_transaction (cdb, ex);
/* Failed, so lets reset the flag */

View File

@ -0,0 +1,17 @@
--- camel/providers/groupwise/camel-groupwise-folder.c
+++ camel/providers/groupwise/camel-groupwise-folder.c
@@ -925,7 +925,13 @@ update_update (CamelSession *session, CamelSessionThreadMsg *msg)
done = FALSE;
m->slist = NULL;
- while (!done && !camel_application_is_exiting) {
+ while (!done) {
+
+ if (camel_application_is_exiting) {
+ CAMEL_SERVICE_REC_UNLOCK (gw_store, connect_lock);
+ return ;
+ }
+
item_list = NULL;
status = e_gw_connection_get_all_mail_uids (m->cnc, m->container_id, cursor, FALSE, READ_CURSOR_MAX_IDS, position, &item_list);
if (status != E_GW_CONNECTION_STATUS_OK) {

View File

@ -0,0 +1,15 @@
--- calendar/backends/groupwise/e-cal-backend-groupwise.c
+++ calendar/backends/groupwise/e-cal-backend-groupwise.c
@@ -2581,8 +2581,12 @@ receive_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalco
e_cal_component_free_id (id);
} else {
char *comp_str = NULL;
+ ECalComponentTransparency transp;
change_status (component, pstatus, e_gw_connection_get_user_email (priv->cnc));
+ e_cal_component_get_transparency (comp, &transp);
+ e_cal_component_set_transparency (component, transp);
+
e_cal_backend_cache_put_component (priv->cache, component);
comp_str = e_cal_component_get_as_string (component);

View File

@ -0,0 +1,96 @@
--- addressbook/backends/groupwise/e-book-backend-groupwise.c
+++ addressbook/backends/groupwise/e-book-backend-groupwise.c
@@ -44,6 +44,7 @@
#include "libedataserver/e-flag.h"
#include "libedataserver/e-url.h"
#include "libebook/e-contact.h"
+#include "libebook/e-destination.h"
#include "libedata-book/e-book-backend-sexp.h"
#include "libedata-book/e-data-book.h"
#include "libedata-book/e-data-book-view.h"
@@ -798,7 +799,7 @@ populate_contact_members (EContact *contact, gpointer data)
static void
set_members_in_gw_item (EGwItem *item, EContact *contact, EBookBackendGroupwise *egwb)
{
- GList *members, *temp, *items, *p, *emails_without_ids;
+ GList *members, *temp, *dtemp, *items, *p, *emails_without_ids, *dest_without_ids;
GList *group_members;
char *email;
EGwFilter *filter;
@@ -816,10 +817,12 @@ set_members_in_gw_item (EGwItem *item, EContact *contact, EBookBackendGroupwise
filter = e_gw_filter_new ();
group_members = NULL;
emails_without_ids = NULL;
+ dest_without_ids = NULL;
for ( ;temp != NULL; temp = g_list_next (temp)) {
EVCardAttribute *attr = temp->data;
id = email = NULL;
+ EDestination *dest = e_destination_new ();
for (p = e_vcard_attribute_get_params (attr); p; p = p->next) {
EVCardAttributeParam *param = p->data;
@@ -856,8 +859,11 @@ set_members_in_gw_item (EGwItem *item, EContact *contact, EBookBackendGroupwise
member->id = g_strdup (id);
group_members = g_list_append (group_members, member);
} else if (email) {
+ e_destination_set_raw (dest, email);
e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_EQUAL, "emailList/@primary", email);
emails_without_ids = g_list_append (emails_without_ids, g_strdup (email));
+ dest_without_ids = g_list_append (dest_without_ids, dest);
+
count++;
}
}
@@ -874,8 +880,15 @@ set_members_in_gw_item (EGwItem *item, EContact *contact, EBookBackendGroupwise
temp_item = E_GW_ITEM (items->data);
emails = e_gw_item_get_email_list (temp_item);
if (emails_without_ids && (ptr = g_list_find_custom (emails_without_ids, emails->data, (GCompareFunc)strcasecmp ))) {
+ int pos = g_list_position (emails_without_ids, ptr);
emails_without_ids = g_list_remove_link (emails_without_ids, ptr);
g_list_free (ptr);
+
+ ptr = g_list_nth (dest_without_ids, pos);
+ dest_without_ids = g_list_remove_link (dest_without_ids, ptr);
+ g_object_unref (ptr->data);
+ g_list_free (ptr);
+
id = g_strdup (e_gw_item_get_id (temp_item));
member = g_new0 (EGroupMember , 1);
member->id = id;
@@ -893,19 +906,21 @@ set_members_in_gw_item (EGwItem *item, EContact *contact, EBookBackendGroupwise
*/
temp = emails_without_ids ;
- for (; temp != NULL; temp = g_list_next (temp)) {
+ dtemp = dest_without_ids;
+ for (; temp != NULL && dtemp != NULL ; temp = g_list_next (temp), dtemp = g_list_next(dtemp)) {
EContact *new_contact = e_contact_new ();
EGwItem *new_item = e_gw_item_new_empty ();
FullName *full_name;
+ EDestination *tdest = (EDestination *)dtemp->data;
- e_contact_set (new_contact,E_CONTACT_FULL_NAME, e_contact_name_from_string (strdup (temp->data)));
- e_contact_set (new_contact, E_CONTACT_EMAIL_1, strdup (temp->data));
+ e_contact_set (new_contact,E_CONTACT_FULL_NAME, e_contact_name_from_string (strdup (e_destination_get_email(tdest))));
+ e_contact_set (new_contact, E_CONTACT_EMAIL_1, strdup (e_destination_get_email(tdest)));
e_contact_set (new_contact, E_CONTACT_IS_LIST, GINT_TO_POINTER (FALSE));
e_gw_item_set_item_type (new_item, E_GW_ITEM_TYPE_CONTACT);
e_gw_item_set_container_id (new_item, g_strdup(egwb->priv->container_id));
full_name = g_new0 (FullName, 1);
full_name->name_prefix = NULL;
- full_name->first_name = g_strdup(temp->data);
+ full_name->first_name = g_strdup(e_destination_get_name(tdest));
full_name->middle_name = NULL;
full_name->last_name = NULL;
full_name->name_suffix = NULL;
@@ -959,6 +974,9 @@ set_members_in_gw_item (EGwItem *item, EContact *contact, EBookBackendGroupwise
g_list_free (members);
g_list_foreach (emails_without_ids, (GFunc) g_free, NULL);
g_list_free (emails_without_ids);
+ g_list_foreach (dest_without_ids, (GFunc) g_object_unref, NULL);
+ g_list_free (dest_without_ids);
+
g_list_free (items);
e_gw_item_set_member_list (item, group_members);
}

View File

@ -0,0 +1,491 @@
--- camel/camel-folder.c 2008-12-15 09:10:26 +0000
+++ camel/camel-folder.c 2008-12-16 06:57:35 +0000
@@ -88,6 +88,7 @@
CamelException *ex);
static GPtrArray *get_uids (CamelFolder *folder);
+static GPtrArray *get_uncached_uids (CamelFolder *, GPtrArray * uids, CamelException *);
static void free_uids (CamelFolder *folder,
GPtrArray *array);
static void sort_uids (CamelFolder *folder,
@@ -148,6 +149,7 @@
camel_folder_class->set_message_user_tag = set_message_user_tag;
camel_folder_class->get_message = get_message;
camel_folder_class->get_uids = get_uids;
+ camel_folder_class->get_uncached_uids = get_uncached_uids;
camel_folder_class->free_uids = free_uids;
camel_folder_class->sort_uids = sort_uids;
camel_folder_class->get_summary = get_summary;
@@ -163,6 +165,7 @@
camel_folder_class->delete = delete;
camel_folder_class->rename = folder_rename;
camel_folder_class->freeze = freeze;
+ camel_folder_class->sync_message = NULL;
camel_folder_class->thaw = thaw;
camel_folder_class->is_frozen = is_frozen;
camel_folder_class->get_quota_info = get_quota_info;
@@ -1137,6 +1140,35 @@
return ret;
}
+/**
+ * camel_folder_sync_message:
+ * @folder: a #CamelFolder object
+ * @uid: the UID
+ * @ex: a #CamelException
+ *
+ * Ensure that a message identified by UID has been synced in the folder (so
+ * that camel_folder_get_message on it later will work in offline mode).
+ *
+ * Returns: void.
+ **/
+void
+camel_folder_sync_message (CamelFolder *folder, const char *uid, CamelException *ex)
+{
+ g_return_if_fail (CAMEL_IS_FOLDER (folder));
+ CAMEL_FOLDER_REC_LOCK(folder, lock);
+
+ /* Use the sync_message method if the class implements it. */
+ if (CF_CLASS (folder)->sync_message)
+ CF_CLASS (folder)->sync_message (folder, uid, ex);
+ else {
+ CamelMimeMessage *message;
+ message = CF_CLASS (folder)->get_message (folder, uid, ex);
+ if (message)
+ camel_object_unref(message);
+ }
+ CAMEL_FOLDER_REC_UNLOCK(folder, lock);
+}
+
static GPtrArray *
get_uids(CamelFolder *folder)
{
@@ -1200,6 +1232,41 @@
}
+/**
+ * Default: return the uids we are given.
+ */
+static GPtrArray *
+get_uncached_uids (CamelFolder *folder, GPtrArray * uids, CamelException *ex)
+{
+ GPtrArray *result;
+ int i;
+
+ result = g_ptr_array_new();
+
+ g_ptr_array_set_size(result, uids->len);
+ for (i = 0; i < uids->len; i++)
+ result->pdata[i] = (char *)camel_pstring_strdup(uids->pdata[i]);
+ return result;
+}
+
+/**
+ * camel_folder_get_uncached_uids:
+ * @folder: a #CamelFolder object
+ * @uids: the array of uids to filter down to uncached ones.
+ *
+ * Returns the known-uncached uids from a list of uids. It may return uids
+ * which are locally cached but should never filter out a uid which is not
+ * locally cached. Free the result by called #camel_folder_free_uids.
+ * Frees the array of UIDs returned by #camel_folder_get_uids.
+ **/
+GPtrArray *
+camel_folder_get_uncached_uids (CamelFolder *folder, GPtrArray * uids, CamelException *ex)
+{
+ g_return_if_fail (CAMEL_IS_FOLDER (folder));
+ return CF_CLASS (folder)->get_uncached_uids(folder, uids, ex);
+}
+
+
static int
uidcmp (const void *v0, const void *v1)
{
--- camel/camel-folder.h 2008-10-06 09:27:15 +0000
+++ camel/camel-folder.h 2008-12-16 06:57:35 +0000
@@ -211,6 +211,10 @@
CamelFolderQuotaInfo * (*get_quota_info) (CamelFolder *folder);
guint32 (*count_by_expression) (CamelFolder *, const char *, CamelException *);
+ void (*sync_message) (CamelFolder *folder,
+ const char *uid,
+ CamelException *ex);
+ GPtrArray * (*get_uncached_uids)(CamelFolder *, GPtrArray * uids, CamelException *);
} CamelFolderClass;
/* Standard Camel function */
@@ -303,12 +307,18 @@
CamelMimeMessage * camel_folder_get_message (CamelFolder *folder,
const char *uid,
CamelException *ex);
+void camel_folder_sync_message (CamelFolder *folder,
+ const char *uid,
+ CamelException *ex);
#define camel_folder_delete_message(folder, uid) \
camel_folder_set_message_flags (folder, uid, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN)
GPtrArray * camel_folder_get_uids (CamelFolder *folder);
void camel_folder_free_uids (CamelFolder *folder,
GPtrArray *array);
+GPtrArray * camel_folder_get_uncached_uids (CamelFolder *,
+ GPtrArray * uids,
+ CamelException *);
void camel_folder_sort_uids (CamelFolder *folder,
GPtrArray *uids);
--- camel/camel-offline-folder.c 2008-06-20 22:32:12 +0000
+++ camel/camel-offline-folder.c 2008-12-16 06:57:35 +0000
@@ -247,8 +247,7 @@
offline_folder_downsync (CamelOfflineFolder *offline, const char *expression, CamelException *ex)
{
CamelFolder *folder = (CamelFolder *) offline;
- CamelMimeMessage *message;
- GPtrArray *uids;
+ GPtrArray *uids, *uncached_uids;
int i;
camel_operation_start (NULL, _("Syncing messages in folder '%s' to disk"), folder->full_name);
@@ -257,27 +256,29 @@
uids = camel_folder_search_by_expression (folder, expression, ex);
else
uids = camel_folder_get_uids (folder);
-
- if (!uids) {
- camel_operation_end (NULL);
- return;
+
+ if (!uids)
+ goto done;
+ uncached_uids = camel_folder_get_uncached_uids(folder, uids, ex);
+ if (uids) {
+ if (expression)
+ camel_folder_search_free (folder, uids);
+ else
+ camel_folder_free_uids (folder, uids);
}
- for (i = 0; i < uids->len; i++) {
- int pc = i * 100 / uids->len;
-
- message = camel_folder_get_message (folder, uids->pdata[i], ex);
+ if (!uncached_uids)
+ goto done;
+
+ for (i = 0; i < uncached_uids->len; i++) {
+ int pc = i * 100 / uncached_uids->len;
+ camel_folder_sync_message (folder, uncached_uids->pdata[i], ex);
camel_operation_progress (NULL, pc);
- if (message == NULL)
- break;
-
- camel_object_unref (message);
}
-
- if (expression)
- camel_folder_search_free (folder, uids);
- else
- camel_folder_free_uids (folder, uids);
+
+done:
+ if (uncached_uids)
+ camel_folder_free_uids(folder, uncached_uids);
camel_operation_end (NULL);
}
--- camel/providers/imap/camel-imap-folder.c 2008-12-05 12:10:12 +0000
+++ camel/providers/imap/camel-imap-folder.c 2008-12-16 06:57:35 +0000
@@ -102,10 +102,13 @@
static void imap_expunge (CamelFolder *folder, CamelException *ex);
//static void imap_cache_message (CamelDiscoFolder *disco_folder, const char *uid, CamelException *ex);
static void imap_rename (CamelFolder *folder, const char *new);
+static GPtrArray * imap_get_uncached_uids (CamelFolder *folder, GPtrArray * uids, CamelException *ex);
/* message manipulation */
static CamelMimeMessage *imap_get_message (CamelFolder *folder, const gchar *uid,
CamelException *ex);
+static void imap_sync_message (CamelFolder *folder, const gchar *uid,
+ CamelException *ex);
static void imap_append_online (CamelFolder *folder, CamelMimeMessage *message,
const CamelMessageInfo *info, char **appended_uid,
CamelException *ex);
@@ -135,6 +138,12 @@
static GData *parse_fetch_response (CamelImapFolder *imap_folder, char *msg_att);
+/* internal helpers */
+static CamelImapMessageInfo * imap_folder_summary_uid_or_error(
+ CamelFolderSummary *summary,
+ const char * uid,
+ CamelException *ex);
+
#ifdef G_OS_WIN32
/* The strtok() in Microsoft's C library is MT-safe (but still uses
* only one buffer pointer per thread, but for the use of strtok_r()
@@ -166,7 +175,9 @@
camel_folder_class->expunge = imap_expunge;
camel_folder_class->sync= imap_sync;
camel_folder_class->append_message = imap_append_online;
+ camel_folder_class->sync_message = imap_sync_message;
camel_folder_class->transfer_messages_to = imap_transfer_online;
+ camel_folder_class->get_uncached_uids = imap_get_uncached_uids;
}
static void
@@ -2809,24 +2820,33 @@
return FALSE;
}
-static CamelMimeMessage *
-imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
+static CamelImapMessageInfo *
+imap_folder_summary_uid_or_error(CamelFolderSummary *summary, const char * uid, CamelException *ex)
{
- CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
- CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
- CamelImapMessageInfo *mi;
- CamelMimeMessage *msg = NULL;
- CamelStream *stream = NULL;
- int retry;
-
- mi = (CamelImapMessageInfo *)camel_folder_summary_uid (folder->summary, uid);
+ CamelImapMessageInfo *mi;
+ mi = (CamelImapMessageInfo *)camel_folder_summary_uid (summary, uid);
if (mi == NULL) {
camel_exception_setv (
ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
_("Cannot get message with message ID %s: %s"),
uid, _("No such message available."));
- return NULL;
}
+ return mi;
+}
+
+static CamelMimeMessage *
+imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
+{
+ CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
+ CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
+ CamelImapMessageInfo *mi;
+ CamelMimeMessage *msg = NULL;
+ CamelStream *stream = NULL;
+ int retry;
+
+ mi = imap_folder_summary_uid_or_error(folder->summary, uid, ex);
+ if (!mi)
+ return NULL;
/* If its cached in full, just get it as is, this is only a shortcut,
since we get stuff from the cache anyway. It affects a busted connection though. */
@@ -2947,6 +2967,44 @@
return msg;
}
+/**
+ * imap_sync_message
+ *
+ * Ensure that a message is cached locally, but don't retrieve the content if
+ * it is already local.
+ */
+static void
+imap_sync_message (CamelFolder *folder, const char *uid, CamelException *ex)
+{
+ CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
+ CamelImapMessageInfo *mi;
+ CamelMimeMessage *msg = NULL;
+ CamelStream *stream = NULL;
+
+ mi = imap_folder_summary_uid_or_error(folder->summary, uid, ex);
+ if (!mi)
+ /* No such UID - is this duplicate work? The sync process selects
+ * UIDs to start with.
+ */
+ return;
+ camel_message_info_free(&mi->info);
+
+ /* If we can get a stream, assume its fully cached. This may be false
+ * if partial streams are saved elsewhere in the code - but that seems
+ * best solved by knowning more about whether a given message is fully
+ * available locally or not,
+ */
+ /* If its cached in full, just get it as is, this is only a shortcut,
+ since we get stuff from the cache anyway. It affects a busted connection though. */
+ if ((stream = camel_imap_folder_fetch_data(imap_folder, uid, "", TRUE, NULL))) {
+ camel_object_unref (stream);
+ return;
+ }
+ msg = imap_get_message(folder, uid, ex);
+ if (msg)
+ camel_object_unref(msg);
+}
+
/* FIXME Remove it after confirming
static void
imap_cache_message (CamelDiscoFolder *disco_folder, const char *uid,
@@ -3919,3 +3977,19 @@
CAMEL_SERVICE_REC_UNLOCK (imap_store, connect_lock);
return res;
}
+
+/**
+ * Scan for messages that are local and return the rest.
+ */
+static GPtrArray *
+imap_get_uncached_uids (CamelFolder *folder, GPtrArray * uids, CamelException *ex)
+{
+ GPtrArray *result;
+ CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
+
+ CAMEL_IMAP_FOLDER_REC_LOCK (imap_folder, cache_lock);
+ result = camel_imap_message_cache_filter_cached (imap_folder->cache, uids, ex);
+ CAMEL_IMAP_FOLDER_REC_UNLOCK (imap_folder, cache_lock);
+ return result;
+}
+
--- camel/providers/imap/camel-imap-message-cache.c 2008-10-16 03:42:34 +0000
+++ camel/providers/imap/camel-imap-message-cache.c 2008-12-16 06:57:35 +0000
@@ -35,6 +35,7 @@
#include "camel-data-wrapper.h"
#include "camel-exception.h"
#include "camel-stream-fs.h"
+#include "camel-string-utils.h"
#include "camel-imap-message-cache.h"
@@ -42,9 +43,27 @@
#define O_BINARY 0
#endif
+/* Common define to start reducing duplication of base-part handling on win32.
+ */
+#ifdef G_OS_WIN32
+/* See comment in insert_setup() */
+#define BASE_PART_SUFFIX ".~"
+#else
+#define BASE_PART_SUFFIX "."
+#endif
+
static void finalize (CamelImapMessageCache *cache);
static void stream_finalize (CamelObject *stream, gpointer event_data, gpointer user_data);
+struct _part_find {
+ /* UID name on disk - e.g. "0." or "0.HEADERS". On windows "0." is
+ * stored as "0.~"
+ */
+ char *disk_part_name;
+ /* Was the part found? */
+ int found;
+};
+
CamelType
camel_imap_message_cache_get_type (void)
@@ -142,6 +161,8 @@
* Return value: a new CamelImapMessageCache object using @path for
* storage. If cache files already exist in @path, then any that do not
* correspond to messages in @summary will be deleted.
+ * @path is scanned for its contents, which means creating a cache object can be
+ * expensive, but the parts hash is immediately usable.
**/
CamelImapMessageCache *
camel_imap_message_cache_new (const char *path, CamelFolderSummary *summary,
@@ -591,3 +612,67 @@
}
}
}
+
+
+static void
+_match_part(gpointer part_name, gpointer user_data)
+{
+ struct _part_find *part_find = (struct _part_find *) user_data;
+ if (g_str_equal(part_name, part_find->disk_part_name))
+ part_find->found = 1;
+}
+
+/**
+ * Filter uids by the uids cached in cache.
+ * The intent is that only uids fully cached are returned, but that may not be
+ * what is achieved. An additional constraint is that this check should be
+ * cheap, so that going offline is not an expensive operation. Filtering all
+ * uids is inefficient in the first place; significant processing per uid
+ * makes synchronisation very expensive. At the suggestion of Srinivasa Ragavan
+ * (see http://bugzilla.gnome.org/show_bug.cgi?id=564339) the cache->parts hash
+ * table is consulted. If there is a parts-list in the hash table containing
+ * the part "", then we assume the message has been completely downloaded. This
+ * is incorrect (see http://bugzilla.gnome.org/show_bug.cgi?id=561211 for the
+ * symptoms). The code this replaces, a loop over all uids asking for the ""
+ * part of the message has the same flaw: it is no /less/ accurate to assess
+ * 'cached' in the manner this method does (assuming no concurrent process is
+ * removing messages from the cache).
+ *
+ * In the future, fixing bug 561211 needs a check for *all* the parts of a
+ * given uid. If the complete list of parts is available in the folder summary
+ * information then it can be done cheaply, otherwise some redesign will be
+ * needed.
+ */
+GPtrArray *
+camel_imap_message_cache_filter_cached(CamelImapMessageCache *cache, GPtrArray *uids, CamelException *ex)
+{
+ GPtrArray *result, *parts_list;
+ int i;
+ struct _part_find part_find;
+ /* Look for a part "" for each uid. */
+ result = g_ptr_array_sized_new(uids->len);
+ for (i = 0; i < uids->len; i++) {
+ if ((parts_list = g_hash_table_lookup(cache->parts, uids->pdata[i]))) {
+ /* At least one part locally present; look for "" (the
+ * HEADERS part can be present without anything else,
+ * and that part is not useful for users wanting to
+ * read the message).
+ */
+ part_find.found = 0;
+ part_find.disk_part_name = g_strdup_printf("%s" BASE_PART_SUFFIX,
+ (char *)uids->pdata[i]);
+ g_ptr_array_foreach(parts_list, _match_part, &part_find);
+ g_free(part_find.disk_part_name);
+ if (part_find.found)
+ /* The message is cached locally, do not
+ * include it in the result.
+ */
+ continue;
+ }
+ /* No message parts, or message part "" not found: include the
+ * uid in the result.
+ */
+ g_ptr_array_add(result, (char *)camel_pstring_strdup(uids->pdata[i]));
+ }
+ return result;
+}
--- camel/providers/imap/camel-imap-message-cache.h 2008-07-31 09:31:51 +0000
+++ camel/providers/imap/camel-imap-message-cache.h 2008-12-16 06:57:35 +0000
@@ -41,6 +41,13 @@
CamelObject parent_object;
char *path;
+ /* parts contains two sorts of objects.
+ * If the key contains '.' then it is a stream (also reverse-indexed in
+ * cached).
+ * Otherwise it is a g_ptr_array containing the subparts the message
+ * has. (e.g. 0., or 0.MIME.1).
+ */
+ /* cached contains streams for recently accessed messages */
GHashTable *parts, *cached;
guint32 max_uid;
};
@@ -98,6 +105,9 @@
CamelException *ex);
gboolean camel_imap_message_cache_delete (const char *path,
CamelException *ex);
+GPtrArray * camel_imap_message_cache_filter_cached(CamelImapMessageCache *,
+ GPtrArray *uids,
+ CamelException *ex);
/* Standard Camel function */
CamelType camel_imap_message_cache_get_type (void);

View File

@ -0,0 +1,50 @@
Index: calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
===================================================================
--- calendar/backends/groupwise/e-cal-backend-groupwise-utils.c (revision 9879)
+++ calendar/backends/groupwise/e-cal-backend-groupwise-utils.c (revision 9881)
@@ -1785,6 +1785,7 @@
ECalComponentAttendee attendee;
GSList *attendee_list = NULL;
icalcomponent *icalcomp = NULL;
+ icaltimetype start_time, end_time;
tmp = soup_soap_parameter_get_first_child_by_name (subparam, "email");
if (tmp)
@@ -1801,6 +1802,11 @@
e_cal_component_commit_sequence (comp);
icalcomp = e_cal_component_get_icalcomponent (comp);
+ start_time = icaltime_from_timet_with_zone (start, 0, default_zone ? default_zone : NULL);
+ end_time = icaltime_from_timet_with_zone (end, 0, default_zone ? default_zone : NULL);
+ icalcomponent_set_dtstart (icalcomp, start_time);
+ icalcomponent_set_dtend (icalcomp, end_time);
+
memset (&attendee, 0, sizeof (ECalComponentAttendee));
if (name)
attendee.cn = name;
@@ -1829,7 +1835,24 @@
return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
}
- for (subparam_block = soup_soap_parameter_get_first_child_by_name (param_blocks, "block");
+ subparam_block = soup_soap_parameter_get_first_child_by_name (param_blocks, "block");
+ /* The GW server only returns 'Busy', 'OOF' and 'Tentative' periods. The rest are
+ * assumed to be 'Free' periods. In case of an attendee having only 'Free' periods,
+ * ensure to send a block to the frontend saying so. */
+ if (subparam_block == NULL) {
+ struct icalperiodtype ipt;
+ icaltimetype sitt, eitt;
+ icalproperty *icalprop;
+ sitt = icaltime_from_timet_with_zone (start, 0, default_zone ? default_zone : NULL);
+ ipt.start = sitt;
+ eitt = icaltime_from_timet_with_zone (end, 0, default_zone ? default_zone : NULL);
+ ipt.end = eitt;
+ icalprop = icalproperty_new_freebusy (ipt);
+ icalproperty_set_parameter_from_string (icalprop, "FBTYPE", "FREE");
+ icalcomponent_add_property(icalcomp, icalprop);
+ }
+
+ for (;
subparam_block != NULL;
subparam_block = soup_soap_parameter_get_next_child_by_name (subparam_block, "block")) {

View File

@ -0,0 +1,102 @@
Index: camel/providers/groupwise/camel-groupwise-folder.c
===================================================================
--- camel/providers/groupwise/camel-groupwise-folder.c (revision 9858)
+++ camel/providers/groupwise/camel-groupwise-folder.c (revision 9859)
@@ -1200,10 +1200,6 @@
if (gw_store->current_folder != folder) {
gw_store->current_folder = folder;
}
-
- if (list) {
- gw_update_cache (folder, list, ex, FALSE);
- }
if (check_all && !is_proxy) {
EGwContainer *container;
@@ -1214,8 +1210,15 @@
if (camel_folder_summary_count (folder->summary) == e_gw_container_get_total_count (container))
check_all = FALSE;
+
+ folder->summary->unread_count = e_gw_container_get_unread_count (container);
+ folder->summary->visible_count = e_gw_container_get_total_count (container);
g_object_unref (container);
}
+
+ if (list) {
+ gw_update_cache (folder, list, ex, FALSE);
+ }
}
@@ -1352,6 +1355,8 @@
mi->info.content->type = camel_content_type_new ("multipart", "mixed");
}
+ mi->info.flags = 0;
+
if (type == E_GW_ITEM_TYPE_APPOINTMENT || type == E_GW_ITEM_TYPE_TASK || type == E_GW_ITEM_TYPE_NOTE)
camel_message_info_set_user_flag ((CamelMessageInfo*)mi, "$has_cal", TRUE);
}
@@ -1368,16 +1373,12 @@
item_status = e_gw_item_get_item_status (item);
if (item_status & E_GW_ITEM_STAT_READ)
- status_flags |= CAMEL_MESSAGE_SEEN;
+ mi->info.flags |= CAMEL_MESSAGE_SEEN;
else
mi->info.flags &= ~CAMEL_MESSAGE_SEEN;
if (item_status & E_GW_ITEM_STAT_REPLIED)
- status_flags |= CAMEL_MESSAGE_ANSWERED;
- if (exists)
- mi->info.flags |= status_flags;
- else
- mi->info.flags = status_flags;
+ mi->info.flags |= CAMEL_MESSAGE_ANSWERED;
priority = e_gw_item_get_priority (item);
if (priority && !(g_ascii_strcasecmp (priority,"High"))) {
@@ -1468,6 +1469,7 @@
}
}
+ mi->info.dirty = TRUE;
if (exists) {
camel_folder_change_info_change_uid (changes, mi->info.uid);
camel_message_info_free (pmi);
@@ -1475,12 +1477,7 @@
mi->info.uid = camel_pstring_strdup (e_gw_item_get_id(item));
mi->info.size = e_gw_item_get_mail_size (item);
mi->info.subject = camel_pstring_strdup(e_gw_item_get_subject(item));
- mi->info.dirty = TRUE;
- folder->summary->visible_count ++;
- if (!(mi->info.flags & CAMEL_MESSAGE_SEEN))
- folder->summary->unread_count ++;
-
camel_folder_summary_add (folder->summary,(CamelMessageInfo *)mi);
camel_folder_change_info_add_uid (changes, mi->info.uid);
camel_folder_change_info_recent_uid (changes, mi->info.uid);
Index: servers/groupwise/e-gw-connection.c
===================================================================
--- servers/groupwise/e-gw-connection.c (revision 9858)
+++ servers/groupwise/e-gw-connection.c (revision 9859)
@@ -840,7 +840,7 @@
}
e_gw_message_write_string_parameter (msg, "uid", NULL, uid);
- e_gw_message_write_string_parameter (msg, "view", NULL, "count");
+ e_gw_message_write_string_parameter (msg, "view", NULL, "count unreadCount");
e_gw_message_write_footer (msg);
/* send message to server */
@@ -2772,7 +2772,7 @@
if (buffer && buf_length && atoi (buf_length) > 0) {
gsize len = atoi (buf_length) ;
- *attachment = g_base64_decode (buffer,&len) ;
+ *attachment = (char *) g_base64_decode (buffer,&len) ;
*attach_length = len ;
} else {
*attachment = NULL;

View File

@ -0,0 +1,137 @@
--- camel/providers/groupwise/camel-groupwise-folder.c
+++ camel/providers/groupwise/camel-groupwise-folder.c
@@ -229,8 +229,11 @@ groupwise_populate_details_from_item (CamelMimeMessage *msg, EGwItem *item)
time_t actual_time;
int offset = 0;
dtstring = e_gw_item_get_creation_date (item);
- time = e_gw_connection_get_date_from_string (dtstring);
- actual_time = camel_header_decode_date (ctime(&time), NULL);
+ if (dtstring) {
+ time = e_gw_connection_get_date_from_string (dtstring);
+ actual_time = camel_header_decode_date (ctime(&time), NULL);
+ } else
+ actual_time = (time_t) 0;
camel_mime_message_set_date (msg, actual_time, offset);
}
}
@@ -1270,7 +1273,7 @@ gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean
int folder_needs_caching;
- camel_object_get (folder, NULL, CAMEL_OFFLINE_FOLDER_ARG_SYNC_OFFLINE, &folder_needs_caching, NULL);
+ camel_object_get (folder, NULL, CAMEL_OFFLINE_FOLDER_SYNC_OFFLINE, &folder_needs_caching, NULL);
changes = camel_folder_change_info_new ();
container_id = g_strdup (camel_groupwise_store_container_id_lookup (gw_store, folder->full_name));
@@ -1449,8 +1452,12 @@ gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean
time_t time;
time_t actual_time;
temp_date = e_gw_item_get_creation_date (item);
- time = e_gw_connection_get_date_from_string (temp_date);
- actual_time = camel_header_decode_date (ctime(&time), NULL);
+ if (temp_date) {
+ /* Creation date can be returned as null for auto-generated meetings */
+ time = e_gw_connection_get_date_from_string (temp_date);
+ actual_time = camel_header_decode_date (ctime(&time), NULL);
+ } else
+ actual_time = (time_t) 0;
mi->info.date_sent = mi->info.date_received = actual_time;
}
}
@@ -1670,8 +1677,11 @@ gw_update_summary ( CamelFolder *folder, GList *list,CamelException *ex)
time_t time;
time_t actual_time;
temp_date = e_gw_item_get_creation_date (item);
- time = e_gw_connection_get_date_from_string (temp_date);
- actual_time = camel_header_decode_date (ctime(&time), NULL);
+ if (temp_date) {
+ time = e_gw_connection_get_date_from_string (temp_date);
+ actual_time = camel_header_decode_date (ctime(&time), NULL);
+ } else
+ actual_time = (time_t) 0;
mi->info.date_sent = mi->info.date_received = actual_time;
}
}
--- servers/groupwise/e-gw-item.c
+++ servers/groupwise/e-gw-item.c
@@ -307,6 +307,11 @@ e_gw_item_dispose (GObject *object)
priv->classification = NULL;
}
+ if (priv->security) {
+ g_free (priv->security);
+ priv->security = NULL;
+ }
+
if (priv->accept_level) {
g_free (priv->accept_level);
priv->accept_level = NULL;
--- servers/groupwise/e-gw-connection.c
+++ servers/groupwise/e-gw-connection.c
@@ -1813,39 +1813,41 @@ e_gw_connection_get_server_time (EGwConnection *cnc)
static time_t
timet_from_string (const char *str)
{
- struct tm date;
- int len, i;
+ struct tm date;
+ int len, i;
- g_return_val_if_fail (str != NULL, -1);
+ g_return_val_if_fail (str != NULL, -1);
- /* yyyymmdd[Thhmmss[Z]] */
- len = strlen (str);
+ /* yyyymmdd[Thhmmss[Z]] */
+ len = strlen (str);
- if (!(len == 8 || len == 15 || len == 16))
- return -1;
+ if (!(len == 8 || len == 15 || len == 16))
+ return -1;
- for (i = 0; i < len; i++)
- if (!((i != 8 && i != 15 && isdigit (str[i]))
- || (i == 8 && str[i] == 'T')
- || (i == 15 && str[i] == 'Z')))
- return -1;
+ for (i = 0; i < len; i++)
+ if (!((i != 8 && i != 15 && isdigit (str[i]))
+ || (i == 8 && str[i] == 'T')
+ || (i == 15 && str[i] == 'Z')))
+ return -1;
#define digit_at(x,y) (x[y] - '0')
- date.tm_year = digit_at (str, 0) * 1000
- + digit_at (str, 1) * 100
- + digit_at (str, 2) * 10
- + digit_at (str, 3) -1900;
- date.tm_mon = digit_at (str, 4) * 10 + digit_at (str, 5) -1;
- date.tm_mday = digit_at (str, 6) * 10 + digit_at (str, 7);
- if (len > 8) {
- date.tm_hour = digit_at (str, 9) * 10 + digit_at (str, 10);
- date.tm_min = digit_at (str, 11) * 10 + digit_at (str, 12);
- date.tm_sec = digit_at (str, 13) * 10 + digit_at (str, 14);
- } else
- date.tm_hour = date.tm_min = date.tm_sec = 0;
+ date.tm_year = digit_at (str, 0) * 1000
+ + digit_at (str, 1) * 100
+ + digit_at (str, 2) * 10
+ + digit_at (str, 3) -1900;
+ date.tm_mon = digit_at (str, 4) * 10 + digit_at (str, 5) -1;
+ date.tm_mday = digit_at (str, 6) * 10 + digit_at (str, 7);
+ if (len > 8) {
+ date.tm_hour = digit_at (str, 9) * 10 + digit_at (str, 10);
+ date.tm_min = digit_at (str, 11) * 10 + digit_at (str, 12);
+ date.tm_sec = digit_at (str, 13) * 10 + digit_at (str, 14);
+ } else
+ date.tm_hour = date.tm_min = date.tm_sec = 0;
+
+ date.tm_wday = date.tm_yday = date.tm_isdst = 0;
- return mktime (&date);
+ return mktime (&date);
}
char *

View File

@ -0,0 +1,27 @@
--- addressbook/libedata-book/e-book-backend.c
+++ addressbook/libedata-book/e-book-backend.c
@@ -476,12 +476,21 @@ book_destroy_cb (gpointer data, GObject *where_book_was)
e_book_backend_remove_client (backend, (EDataBook *)where_book_was);
}
-static void
-listener_died_cb (gpointer cnx, gpointer user_data)
+static gboolean
+idle_remove_client (gpointer data)
{
- EDataBook *book = E_DATA_BOOK (user_data);
+ EDataBook *book = (EDataBook *) data;
e_book_backend_remove_client (e_data_book_get_backend (book), book);
+ g_object_unref ((GObject *) book);
+
+ return FALSE;
+}
+static void
+listener_died_cb (gpointer cnx, gpointer user_data)
+{
+ g_object_ref ((GObject *)user_data);
+ g_idle_add (idle_remove_client, user_data);
}
static void

View File

@ -0,0 +1,13 @@
Index: camel/providers/groupwise/camel-groupwise-provider.c
===================================================================
--- camel/providers/groupwise/camel-groupwise-provider.c (revision 9852)
+++ camel/providers/groupwise/camel-groupwise-provider.c (working copy)
@@ -73,7 +73,7 @@
N_("SOAP Settings") },
{ CAMEL_PROVIDER_CONF_ENTRY, "soap_port", NULL,
- N_("Post Office Agent SOAP Port:"), "7191" },
+ N_("Post Office Agent SOAP _Port:"), "7191" },
{ CAMEL_PROVIDER_CONF_HIDDEN, "auth-domain", NULL,
NULL, "Groupwise" },

View File

@ -0,0 +1,33 @@
--- camel/providers/groupwise/camel-groupwise-store.c 2008-12-23 09:25:44.000000000 +0100
+++ camel/providers/groupwise/camel-groupwise-store.c 2008-12-23 09:38:58.000000000 +0100
@@ -1430,6 +1430,17 @@
return NULL;
}
+static gboolean
+groupwise_can_refresh_folder (CamelStore *store, CamelFolderInfo *info, CamelException *ex)
+{
+ gboolean res;
+
+ res = CAMEL_STORE_CLASS(parent_class)->can_refresh_folder (store, info, ex) ||
+ (camel_url_get_param (((CamelService *)store)->url, "check_all") != NULL);
+
+ return res;
+}
+
/*
* Function to check if we are both connected and are _actually_
* online. Based on an equivalient function in IMAP
@@ -1498,6 +1509,7 @@
camel_store_class->get_folder_info = groupwise_get_folder_info;
camel_store_class->free_folder_info = camel_store_free_folder_info_full;
camel_store_class->get_trash = groupwise_get_trash;
+ camel_store_class->can_refresh_folder = groupwise_can_refresh_folder;
}
@@ -1597,3 +1609,4 @@
return camel_groupwise_store_type;
}
+

View File

@ -0,0 +1,17 @@
--- camel/providers/groupwise/camel-groupwise-summary.c.orig 2008-12-31 14:53:07.000000000 +0100
+++ camel/providers/groupwise/camel-groupwise-summary.c 2008-12-31 15:05:26.000000000 +0100
@@ -317,8 +317,13 @@
guint32 type=0;
if (part) {
- EXTRACT_FIRST_DIGIT (type);
+ if (*part == ' ')
+ part++;
+ if (part) {
+ EXTRACT_FIRST_DIGIT (type);
+ }
}
+ mir->cinfo = part;
if (type)
return camel_groupwise_summary_parent->content_info_from_db (s, mir);
else

View File

@ -0,0 +1,27 @@
--- camel/providers/groupwise/camel-groupwise-folder.c
+++ camel/providers/groupwise/camel-groupwise-folder.c
@@ -212,12 +212,24 @@ groupwise_folder_get_message( CamelFolder *folder, const char *uid, CamelExcepti
static void
groupwise_populate_details_from_item (CamelMimeMessage *msg, EGwItem *item)
{
+ EGwItemType type;
char *dtstring = NULL;
char *temp_str = NULL;
temp_str = (char *)e_gw_item_get_subject(item);
if(temp_str)
camel_mime_message_set_subject (msg, temp_str);
+ type = e_gw_item_get_item_type (item);
+
+ if (type == E_GW_ITEM_TYPE_APPOINTMENT || type == E_GW_ITEM_TYPE_NOTE) {
+ int offset = 0;
+ dtstring = e_gw_item_get_start_date (item);
+ time_t time = e_gw_connection_get_date_from_string (dtstring);
+ time_t actual_time = camel_header_decode_date (ctime(&time), &offset);
+ camel_mime_message_set_date (msg, actual_time, offset);
+ return;
+ }
+
dtstring = e_gw_item_get_delivered_date (item);
if(dtstring) {
int offset = 0;

View File

@ -1,3 +1,36 @@
-------------------------------------------------------------------
Wed Jan 7 06:57:24 CET 2009 - abharath@suse.de
- Patches added
+ bgo#559153 - bgo-559153-eds-migration.patch - Migration patches
in EDS.
+ bnc#440265 - bnc-440265-gw-contacts.patch - Groupwise Address
Book Contact Lists Are Not Saved.
+ bnc#442507 - bnc-442507-imap-parts-sync.patch - Folder index
creation after crash takes ages.
+ bnc#455939 - bnc-455939-eds-deadlock.patch - Disconnecting from
the network caused e-d-s deadlock ...
+ bnc#443544 - bnc-443544-eds-free-busy.patch - Evolution busy
search on GW resource object does not display
unavailable times.
+ bnc#209514 - bnc-209514-gw-missing-mails.patch - Evolution
Groupwise missing mails.
+ bnc#446290 - bnc-446290-gw-counts-issues.patch - GW Parallel
clients & (un)read counts problems.
+ bnc#458127 - bnc-458127-keyboard-shortcut-port.patch - No
keyboard short cut for SOAP port in Evolution.
+ bnc#462575 - bnc-462575-gw-refresh-folders.patch - "Check for
new messages in all folders" setting for GW SOAP.
+ bnc#448079 - bnc-448079-gw-memory-issues.patch - evolution
2.24.1.1 is very unstable
+ bnc#463095 - bnc-463095-content-info-from-db.patch - Evolution
hangs on "Generating message list..."
+ bnc#439986 - bnc-439986-show-time-free.patch - Show Time As Free
Option Doesn't Immediately Refresh Calendar.
+ bnc#463653 - bnc-463653-msg-list-meeting-time.patch - Evolution
displays the wrong time for an appointment in the
message list.
-------------------------------------------------------------------
Thu Dec 4 12:05:08 CET 2008 - abharath@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package evolution-data-server (Version 2.24.1.1)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -57,7 +57,7 @@ Obsoletes: evolution-data-server-32bit
%endif
Summary: Evolution Data Server
Version: 2.24.1.1
Release: 4
Release: 5
Source0: ftp://ftp.gnome.org/pub/gnome/sources/evolution-data-server/2.24/%{name}-%{version}.tar.bz2
# PATCH-FIX-UPSTREAM evolution-data-server-1.11.5-cert-auth-complete.patch bgo253574 -- Fix has been submitted to bgo.
Patch3: evolution-data-server-1.11.5-cert-auth-complete.patch
@ -71,7 +71,7 @@ Patch6: bnc-441763-show-meeting-icon.patch
Patch7: dice-eds-changes.patch
# PATCH-FIX-UPSTREAM bnc-431133-unread-mail-empty.patch bnc431133 bgo546637 sragavan@novell.com -- Fix has been submitted upstream.
Patch8: bnc-431133-unread-mail-empty.patch
# PATCH-FIX-UPSTREAM bnc-435599-junk-contacts-created.patch bnc435599 shashish@novell.com -- Patch yet to be pushed upstream.
# PATCH-FIX-UPSTREAM bnc-435599-junk-contacts-created.patch bnc435599 shashish@novell.com -- Patch is part of GNOME 2.25.5 release.
Patch9: bnc-435599-junk-contacts-created.patch
# PATCH-FIX-UPSTREAM bnc-441347-imap-performance-fix.patch bnc441347 bgo558883 -- Fix has been submitted upstream.
Patch10: bnc-441347-imap-performance-fix.patch
@ -87,22 +87,48 @@ Patch14: bnc-446372-fix-empty-trash.patch
Patch15: bnc-446373-fix-refresh-vfolderquery.patch
# PATCH-FIX-UPSTREAM bnc-210959-eds-accept_ics.patch bnc210959 pchenthill@novell.com -- Patch yet to be pushed upstream.
Patch16: bnc-210959-eds-accept_ics.patch
# PATCH-FIX-UPSTREAM bnc-438730-loosing-more-state.patch bnc438730 sragavan@novell.com -- Patch yet to be pushed upstream.
# PATCH-FIX-UPSTREAM bnc-438730-loosing-more-state.patch bnc438730 sragavan@novell.com -- Fix has been submitted upstream.
Patch17: bnc-438730-loosing-more-state.patch
# PATCH-FEATURE-OPENSUSE evolution-data-server-shared-nss-db.patch hpj@novell.com -- Migrate to shared NSS database.
Patch18: evolution-data-server-shared-nss-db.patch
# PATCH-FIX-UPSTREAM eds-comp-percent.diff pchenthill@suse.de -- Wrapper function to get percent as int. Needed for sharepoint connector. Will be pushed upstream.
Patch19: eds-comp-percent.diff
# PATCH-FIX-UPSTREAM bnc-440265-list-not-saved.patch bnc440265 sragavan@novell.com -- Patch yet to be pushed upstream.
# PATCH-FIX-UPSTREAM bnc-440265-list-not-saved.patch bnc440265 sragavan@novell.com -- Patch is part of GNOME 2.25.5 release.
Patch20: bnc-440265-list-not-saved.patch
# PATCH-FIX-UPSTREAM bnc-447121-gw-memory-crasher.patch bnc447121 sragavan@novell.com -- Patch yet to be pushed upstream.
# PATCH-FIX-UPSTREAM bnc-447121-gw-memory-crasher.patch bnc447121 sragavan@novell.com -- Patch is part of GNOME 2.25.5 release.
Patch21: bnc-447121-gw-memory-crasher.patch
# PATCH-FIX-UPSTREAM bnc-449916-task-memo-description.patch bnc449916 abharath@suse.de -- Patch yet to be pushed upstream.
# PATCH-FIX-UPSTREAM bnc-449916-task-memo-description.patch bnc449916 abharath@suse.de -- Patch is part of GNOME 2.25.5 release.
Patch22: bnc-449916-task-memo-description.patch
# PATCH-FIX-UPSTREAM bgo-562228-eds-mailbox-field.patch bgo562228 -- Fix has been submitted upstream.
Patch23: bgo-562228-eds-mailbox-field.patch
# PATCH-FIX-UPSTREAM bnc-435632-moving-contacts-crash.patch bnc435632 sragavan@novell.com -- Patch yet to be pushed upstream.
# PATCH-FIX-UPSTREAM bnc-435632-moving-contacts-crash.patch bnc435632 sragavan@novell.com -- Patch is part of GNOME 2.25.5 release.
Patch24: bnc-435632-moving-contacts-crash.patch
# PATCH-FIX-UPSTREAM bgo-559153-eds-migration.patch bgo559153 psankar@suse.de -- Patch is part of GNOME 2.25.5 release.
Patch25: bgo-559153-eds-migration.patch
# PATCH-FIX-UPSTREAM bnc-440265-gw-contacts.patch bnc440265 sragavan@novell.com -- Patch is part of GNOME 2.25.5 release.
Patch26: bnc-440265-gw-contacts.patch
# PATCH-FIX-UPSTREAM bnc-442507-imap-parts-sync.patch bnc442507 -- Patch is part of GNOME 2.25.5 release.
Patch27: bnc-442507-imap-parts-sync.patch
# PATCH-FIX-UPSTREAM bnc-455939-eds-deadlock.patch bnc455939 sragavan@novell.com -- Patch is part of GNOME 2.25.5 release.
Patch28: bnc-455939-eds-deadlock.patch
# PATCH-FIX-UPSTREAM bnc-443544-eds-free-busy.patch bnc443544 abharath@suse.de -- Patch is part of GNOME 2.25.5 release.
Patch29: bnc-443544-eds-free-busy.patch
# PATCH-FIX-UPSTREAM bnc-209514-gw-missing-mails.patch bnc209514 psankar@suse.de -- Patch is part of GNOME 2.25.5 release.
Patch30: bnc-209514-gw-missing-mails.patch
# PATCH-FIX-UPSTREAM bnc-446290-gw-counts-issues.patch bnc446290 psankar@suse.de -- Patch is part of GNOME 2.25.5 release.
Patch31: bnc-446290-gw-counts-issues.patch
# PATCH-FIX-UPSTREAM bnc-458127-keyboard-shortcut-port.patch bnc458127 shashish@novell.com -- Patch is part of GNOME 2.25.5 release.
Patch32: bnc-458127-keyboard-shortcut-port.patch
# PATCH-FIX-UPSTREAM bnc-462575-gw-refresh-folders.patch bnc462575 sbrys@novell.com -- Patch is part of GNOME 2.25.5 release.
Patch33: bnc-462575-gw-refresh-folders.patch
# PATCH-FIX-UPSTREAM bnc-448079-gw-memory-issues.patch bnc448079 psankar@suse.de -- Patch is part of GNOME 2.25.5 release.
Patch34: bnc-448079-gw-memory-issues.patch
# PATCH-FIX-UPSTREAM bnc-463095-content-info-from-db.patch bnc463095 sbrys@novell.com -- Yet to be pushed upstream.
Patch35: bnc-463095-content-info-from-db.patch
# PATCH-FIX-UPSTREAM bnc-439986-show-time-free.patch bnc439986 pchenthill@suse.de -- Patch is part of GNOME 2.25.5 release.
Patch36: bnc-439986-show-time-free.patch
# PATCH-FIX-UPSTREAM bnc-463653-msg-list-meeting-time.patch bnc463653 pchenthill@suse.de -- Patch is part of GNOME 2.25.5 release.
Patch37: bnc-463653-msg-list-meeting-time.patch
# PATCH-FIX-OPENSUSE eds-core-mapi-changes.diff msuman@suse.de -- This patch contains changes in the core code base for the MAPI provider.
Patch100: eds-core-mapi-changes.diff
Url: http://www.gnome.org
@ -194,6 +220,19 @@ documentation.
%patch22
%patch23
%patch24
%patch25
%patch26
%patch27
%patch28
%patch29
%patch30
%patch31
%patch32
%patch33
%patch34
%patch35
%patch36
%patch37
%patch100 -p1
%build
@ -266,6 +305,36 @@ echo -e "#!/bin/sh\n\nLD_LIBRARY_PATH=%{_libdir}/evoldap/lib MONO_PATH=%{_libdir
%{_datadir}/gtk-doc/html/*
%changelog
* Wed Jan 07 2009 abharath@suse.de
- Patches added
+ bgo#559153 - bgo-559153-eds-migration.patch - Migration patches
in EDS.
+ bnc#440265 - bnc-440265-gw-contacts.patch - Groupwise Address
Book Contact Lists Are Not Saved.
+ bnc#442507 - bnc-442507-imap-parts-sync.patch - Folder index
creation after crash takes ages.
+ bnc#455939 - bnc-455939-eds-deadlock.patch - Disconnecting from
the network caused e-d-s deadlock ...
+ bnc#443544 - bnc-443544-eds-free-busy.patch - Evolution busy
search on GW resource object does not display
unavailable times.
+ bnc#209514 - bnc-209514-gw-missing-mails.patch - Evolution
Groupwise missing mails.
+ bnc#446290 - bnc-446290-gw-counts-issues.patch - GW Parallel
clients & (un)read counts problems.
+ bnc#458127 - bnc-458127-keyboard-shortcut-port.patch - No
keyboard short cut for SOAP port in Evolution.
+ bnc#462575 - bnc-462575-gw-refresh-folders.patch - "Check for
new messages in all folders" setting for GW SOAP.
+ bnc#448079 - bnc-448079-gw-memory-issues.patch - evolution
2.24.1.1 is very unstable
+ bnc#463095 - bnc-463095-content-info-from-db.patch - Evolution
hangs on "Generating message list..."
+ bnc#439986 - bnc-439986-show-time-free.patch - Show Time As Free
Option Doesn't Immediately Refresh Calendar.
+ bnc#463653 - bnc-463653-msg-list-meeting-time.patch - Evolution
displays the wrong time for an appointment in the
message list.
* Thu Dec 04 2008 abharath@suse.de
- Patches added
+ bnc#440265 - bnc-440265-list-not-saved.patch - Groupwise