aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder-thread.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-08-28 05:45:22 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-08-28 05:45:22 +0800
commit9945af011ee1e272440e0f61b74b910d0bd92045 (patch)
treeb74e35d6a28eaadb27fbe8331927c418701ed9c4 /camel/camel-folder-thread.c
parent545045a58e8b9440261945afd86d10c7956d231e (diff)
downloadgsoc2013-evolution-9945af011ee1e272440e0f61b74b910d0bd92045.tar.gz
gsoc2013-evolution-9945af011ee1e272440e0f61b74b910d0bd92045.tar.zst
gsoc2013-evolution-9945af011ee1e272440e0f61b74b910d0bd92045.zip
Now takes a third argument to specify whether or not to group messages by
2002-08-27 Jeffrey Stedfast <fejj@ximian.com> * camel-folder-thread.c (camel_folder_thread_messages_new): Now takes a third argument to specify whether or not to group messages by subject when threading. It seems some people don't want this feature (see bug #22791 for details). (thread_summary): If thread_by_subject is enabled, group un-threaded messages by subject otherwise don't bother. svn path=/trunk/; revision=17880
Diffstat (limited to 'camel/camel-folder-thread.c')
-rw-r--r--camel/camel-folder-thread.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/camel/camel-folder-thread.c b/camel/camel-folder-thread.c
index 1401d39f21..9d5ecf2861 100644
--- a/camel/camel-folder-thread.c
+++ b/camel/camel-folder-thread.c
@@ -500,9 +500,10 @@ thread_summary(CamelFolderThread *thread, GPtrArray *summary)
/* remove empty parent nodes */
prune_empty(thread, &head);
-
- /* find any siblings which missed out */
- group_root_set(thread, &head);
+
+ /* find any siblings which missed out - but only if we are allowing threading by subject */
+ if (thread->subject)
+ group_root_set (thread, &head);
#if 0
printf("finished\n");
@@ -561,9 +562,14 @@ thread_summary(CamelFolderThread *thread, GPtrArray *summary)
* @folder:
* @uids: The subset of uid's to thread. If NULL. then thread all
* uid's in @folder.
+ * @thread_subject: thread based on subject also
*
* Thread a (subset) of the messages in a folder. And sort the result
* in summary order.
+ *
+ * If @thread_subject is %TRUE, messages with
+ * related subjects will also be threaded. The default behaviour is to
+ * only thread based on message-id.
*
* This function is probably to be removed soon.
*
@@ -571,7 +577,7 @@ thread_summary(CamelFolderThread *thread, GPtrArray *summary)
* which represent the threaded structure of the messages.
**/
CamelFolderThread *
-camel_folder_thread_messages_new(CamelFolder *folder, GPtrArray *uids)
+camel_folder_thread_messages_new (CamelFolder *folder, GPtrArray *uids, gboolean thread_subject)
{
CamelFolderThread *thread;
GHashTable *wanted = NULL;
@@ -581,12 +587,13 @@ camel_folder_thread_messages_new(CamelFolder *folder, GPtrArray *uids)
thread = g_malloc(sizeof(*thread));
thread->refcount = 1;
+ thread->subject = thread_subject;
thread->tree = NULL;
thread->node_chunks = e_memchunk_new(32, sizeof(CamelFolderThreadNode));
thread->folder = folder;
camel_object_ref((CamelObject *)folder);
- /* get all of the summary items of interest in summary order*/
+ /* get all of the summary items of interest in summary order */
if (uids) {
wanted = g_hash_table_new(g_str_hash, g_str_equal);
for (i=0;i<uids->len;i++)
@@ -623,7 +630,7 @@ add_present_rec(CamelFolderThread *thread, GHashTable *have, GPtrArray *summary,
if (g_hash_table_lookup(have, (char *)uid)) {
g_hash_table_remove(have, (char *)camel_message_info_uid(node->message));
- g_ptr_array_add(summary, node->message);
+ g_ptr_array_add(summary, (void *) node->message);
} else {
camel_folder_free_message_info(thread->folder, (CamelMessageInfo *)node->message);
}