aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-07-26 01:31:50 +0800
committerDan Winship <danw@src.gnome.org>2000-07-26 01:31:50 +0800
commit55499dc0155c1fee40539cd23774453cb3d5cb1d (patch)
treeb18a3d798d9b3dcb2c41e274e6a6d8f29ab1a6b2 /mail
parente12a083de792951b6946458a61eb080fbb895558 (diff)
downloadgsoc2013-evolution-55499dc0155c1fee40539cd23774453cb3d5cb1d.tar
gsoc2013-evolution-55499dc0155c1fee40539cd23774453cb3d5cb1d.tar.gz
gsoc2013-evolution-55499dc0155c1fee40539cd23774453cb3d5cb1d.tar.bz2
gsoc2013-evolution-55499dc0155c1fee40539cd23774453cb3d5cb1d.tar.lz
gsoc2013-evolution-55499dc0155c1fee40539cd23774453cb3d5cb1d.tar.xz
gsoc2013-evolution-55499dc0155c1fee40539cd23774453cb3d5cb1d.tar.zst
gsoc2013-evolution-55499dc0155c1fee40539cd23774453cb3d5cb1d.zip
Don't group together messages with the same non-Re: subject and no
* message-thread.c (group_root_set): Don't group together messages with the same non-Re: subject and no References/In-Reply-To. More often than not, they're unrelated. (eg, "[No subject]".) (thread_messages): Handle messages with no Message-Id. "This shouldn't happen", but it does sometimes, and it's not much code to make it just work. svn path=/trunk/; revision=4317
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog9
-rw-r--r--mail/message-thread.c78
2 files changed, 49 insertions, 38 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 5936258b72..0a6f1293c8 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,12 @@
+2000-07-25 Dan Winship <danw@helixcode.com>
+
+ * message-thread.c (group_root_set): Don't group together messages
+ with the same non-Re: subject and no References/In-Reply-To. More
+ often than not, they're unrelated. (eg, "[No subject]".)
+ (thread_messages): Handle messages with no Message-Id. "This
+ shouldn't happen", but it does sometimes, and it's not much code
+ to make it just work.
+
2000-07-25 Ettore Perazzoli <ettore@helixcode.com>
* mail-config.c (create_service_page): Call
diff --git a/mail/message-thread.c b/mail/message-thread.c
index 7970a06e80..3218d7ff28 100644
--- a/mail/message-thread.c
+++ b/mail/message-thread.c
@@ -284,7 +284,7 @@ group_root_set(struct _container **cp)
d(printf("container is not re\n"));
remove_node(cp, container, &clast);
container_add_child(c, container);
- } else {
+ } else if (c->re && container->re) {
d(printf("subjects are common %p and %p\n", c, container));
remove_node(cp, container, &clast);
@@ -410,58 +410,58 @@ sort_thread(struct _container **cp)
struct _container *
thread_messages(CamelFolder *folder, GPtrArray *uids)
{
- GHashTable *id_table;
+ GHashTable *id_table, *no_id_table;
int i;
struct _container *c, *p, *child, *head, *container;
struct _header_references *ref;
id_table = g_hash_table_new(g_str_hash, g_str_equal);
+ no_id_table = g_hash_table_new(NULL, NULL);
for (i=0;i<uids->len;i++) {
const CamelMessageInfo *mi;
mi = camel_folder_get_message_info (folder, uids->pdata[i]);
- if (mi && mi->message_id) {
+
+ if (mi->message_id) {
d(printf("doing : %s\n", mi->message_id));
c = g_hash_table_lookup(id_table, mi->message_id);
- if (c) {
- c->message = mi;
- } else {
+ if (!c) {
c = g_malloc0(sizeof(*c));
- c->message = mi;
g_hash_table_insert(id_table, mi->message_id, c);
}
- c->order = i;
- container = c;
- ref = mi->references;
- p = NULL;
- child = container;
- head = NULL;
- d(printf("referencfes: "));
- while (ref) {
- d(printf(" %s\n", ref->id));
- if (ref->id == NULL) {
- printf("ref missing id!?\n");
- ref = ref->next;
- continue;
- }
- d(printf("looking up reference: %s\n", ref->id));
- c = g_hash_table_lookup(id_table, ref->id);
- if (c == NULL) {
- d(printf("not found\n"));
- c = g_malloc0(sizeof(*c));
- g_hash_table_insert(id_table, ref->id, c);
- }
- if (c!=child) {
- container_parent_child(c, child);
- }
- child = c;
- if (head == NULL)
- head = c;
+ } else {
+ d(printf("doing : (no message id)\n"));
+ c = g_malloc0(sizeof(*c));
+ g_hash_table_insert(no_id_table, mi, c);
+ }
+
+ c->message = mi;
+ c->order = i;
+ container = c;
+ ref = mi->references;
+ p = NULL;
+ child = container;
+ head = NULL;
+ d(printf("references:\n"));
+ while (ref) {
+ if (ref->id == NULL) {
+ printf("ref missing id!?\n");
ref = ref->next;
+ continue;
}
- d(printf("\n"));
- } else {
- printf("Either info is NULL or no message id???\n");
- /* ?? */
+
+ d(printf("looking up reference: %s\n", ref->id));
+ c = g_hash_table_lookup(id_table, ref->id);
+ if (c == NULL) {
+ d(printf("not found\n"));
+ c = g_malloc0(sizeof(*c));
+ g_hash_table_insert(id_table, ref->id, c);
+ }
+ if (c!=child)
+ container_parent_child(c, child);
+ child = c;
+ if (head == NULL)
+ head = c;
+ ref = ref->next;
}
}
@@ -469,8 +469,10 @@ thread_messages(CamelFolder *folder, GPtrArray *uids)
/* build a list of root messages (no parent) */
head = NULL;
g_hash_table_foreach(id_table, hashloop, &head);
+ g_hash_table_foreach(no_id_table, hashloop, &head);
g_hash_table_destroy(id_table);
+ g_hash_table_destroy(no_id_table);
/* remove empty parent nodes */
prune_empty(&head);