summaryrefslogtreecommitdiff
path: root/camel
diff options
context:
space:
mode:
authorJP Rosevear <jpr@src.gnome.org>2005-03-15 01:35:28 +0000
committerJP Rosevear <jpr@src.gnome.org>2005-03-15 01:35:28 +0000
commitac126595201477b8a874848b041d1022a805e3b6 (patch)
tree2623aabfc00adc141e9c19e06be8c2299b594ad4 /camel
parentdadcace5aa5ced29dc7fde44983d96bdc6305c8f (diff)
downloadevolution-data-server-ac126595201477b8a874848b041d1022a805e3b6.tar.gz
Merge from head for 1.2.1
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog35
-rw-r--r--camel/camel-filter-driver.c7
-rw-r--r--camel/camel-mime-message.c24
-rw-r--r--camel/camel-mime-utils.c7
-rw-r--r--camel/providers/groupwise/ChangeLog50
-rw-r--r--camel/providers/groupwise/camel-groupwise-folder.c138
-rw-r--r--camel/providers/groupwise/camel-groupwise-store.c15
-rw-r--r--camel/providers/groupwise/camel-groupwise-summary.c4
-rw-r--r--camel/providers/groupwise/camel-groupwise-utils.c16
-rw-r--r--camel/providers/imap/ChangeLog14
-rw-r--r--camel/providers/imap/camel-imap-folder.c4
-rw-r--r--camel/providers/imap/camel-imap-store.c4
-rw-r--r--camel/tests/misc/Makefile.am5
-rw-r--r--camel/tests/misc/README1
-rw-r--r--camel/tests/misc/test1.c58
15 files changed, 291 insertions, 91 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 0b4135354..c360f9788 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -3,6 +3,41 @@
* tests/misc/test2.c: fix the case of the charset specification,
now we properly canonicalise them.
+2005-03-01 Not Zed <NotZed@Ximian.com>
+
+ ** See bug #73015
+
+ * tests/misc/test1.c: Test case for references decoding.
+
+ * camel-mime-utils.c (header_decode_addrspec): if we get no start
+ word, then return NULL not "".
+
+2005-03-02 Not Zed <NotZed@Ximian.com>
+
+ ** See bug #70195
+
+ * camel-mime-utils.c (rfc2047_encode_word): if we fail to convert
+ all the buffer, skip the content we didn't convert - don't just
+ skip the number of bytes we didn't convert from the start of the
+ string.
+ (header_encode_phrase_merge_words): when we merge the word, make
+ sure we merge the encoding too.
+
+2005-03-02 Not Zed <NotZed@Ximian.com>
+
+ ** See bug #70590 (again)
+
+ * camel-filter-driver.c (camel_filter_driver_filter_message):
+ don't drop to default folder if we moved it.
+ (do_move): mark moved, not copied.
+
+2005-03-01 Not Zed <NotZed@Ximian.com>
+
+ ** See bug #72876
+
+ * camel-mime-message.c (process_header): if there are no addresses
+ in from or reply-to header, don't save empty address list.
+
2005-02-28 Not Zed <NotZed@Ximian.com>
** See bug #72609
diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c
index 8a92efe5d..a5a87e8f3 100644
--- a/camel/camel-filter-driver.c
+++ b/camel/camel-filter-driver.c
@@ -106,6 +106,7 @@ struct _CamelFilterDriverPrivate {
gboolean terminated; /* message processing was terminated */
gboolean deleted; /* message was marked for deletion */
gboolean copied; /* message was copied to some folder or another */
+ gboolean moved; /* message was moved to some folder or another */
CamelMimeMessage *message; /* input message */
CamelMessageInfo *info; /* message summary info */
@@ -553,8 +554,7 @@ do_move (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriv
}
if (!camel_exception_is_set (p->ex)) {
- /* a 'move' is a copy & delete */
- p->copied = TRUE;
+ p->moved = TRUE;
camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Move to folder %s", folder);
}
}
@@ -1413,6 +1413,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
p->terminated = FALSE;
p->deleted = FALSE;
p->copied = FALSE;
+ p->moved = FALSE;
p->message = message;
p->info = info;
p->uid = uid;
@@ -1479,7 +1480,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
}
/* Logic: if !Moved and there exists a default folder... */
- if (!(p->copied && p->deleted) && p->defaultfolder) {
+ if (!(p->copied && p->deleted) && !p->moved && p->defaultfolder) {
/* copy it to the default inbox */
filtered = TRUE;
camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Copy to default folder");
diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c
index 363380690..528a0150d 100644
--- a/camel/camel-mime-message.c
+++ b/camel/camel-mime-message.c
@@ -525,16 +525,24 @@ process_header (CamelMedium *medium, const char *name, const char *value)
header_type = (CamelHeaderType) g_hash_table_lookup (header_name_table, name);
switch (header_type) {
case HEADER_FROM:
- if (message->from)
- camel_object_unref (message->from);
- message->from = camel_internet_address_new ();
- camel_address_decode (CAMEL_ADDRESS (message->from), value);
+ addr = camel_internet_address_new();
+ if (camel_address_decode((CamelAddress *)addr, value) <= 0) {
+ camel_object_unref(addr);
+ } else {
+ if (message->from)
+ camel_object_unref(message->from);
+ message->from = addr;
+ }
break;
case HEADER_REPLY_TO:
- if (message->reply_to)
- camel_object_unref (message->reply_to);
- message->reply_to = camel_internet_address_new ();
- camel_address_decode (CAMEL_ADDRESS (message->reply_to), value);
+ addr = camel_internet_address_new();
+ if (camel_address_decode((CamelAddress *)addr, value) <= 0) {
+ camel_object_unref(addr);
+ } else {
+ if (message->reply_to)
+ camel_object_unref(message->reply_to);
+ message->reply_to = addr;
+ }
break;
case HEADER_SUBJECT:
g_free (message->subject);
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index 6df5ed49f..78f5becae 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -1233,7 +1233,7 @@ rfc2047_encode_word(GString *outstring, const char *in, size_t len, const char *
if (e_iconv (ic, &inptr, &convlen, &out, &outlen) == (size_t) -1 && errno != EINVAL) {
w(g_warning("Conversion problem: conversion truncated: %s", strerror (errno)));
/* blah, we include it anyway, better than infinite loop ... */
- inptr = p + convlen;
+ inptr += convlen;
} else {
/* make sure we flush out any shift state */
e_iconv (ic, NULL, 0, &out, &outlen);
@@ -1536,7 +1536,7 @@ header_encode_phrase_merge_words (GList **wordsp)
if (MERGED_WORD_LT_FOLDLEN (next->end - word->start, MAX (word->type, next->type))) {
/* the resulting word type is the MAX of the 2 types */
word->type = MAX(word->type, next->type);
-
+ word->encoding = MAX(word->encoding, next->encoding);
word->end = next->end;
words = g_list_remove_link (words, nextl);
g_list_free_1 (nextl);
@@ -2102,6 +2102,9 @@ header_decode_addrspec(const char **in)
}
} else {
w(g_warning("invalid addr-spec, no local part"));
+ g_string_free(addr, TRUE);
+
+ return NULL;
}
/* FIXME: return null on error? */
diff --git a/camel/providers/groupwise/ChangeLog b/camel/providers/groupwise/ChangeLog
index 249c058de..755987d43 100644
--- a/camel/providers/groupwise/ChangeLog
+++ b/camel/providers/groupwise/ChangeLog
@@ -1,3 +1,24 @@
+2005-03-11 Parthasarathi Susarla <sparthasarathi@novell.com>
+
+ * camel-groupwise-folder.c:
+ (gw_update_summary): using GString. An efficient way
+ for fixing bug #72145
+
+2005-03-10 Parthasarathi Susarla <sparthasarathi@novell.com>
+
+ * camel-groupwise-store.c:
+ (groupwise_get_folder): add peek and status views to
+ the creatCursorRequest
+ * camel-groupwise-folder.c:
+ (gw_update_summary): initialise the status flag
+ variable.
+ *** Fixes bug #73308
+
+2005-03-09 Sankar P <psankar@novell.com>
+
+ * camel-groupwise-utils.c:(camel_groupwise_util_item_from_message)
+ Added code to fix the problem of Priority not set in outgoing mails
+
2005-03-07 JP Rosevear <jpr@novell.com>
From Dave Malcolm <dmalcolm@redhat.com>
@@ -5,6 +26,35 @@
* camel-groupwise-store-summary.c
(camel_groupwise_store_summary_namespace_set): move forward
declaration out of block
+
+2005-03-03 Parthasarathi Susarla <sparthasarathi@novell.com>
+
+ * camel-groupwise-store.c:
+ (groupwise_get_folder): added recipient view
+ for get quick messages
+ * camel-groupwise-folder.c:
+ (groupwise_refresh_info): added recipient view
+ for get quick messages
+ (gw_update_summary): parse the recipient list
+ for mail ids to be set in the "To" field of the
+ summary.
+ ** Fixes # 72145
+
+2005-03-03 Vivek Jain <jvivek@novell.com>
+
+ ***Fixes # 72455
+ #73231
+ #73239
+ * camel-groupwise-folder.c :(gw_update_summary)
+ initialize status_flags to 0
+
+2005-03-02 Vivek Jain <jvivek@novell.com>
+
+ ***Fixes # 72373
+ * camel-groupwise-store.c :(groupwise_get_folder)
+ * camel-groupwise_folder.c :(groupwise_refresh_info)
+ pass types as NULL in the call of e_gw_connection_get_quick_messages
+ to retrieve all the items
2005-02-28 Parthasarathi Susarla <sparthasarathi@novell.com>
diff --git a/camel/providers/groupwise/camel-groupwise-folder.c b/camel/providers/groupwise/camel-groupwise-folder.c
index 4a0ab248a..0e55175e5 100644
--- a/camel/providers/groupwise/camel-groupwise-folder.c
+++ b/camel/providers/groupwise/camel-groupwise-folder.c
@@ -93,12 +93,10 @@ groupwise_folder_get_message( CamelFolder *folder,
EGwConnectionStatus status ;
EGwConnection *cnc ;
EGwItem *item ;
- char *dtstring ;
+ char *dtstring = NULL;
CamelStream *stream, *cache_stream;
CamelMultipart *multipart ;
int errno;
- GList *read_items = NULL ;
- guint32 item_status ;
struct _camel_header_address *ha;
char *subs_email;
struct _camel_header_address *to_list = NULL, *cc_list = NULL, *bcc_list=NULL;
@@ -392,12 +390,6 @@ groupwise_folder_get_message( CamelFolder *folder,
camel_object_unref (multipart) ;
- item_status = e_gw_item_get_item_status (item);
- if ( !(item_status & E_GW_ITEM_STAT_READ)) {
- read_items = g_list_append (read_items, (char *)uid) ;
- e_gw_connection_mark_read (cnc, read_items) ;
- }
-
g_object_unref (item) ;
if (body)
@@ -626,13 +618,14 @@ groupwise_refresh_info(CamelFolder *folder, CamelException *ex)
CamelGroupwiseStore *gw_store = CAMEL_GROUPWISE_STORE (folder->parent_store) ;
CamelGroupwiseFolder *gw_folder = CAMEL_GROUPWISE_FOLDER (folder) ;
CamelGroupwiseStorePrivate *priv = gw_store->priv ;
+ CamelGroupwiseSummary *summary = (CamelGroupwiseSummary *)folder->summary;
EGwConnection *cnc = cnc_lookup (priv) ;
int status ;
GList *list = NULL;
GSList *slist = NULL, *sl ;
char *container_id = NULL ;
char *time_string = NULL, *t_str = NULL ;
-
+
container_id = g_strdup (camel_groupwise_store_container_id_lookup (gw_store, folder->name)) ;
if (!container_id) {
g_print ("\nERROR - Container id not present. Cannot refresh info\n") ;
@@ -654,10 +647,9 @@ groupwise_refresh_info(CamelFolder *folder, CamelException *ex)
CAMEL_SERVICE_LOCK (gw_store, connect_lock);
/* FIXME send the time stamp which the server sends */
status = e_gw_connection_get_quick_messages (cnc, container_id,
- "distribution created attachments subject",
- &t_str, "New", "Mail", NULL, -1, &slist) ;
+ "peek recipient distribution created attachments subject status",
+ &t_str, "New", NULL, 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);
@@ -665,6 +657,12 @@ groupwise_refresh_info(CamelFolder *folder, CamelException *ex)
return ;
}
+ /* 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) ;
}
@@ -673,8 +671,8 @@ groupwise_refresh_info(CamelFolder *folder, CamelException *ex)
t_str = g_strdup (time_string);
/* FIXME send the time stamp which the server sends */
status = e_gw_connection_get_quick_messages (cnc, container_id,
- "distribution created attachments subject",
- &t_str, "Modified", "Mail", NULL, -1, &slist) ;
+ "peek recipient distribution created attachments subject status",
+ &t_str, "Modified", NULL, 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"));
@@ -710,9 +708,11 @@ gw_update_summary ( CamelFolder *folder, GList *item_list,CamelException *ex)
CamelGroupwiseMessageInfo *mi = NULL;
GPtrArray *msg ;
GSList *attach_list = NULL ;
- guint32 item_status, status_flags;
+ guint32 item_status, status_flags = 0;
CamelFolderChangeInfo *changes = NULL ;
int scount ;
+ gboolean exists = FALSE ;
+ GString *str = g_string_new (NULL);
// CAMEL_SERVICE_ASSERT_LOCKED (gw_store, connect_lock);
@@ -727,21 +727,15 @@ gw_update_summary ( CamelFolder *folder, GList *item_list,CamelException *ex)
EGwItemOrganizer *org ;
char *date = NULL, *temp_date = NULL ;
const char *id ;
+ GSList *recp_list = NULL ;
+ status_flags = 0;
id = e_gw_item_get_id (item) ;
mi = (CamelGroupwiseMessageInfo *)camel_folder_summary_uid (folder->summary, id) ;
+ if (mi)
+ exists = TRUE ;
- if (mi) {
- /*Message exists*/
- item_status = e_gw_item_get_item_status (item);
- /*if (item_status & E_GW_ITEM_STAT_DELETED)
- status_flags |= CAMEL_MESSAGE_DELETED;*/
- if (item_status & E_GW_ITEM_STAT_REPLIED)
- status_flags |= CAMEL_MESSAGE_ANSWERED;
- mi->info.flags |= status_flags;
- camel_folder_change_info_change_uid (changes, e_gw_item_get_id (item)) ;
- } else {
- /*New message*/
+ if (!exists) {
mi = camel_message_info_new (folder->summary) ;
if (mi->info.content == NULL) {
mi->info.content = camel_folder_summary_content_info_new (folder->summary);
@@ -749,51 +743,73 @@ gw_update_summary ( CamelFolder *folder, GList *item_list,CamelException *ex)
}
type = e_gw_item_get_item_type (item) ;
-
-
- if (type == E_GW_ITEM_TYPE_CONTACT) {
- continue ;
-
- } else if (type == E_GW_ITEM_TYPE_UNKNOWN)
+ if ((type == E_GW_ITEM_TYPE_CONTACT) || (type == E_GW_ITEM_TYPE_UNKNOWN)) {
+ exists = FALSE;
continue ;
-
- status_flags = 0;
- item_status = e_gw_item_get_item_status (item);
- if (item_status & E_GW_ITEM_STAT_READ)
- status_flags |= CAMEL_MESSAGE_SEEN;
- /*if (item_status & E_GW_ITEM_STAT_DELETED)
- status_flags |= CAMEL_MESSAGE_DELETED;*/
- if (item_status & E_GW_ITEM_STAT_REPLIED)
- status_flags |= CAMEL_MESSAGE_ANSWERED;
- mi->info.flags |= status_flags;
-
- attach_list = e_gw_item_get_attach_id_list (item) ;
- if (attach_list)
- mi->info.flags |= CAMEL_MESSAGE_ATTACHMENTS;
-
- org = e_gw_item_get_organizer (item) ;
- if (org) {
- mi->info.from = g_strconcat(org->display_name,"<",org->email,">",NULL) ;
- mi->info.to = g_strdup(e_gw_item_get_to (item)) ;
}
- temp_date = e_gw_item_get_creation_date(item) ;
- if (temp_date) {
- time_t time = e_gw_connection_get_date_from_string (temp_date) ;
- time_t actual_time = camel_header_decode_date (ctime(&time), NULL) ;
- mi->info.date_sent = mi->info.date_received = actual_time ;
+ }
+
+ item_status = e_gw_item_get_item_status (item);
+ if (item_status & E_GW_ITEM_STAT_READ)
+ status_flags |= CAMEL_MESSAGE_SEEN;
+ /*if (item_status & E_GW_ITEM_STAT_DELETED)
+ status_flags |= CAMEL_MESSAGE_DELETED;*/
+ if (item_status & E_GW_ITEM_STAT_REPLIED)
+ status_flags |= CAMEL_MESSAGE_ANSWERED;
+ mi->info.flags |= status_flags;
+
+ attach_list = e_gw_item_get_attach_id_list (item) ;
+ if (attach_list)
+ mi->info.flags |= CAMEL_MESSAGE_ATTACHMENTS;
+
+ org = e_gw_item_get_organizer (item) ;
+ if (org) {
+ g_string_append_printf (str, "%s <%s>",org->display_name, org->email);
+ mi->info.from = camel_pstring_strdup (str->str);
+ }
+ g_string_truncate (str, 0);
+ recp_list = e_gw_item_get_recipient_list (item);
+ if (recp_list) {
+ GSList *rl;
+ int i = 0;
+ for (rl = recp_list; rl != NULL; rl = rl->next) {
+ EGwItemRecipient *recp = (EGwItemRecipient *) rl->data;
+ if (recp->type == E_GW_ITEM_RECIPIENT_TO) {
+ if (i)
+ str = g_string_append (str, ", ");
+ g_string_append_printf (str,"%s <%s>", recp->display_name, recp->email);
+ }
+ i++;
}
- mi->info.uid = g_strdup (e_gw_item_get_id (item)) ;
- mi->info.subject = g_strdup (e_gw_item_get_subject(item)) ;
+ mi->info.to = camel_pstring_strdup (str->str);
+ g_string_truncate (str, 0);
+ }
+ temp_date = e_gw_item_get_creation_date(item) ;
+ if (temp_date) {
+ time_t time = e_gw_connection_get_date_from_string (temp_date) ;
+ time_t actual_time = camel_header_decode_date (ctime(&time), NULL) ;
+ mi->info.date_sent = mi->info.date_received = actual_time ;
+ }
+ mi->info.uid = g_strdup(e_gw_item_get_id(item));
+
+ mi->info.subject = camel_pstring_strdup(e_gw_item_get_subject(item));
+
+ if (exists)
+ camel_folder_change_info_change_uid (changes, e_gw_item_get_id (item)) ;
+ else {
camel_folder_summary_add (folder->summary,(CamelMessageInfo *)mi) ;
camel_folder_change_info_add_uid (changes, mi->info.uid) ;
- g_ptr_array_add (msg, mi) ;
- g_free(date) ;
}
+
+ g_ptr_array_add (msg, mi) ;
+ g_free(date) ;
+ exists = FALSE ;
}
+ g_string_free (str, TRUE);
camel_object_trigger_event (folder, "folder_changed", changes) ;
/* for (seq=0 ; seq<msg->len ; seq++) {
if ( (mi = msg->pdata[seq]) )
diff --git a/camel/providers/groupwise/camel-groupwise-store.c b/camel/providers/groupwise/camel-groupwise-store.c
index 7d0e97e70..8364d1c03 100644
--- a/camel/providers/groupwise/camel-groupwise-store.c
+++ b/camel/providers/groupwise/camel-groupwise-store.c
@@ -543,7 +543,6 @@ groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags,
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 *t_str = NULL;
@@ -551,8 +550,8 @@ groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags,
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) ;
+ "peek recipient distribution attachments subject created status",
+ &t_str, "New", NULL, NULL, -1, &slist) ;
if (status != E_GW_CONNECTION_STATUS_OK) {
//camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Authentication failed"));
CAMEL_SERVICE_UNLOCK (gw_store, connect_lock) ;
@@ -579,8 +578,8 @@ groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags,
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, "Modified", "Mail", NULL, -1, &slist) ;
+ "peek recipient distribution attachments subject created status",
+ &t_str, "Modified", NULL, 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"));
@@ -607,7 +606,7 @@ groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags,
g_mutex_lock (mutex) ;
status = e_gw_connection_create_cursor (priv->cnc, container_id,
- "attachments distribution created subject",
+ "peek attachments distribution created subject status",
NULL,
&cursor) ;
if (status != E_GW_CONNECTION_STATUS_OK) {
@@ -879,7 +878,7 @@ groupwise_get_folder_info (CamelStore *store, const char *top, guint32 flags, Ca
(type == E_GW_CONTAINER_TYPE_CHECKLIST) ||
(type == E_GW_CONTAINER_TYPE_DRAFT) ||
(type == E_GW_CONTAINER_TYPE_CABINET) ||
- (type == E_GW_CONTAINER_TYPE_TRASH) )
+ (type == E_GW_CONTAINER_TYPE_TRASH) )
fi->flags |= CAMEL_FOLDER_SYSTEM ;
/*
parent_hash contains the "parent id <-> container id" combination. So we form
@@ -1181,7 +1180,7 @@ camel_groupwise_store_container_id_lookup (CamelGroupwiseStore *gw_store, const
{
CamelGroupwiseStorePrivate *priv = gw_store->priv ;
- return g_hash_table_lookup (priv->name_hash,folder_name) ;
+ return g_hash_table_lookup (priv->name_hash, folder_name) ;
}
const char *
diff --git a/camel/providers/groupwise/camel-groupwise-summary.c b/camel/providers/groupwise/camel-groupwise-summary.c
index c7fe37fa5..9e53e5168 100644
--- a/camel/providers/groupwise/camel-groupwise-summary.c
+++ b/camel/providers/groupwise/camel-groupwise-summary.c
@@ -176,9 +176,9 @@ 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);
+ camel_file_util_encode_fixed_int32(out, ims->validity);
+ return 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-utils.c b/camel/providers/groupwise/camel-groupwise-utils.c
index a23129a98..1f513f757 100644
--- a/camel/providers/groupwise/camel-groupwise-utils.c
+++ b/camel/providers/groupwise/camel-groupwise-utils.c
@@ -303,7 +303,7 @@ camel_groupwise_util_item_from_message (CamelMimeMessage *message, CamelAddress
/*Egroupwise item*/
item = e_gw_item_new_empty () ;
- /*poulate recipient list*/
+ /*populate recipient list*/
camel_address_remove(recipients,-1);
camel_address_cat (recipients, CAMEL_ADDRESS (camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO)));
recipient_list=add_recipients(recipient_list,recipients,E_GW_ITEM_RECIPIENT_TO);
@@ -481,7 +481,19 @@ camel_groupwise_util_item_from_message (CamelMimeMessage *message, CamelAddress
case 1: e_gw_item_set_notify_declined (item, E_GW_ITEM_NOTIFY_MAIL);
}
}
-
+
+ send_options = (char *)camel_medium_get_header (CAMEL_MEDIUM (message), X_SEND_OPT_PRIORITY);
+ if (send_options) {
+ switch (atoi(send_options)) {
+ case E_GW_PRIORITY_HIGH: e_gw_item_set_priority(item, "High");
+ break;
+ case E_GW_PRIORITY_LOW: e_gw_item_set_priority(item, "Low");
+ break;
+ case E_GW_PRIORITY_STANDARD: e_gw_item_set_priority(item, "Standard");
+ break;
+ }
+ }
+
return item;
}
diff --git a/camel/providers/imap/ChangeLog b/camel/providers/imap/ChangeLog
index 27ea41468..d51ff118a 100644
--- a/camel/providers/imap/ChangeLog
+++ b/camel/providers/imap/ChangeLog
@@ -1,3 +1,10 @@
+2005-03-10 Jeffrey Stedfast <fejj@novell.com>
+
+ * camel-imap-folder.c (imap_sync_online): READ-ONLY doesn't mean
+ we can't sync flags, allow flag syncing even in READ-ONLY mode
+ since the RFC states that flags listed in PERMANENTFLAGS are
+ always settable.
+
2005-03-07 JP Rosevear <jpr@novell.com>
From Dave Malcolm <dmalcolm@redhat.com>
@@ -5,6 +12,13 @@
* camel-imap-store-summary.c
(camel_imap_store_summary_namespace_set): move forward declaration
out of block to fix gcc4 compilation
+
+2005-03-01 Not Zed <NotZed@Ximian.com>
+
+ ** See bug #73112
+
+ * camel-imap-store.c (query_auth_types): don't re-connect if we're
+ already connected.
2005-02-22 Not Zed <NotZed@Ximian.com>
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 55a2d5a19..62795dc8f 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -765,11 +765,11 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
gboolean unset;
int i, j, max;
- if (((CamelImapFolder *)folder)->read_only) {
+ if (folder->permanent_flags == 0) {
imap_sync_offline (folder, ex);
return;
}
-
+
camel_exception_init (&local_ex);
CAMEL_SERVICE_LOCK (store, connect_lock);
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index b34c99722..4cca6a07b 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -972,7 +972,9 @@ query_auth_types (CamelService *service, CamelException *ex)
return NULL;
CAMEL_SERVICE_LOCK (store, connect_lock);
- connected = connect_to_server_wrapper (service, ex);
+ connected = store->istream != NULL && store->connected;
+ if (!connected)
+ connected = connect_to_server_wrapper (service, ex);
CAMEL_SERVICE_UNLOCK (store, connect_lock);
if (!connected)
return NULL;
diff --git a/camel/tests/misc/Makefile.am b/camel/tests/misc/Makefile.am
index 6e60e0094..e8102f583 100644
--- a/camel/tests/misc/Makefile.am
+++ b/camel/tests/misc/Makefile.am
@@ -16,11 +16,12 @@ LDADD = \
$(INTLLIBS)
check_PROGRAMS = \
+ test1 \
+ test2 \
url \
url-scan \
utf7 \
- split \
- test2
+ split
TESTS = url utf7 split url-scan test2
diff --git a/camel/tests/misc/README b/camel/tests/misc/README
index 6b8f4a22f..891bbb233 100644
--- a/camel/tests/misc/README
+++ b/camel/tests/misc/README
@@ -1,4 +1,5 @@
+test1 references header decoding
test2 rfc2184 multipart/i18n parameters
url URL parsing
utf7 UTF7 and UTF8 processing
diff --git a/camel/tests/misc/test1.c b/camel/tests/misc/test1.c
new file mode 100644
index 000000000..0aae4fc5d
--- /dev/null
+++ b/camel/tests/misc/test1.c
@@ -0,0 +1,58 @@
+
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <camel/camel-object.h>
+#include <camel/camel-mime-utils.h>
+
+#include "camel-test.h"
+
+struct {
+ char *header;
+ char *values[5];
+} test1[] = {
+ { "<test@camel.host>", { "test@camel.host" } },
+ { "(this is a comment) <test@camel.host>", { "test@camel.host" } },
+ { "<test@camel.host> (this is a comment)", { "test@camel.host" } },
+ { "<test@camel.host> This is total rubbish!", { "test@camel.host" } },
+ { "<<test.groupwise@bug.novell>@novell>", { "test.groupwise@bug.novell" } },
+ { "<<test.groupwise@bug.novell>@novell> <test@camel.host>",
+ { "test@camel.host", "test.groupwise@bug.novell" } },
+ { "<test@camel.host> <<test.groupwise@bug.novell>@novell> <test@camel.host>",
+ { "test@camel.host", "test.groupwise@bug.novell", "test@camel.host" } },
+ { "<<test.groupwise@bug.novell>@novell> <test@camel.host> <<test.groupwise@bug.novell>@novell>",
+ { "test.groupwise@bug.novell", "test@camel.host", "test.groupwise@bug.novell" } },
+};
+
+int
+main (int argc, char **argv)
+{
+ int i, j;
+
+ camel_test_init(argc, argv);
+
+ camel_test_start("references decoding");
+
+ for (i=0;i<sizeof(test1)/sizeof(test1[0]);i++) {
+ struct _camel_header_references *head, *node;
+
+ camel_test_push("references decoding[%d] '%s'", i, test1[i].header);
+ head = camel_header_references_decode(test1[i].header);
+ node = head;
+ for (j=0;test1[i].values[j];j++) {
+ check_msg(node != NULL, "didn't find all references");
+ check(strcmp(test1[i].values[j], node->id) == 0);
+ node = node->next;
+ }
+ check_msg(node == NULL, "found more references than should have");
+ camel_header_references_list_clear(&head);
+ camel_test_pull();
+ }
+
+ camel_test_end();
+
+ return 0;
+}