GtkWidget *chkbtn_swapfrom;
GtkWidget *chkbtn_useaddrbook;
+ GtkWidget *chkbtn_threadsubj;
GtkWidget *entry_datefmt;
} display;
{"use_address_book", "TRUE", &prefs_common.use_addr_book, P_BOOL,
&display.chkbtn_useaddrbook,
prefs_set_data_from_toggle, prefs_set_toggle},
+ {"thread_by_subject", "TRUE", &prefs_common.thread_by_subject, P_BOOL,
+ &display.chkbtn_threadsubj,
+ prefs_set_data_from_toggle, prefs_set_toggle},
{"date_format", "%y/%m/%d(%a) %H:%M", &prefs_common.date_format,
P_STRING, &display.entry_datefmt,
prefs_set_data_from_entry, prefs_set_entry},
GtkWidget *vbox2;
GtkWidget *chkbtn_swapfrom;
GtkWidget *chkbtn_useaddrbook;
+ GtkWidget *chkbtn_threadsubj;
GtkWidget *vbox3;
GtkWidget *label_datefmt;
GtkWidget *button_datefmt;
PACK_CHECK_BUTTON
(vbox2, chkbtn_useaddrbook,
_("Display sender using address book"));
+ PACK_CHECK_BUTTON
+ (vbox2, chkbtn_threadsubj,
+ _("Thread using subject in addition to standard headers"));
PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
display.chkbtn_swapfrom = chkbtn_swapfrom;
display.chkbtn_useaddrbook = chkbtn_useaddrbook;
+ display.chkbtn_threadsubj = chkbtn_threadsubj;
display.entry_datefmt = entry_datefmt;
}
g_hash_table_lookup(msgid_table, msgid) == NULL)
g_hash_table_insert(msgid_table, (gchar *)msgid, node);
- subject = msginfo->subject;
- found_subject = subject_table_lookup(subject_table,
- (gchar *) subject);
- if (found_subject == NULL)
- subject_table_insert(subject_table, (gchar *) subject,
- node);
- else {
- /* replace if msg in table is older than current one
- * can add here more stuff. */
- if ( ((MsgInfo*)(found_subject->data))->date_t >
- ((MsgInfo*)(node->data))->date_t ) {
- subject_table_remove(subject_table, (gchar *) subject);
- subject_table_insert(subject_table, (gchar *) subject, node);
- }
+ if (prefs_common.thread_by_subject) {
+ subject = msginfo->subject;
+ found_subject = subject_table_lookup(subject_table,
+ (gchar *) subject);
+ if (found_subject == NULL)
+ subject_table_insert(subject_table, (gchar *) subject,
+ node);
+ else {
+ /* replace if msg in table is older than current one
+ * can add here more stuff. */
+ if ( ((MsgInfo*)(found_subject->data))->date_t >
+ ((MsgInfo*)(node->data))->date_t ) {
+ subject_table_remove(subject_table, (gchar *) subject);
+ subject_table_insert(subject_table, (gchar *) subject, node);
+ }
+ }
}
}
* threaded by subject line. we need to handle this in a special way to prevent
* circular reference from a node that has already been threaded by IN-REPLY-TO
* but is also in the subject line hash table */
- for (node = root->children; node != NULL; ) {
- next = node->next;
- msginfo = (MsgInfo *) node->data;
- parent = NULL;
- if (subject_is_reply(msginfo->subject)) {
- parent = subject_table_lookup(subject_table,
- msginfo->subject);
- /* the node may already be threaded by IN-REPLY-TO,
- so go up in the tree to find the parent node */
- if (parent != NULL) {
- if (g_node_is_ancestor(node, parent))
- parent = NULL;
- if (parent == node)
- parent = NULL;
- }
-
- if (parent) {
- g_node_unlink(node);
- g_node_append(parent, node);
- /* CLAWS: ignore thread */
- if (MSG_IS_IGNORE_THREAD(((MsgInfo *)parent->data)->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags)) {
- g_node_traverse(node, G_PRE_ORDER, G_TRAVERSE_ALL, -1, procmsg_ignore_node, NULL);
+ if (prefs_common.thread_by_subject) {
+ for (node = root->children; node != NULL; ) {
+ next = node->next;
+ msginfo = (MsgInfo *) node->data;
+ parent = NULL;
+ if (subject_is_reply(msginfo->subject)) {
+ parent = subject_table_lookup(subject_table,
+ msginfo->subject);
+ /* the node may already be threaded by IN-REPLY-TO,
+ so go up in the tree to find the parent node */
+ if (parent != NULL) {
+ if (g_node_is_ancestor(node, parent))
+ parent = NULL;
+ if (parent == node)
+ parent = NULL;
}
- }
- }
- node = next;
- }
+ if (parent) {
+ g_node_unlink(node);
+ g_node_append(parent, node);
+ /* CLAWS: ignore thread */
+ if (MSG_IS_IGNORE_THREAD(((MsgInfo *)parent->data)->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags)) {
+ g_node_traverse(node, G_PRE_ORDER, G_TRAVERSE_ALL, -1, procmsg_ignore_node, NULL);
+ }
+ }
+ }
+ node = next;
+ }
+ }
+
g_hash_table_destroy(subject_table);
g_hash_table_destroy(msgid_table);