Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1:kernel-2.6.32
evolution-data-server
gw-broken-flags-handling.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File gw-broken-flags-handling.patch of Package evolution-data-server
diff --git a/camel/providers/groupwise/camel-groupwise-folder.c b/camel/providers/groupwise/camel-groupwise-folder.c index da7de05..ad3cd5c 100644 --- a/camel/providers/groupwise/camel-groupwise-folder.c +++ b/camel/providers/groupwise/camel-groupwise-folder.c @@ -677,6 +677,11 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelException *ex) continue; flags = camel_message_info_flags (info); + if (!(flags & CAMEL_MESSAGE_FOLDER_FLAGGED)) { + camel_message_info_free(info); + continue; + } + if ((flags & CAMEL_MESSAGE_JUNK) && strcmp(camel_folder_get_name(folder), JUNK_FOLDER)) { /*marked a message junk*/ move_to_junk (folder, info, ex); @@ -1075,6 +1080,7 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex) char *time_string = NULL, *t_str = NULL; struct _folder_update_msg *msg; gboolean check_all = FALSE; + int new_items = 0; /* Sync-up the (un)read changes before getting updates, so that the getFolderList will reflect the most recent changes too */ @@ -1169,7 +1175,7 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex) for ( sl = slist ; sl != NULL; sl = sl->next) list = g_list_append (list, sl->data);*/ - if (slist && g_slist_length(slist) != 0) + if (slist && (new_items = g_slist_length(slist)) != 0) check_all = TRUE; g_slist_free (slist); @@ -1213,16 +1219,28 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex) if (check_all && !is_proxy) { EGwContainer *container; - container = e_gw_connection_get_container (cnc, container_id); - - d(printf ("Evolution's folder summary length is : %u\tserver has %u items", - camel_folder_summary_count (folder->summary), e_gw_container_get_total_count (container))); - - 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); + int i=0; + + do { + /* HACK: Refer to Novell bugzilla bug #464379 */ + container = e_gw_connection_get_container (cnc, container_id); + ++i; + if (!strcmp (folder->full_name, e_gw_container_get_name (container))) + i = 10; + } while (i < 2); + + if (i == 10) { + /* HACK: Refer to Novell bugzilla bug #464379 */ + d(printf ("Evolution's folder summary length is : %u\tserver has %u items", + camel_folder_summary_count (folder->summary), e_gw_container_get_total_count (container))); + + if ((camel_folder_summary_count (folder->summary) + new_items) == 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); + } else + check_all = FALSE; g_object_unref (container); } @@ -2320,6 +2338,7 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids, } } + if (destination_is_trash) { e_gw_connection_remove_item (cnc, source_container_id, (const char*) uids->pdata[index]); camel_folder_summary_remove_uid (source->summary, uids->pdata[index]); @@ -2346,6 +2365,10 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids, /*if ( !strcmp(source->full_name, SENT) ) { camel_folder_delete_message(source, uids->pdata[index]); } else {*/ + + if (!(gw_info->info.flags & CAMEL_MESSAGE_SEEN)) + source->summary->unread_count --; + camel_folder_summary_remove_uid (source->summary, uids->pdata[index]); camel_folder_change_info_remove_uid (changes, uids->pdata[index]); //} diff --git a/camel/providers/groupwise/camel-groupwise-journal.h b/camel/providers/groupwise/camel-groupwise-journal.h index cceee23..3a6fccd 100644 --- a/camel/providers/groupwise/camel-groupwise-journal.h +++ b/camel/providers/groupwise/camel-groupwise-journal.h @@ -54,7 +54,7 @@ enum { struct _CamelGroupwiseJournalEntry { CamelDListNode node; - int type; + guint32 type; char *uid; char *original_uid; diff --git a/camel/providers/groupwise/camel-groupwise-summary.c b/camel/providers/groupwise/camel-groupwise-summary.c index 3d3536d..68763f5 100644 --- a/camel/providers/groupwise/camel-groupwise-summary.c +++ b/camel/providers/groupwise/camel-groupwise-summary.c @@ -47,6 +47,8 @@ #define EXTRACT_FIRST_DIGIT(val) part ? val=strtoul (part, &part, 10) : 0; #define EXTRACT_DIGIT(val) part++; part ? val=strtoul (part, &part, 10) : 0; +#define d(x) + /*Prototypes*/ static int gw_summary_header_load (CamelFolderSummary *, FILE *); static int gw_summary_header_save (CamelFolderSummary *, FILE *); @@ -362,70 +364,66 @@ static gboolean gw_info_set_flags (CamelMessageInfo *info, guint32 flags, guint32 set) { - guint32 old; - CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info; + guint32 old; + CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info; + int read = 0 , deleted = 0; - /* TODO: locking? */ + int junk_flag = 0, junk_learn_flag = 0; - old = mi->flags; - /* we don't set flags which aren't appropriate for the folder*/ - if ((set == (CAMEL_MESSAGE_JUNK|CAMEL_MESSAGE_JUNK_LEARN|CAMEL_MESSAGE_SEEN)) && (old & CAMEL_GW_MESSAGE_JUNK)) - return FALSE; - - mi->flags = (old & ~flags) | (set & flags); - if (old != mi->flags) { - mi->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED; - - if (mi->summary) { - - if ((set & CAMEL_MESSAGE_SEEN) && !(old & CAMEL_MESSAGE_SEEN)) { - mi->summary->unread_count -- ; - } else if ( (!(set & CAMEL_MESSAGE_SEEN)) && (old & CAMEL_MESSAGE_SEEN) ) { - mi->summary->unread_count ++ ; - } + /* TODO: locking? */ - if ((flags & CAMEL_MESSAGE_DELETED) && !(old & CAMEL_MESSAGE_DELETED)) { - mi->summary->deleted_count ++ ; + if (flags & CAMEL_MESSAGE_SEEN && ((set & CAMEL_MESSAGE_SEEN) != (mi->flags & CAMEL_MESSAGE_SEEN))) + { read = set & CAMEL_MESSAGE_SEEN ? 1 : -1; d(printf("Setting read as %d\n", set & CAMEL_MESSAGE_SEEN ? 1 : 0));} - #warning "What to do when the user has set to show-deleted-messages " - mi->summary->visible_count -- ; + if (flags & CAMEL_MESSAGE_DELETED && ((set & CAMEL_MESSAGE_DELETED) != (mi->flags & CAMEL_MESSAGE_DELETED))) + { deleted = set & CAMEL_MESSAGE_DELETED ? 1 : -1; d(printf("Setting deleted as %d\n", set & CAMEL_MESSAGE_DELETED ? 1 : 0));} - if (!(flags & CAMEL_MESSAGE_SEEN)) - mi->summary->unread_count -- ; - } + old = mi->flags; + mi->flags = (old & ~flags) | (set & flags); + if (old != mi->flags) { + mi->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED; mi->dirty = TRUE; - camel_folder_summary_touch(mi->summary); + + if (((old & ~CAMEL_MESSAGE_SYSTEM_MASK) == (mi->flags & ~CAMEL_MESSAGE_SYSTEM_MASK)) ) + return FALSE; + + if (mi->summary) { + mi->summary->deleted_count += deleted; + mi->summary->unread_count -= read; + camel_folder_summary_touch(mi->summary); + } } - } - /* This is a hack, we are using CAMEL_MESSAGE_JUNK justo to hide the item - * we make sure this doesn't have any side effects*/ - - if ((set == CAMEL_MESSAGE_JUNK_LEARN) && (old & CAMEL_GW_MESSAGE_JUNK)) { - mi->flags |= CAMEL_GW_MESSAGE_NOJUNK | CAMEL_MESSAGE_JUNK; - /* This has ugly side-effects. Evo will never learn unjunk. + junk_flag = ((flags & CAMEL_MESSAGE_JUNK) && (set & CAMEL_MESSAGE_JUNK)); + junk_learn_flag = ((flags & CAMEL_MESSAGE_JUNK_LEARN) && (set & CAMEL_MESSAGE_JUNK_LEARN)); - We need to create one CAMEL_MESSAGE_HIDDEN flag which must be used for all hiding operations. We must also get rid of the seperate file that is maintained somewhere in evolution/mail/em-folder-browser.c for hidden messages - */ + /* This is a hack, we are using CAMEL_MESSAGE_JUNK justo to hide the item + * we make sure this doesn't have any side effects*/ - if (mi->summary) { - camel_folder_summary_touch(mi->summary); + if (junk_learn_flag && !junk_flag && (old & CAMEL_GW_MESSAGE_JUNK)) { + /* + This has ugly side-effects. Evo will never learn unjunk. + We need to create one CAMEL_MESSAGE_HIDDEN flag which must be + used for all hiding operations. We must also get rid of the seperate file + that is maintained somewhere in evolution/mail/em-folder-browser.c for hidden messages + */ + mi->flags |= CAMEL_GW_MESSAGE_NOJUNK | CAMEL_MESSAGE_JUNK | CAMEL_MESSAGE_JUNK_LEARN; + } else if (junk_learn_flag && junk_flag && !(old & CAMEL_GW_MESSAGE_JUNK)) { + mi->flags |= CAMEL_GW_MESSAGE_JUNK | CAMEL_MESSAGE_JUNK | CAMEL_MESSAGE_JUNK_LEARN; } - } else if ((old & ~CAMEL_MESSAGE_SYSTEM_MASK) == (mi->flags & ~CAMEL_MESSAGE_SYSTEM_MASK)) - return FALSE; - if (mi->summary && mi->summary->folder && mi->uid) { - CamelFolderChangeInfo *changes = camel_folder_change_info_new(); + if (mi->summary && mi->summary->folder && mi->uid) { + CamelFolderChangeInfo *changes = camel_folder_change_info_new(); - camel_folder_change_info_change_uid(changes, camel_message_info_uid(info)); - camel_object_trigger_event(mi->summary->folder, "folder_changed", changes); - camel_folder_change_info_free(changes); - } - - return TRUE; + camel_folder_change_info_change_uid(changes, camel_message_info_uid(info)); + camel_object_trigger_event(mi->summary->folder, "folder_changed", changes); + camel_folder_change_info_free(changes); + camel_folder_summary_touch(mi->summary); + } + return TRUE; } diff --git a/camel/providers/groupwise/camel-groupwise-summary.h b/camel/providers/groupwise/camel-groupwise-summary.h index 75eed02..a1b4583 100644 --- a/camel/providers/groupwise/camel-groupwise-summary.h +++ b/camel/providers/groupwise/camel-groupwise-summary.h @@ -56,11 +56,11 @@ struct _CamelGroupwiseMessageContentInfo { struct _CamelGroupwiseSummary { - CamelFolderSummary parent ; + CamelFolderSummary parent; char *time_string; - guint32 version ; - guint32 validity ; + gint32 version; + gint32 validity; } ;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor