#include "pixmaps/replied.xpm"
#include "pixmaps/forwarded.xpm"
#include "pixmaps/clip.xpm"
+#include "pixmaps/ignorethread.xpm"
#define STATUSBAR_PUSH(mainwin, str) \
{ \
static GdkBitmap *repliedxpmmask;
static GdkPixmap *forwardedxpm;
static GdkBitmap *forwardedxpmmask;
+static GdkPixmap *ignorethreadxpm;
+static GdkBitmap *ignorethreadxpmmask;
static GdkPixmap *clipxpm;
static GdkBitmap *clipxpmmask;
static void summary_execute_delete_func (GtkCTree *ctree,
GtkCTreeNode *node,
gpointer data);
+static void summary_ignore_thread(SummaryView *summaryview);
+static void summary_unignore_thread(SummaryView *summaryview);
/* thread functions */
static void summary_thread_func (GtkCTree *ctree,
{N_("/_Mark/_Unmark"), NULL, summary_unmark, 0, NULL},
{N_("/_Mark/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Mark/Mark as unr_ead"), NULL, summary_mark_as_unread, 0, NULL},
- {N_("/_Mark/Mark as rea_d"),
- NULL, summary_mark_as_read, 0, NULL},
+ {N_("/_Mark/Mark as rea_d"), NULL, summary_mark_as_read, 0, NULL},
+ {N_("/_Mark/Ignore thread"), NULL, summary_ignore_thread, 0, NULL},
+ {N_("/_Mark/Unignore thread"), NULL, summary_unignore_thread, 0, NULL},
+
{N_("/_Label"), NULL, NULL, 0, "<Branch>"},
{N_("/_Label/None"), NULL, summary_set_label, MSG_LABEL_NONE, NULL},
{N_("/_Label/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Label/Blue"), NULL, summary_set_label, MSG_LABEL_BLUE, NULL},
{N_("/_Label/Green"), NULL, summary_set_label, MSG_LABEL_GREEN, NULL},
{N_("/_Label/Brown"), NULL, summary_set_label, MSG_LABEL_BROWN, NULL},
+
{N_("/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Reply"), NULL, summary_reply_cb, COMPOSE_REPLY, NULL},
{N_("/Repl_y to sender"), NULL, summary_reply_cb, COMPOSE_REPLY_TO_SENDER, NULL},
replied_xpm);
PIXMAP_CREATE(summaryview->ctree, forwardedxpm, forwardedxpmmask,
forwarded_xpm);
+ PIXMAP_CREATE(summaryview->ctree, ignorethreadxpm, ignorethreadxpmmask,
+ ignorethread_xpm);
PIXMAP_CREATE(summaryview->ctree, clipxpm, clipxpmmask, clip_xpm);
PIXMAP_CREATE(summaryview->hbox, folderxpm, folderxpmmask,
DIRECTORY_OPEN_XPM);
menu_set_sensitive(ifactory, "/Mark/Mark as unread", TRUE);
menu_set_sensitive(ifactory, "/Mark/Mark as read", TRUE);
+ menu_set_sensitive(ifactory, "/Mark/Ignore thread", TRUE);
+ menu_set_sensitive(ifactory, "/Mark/Unignore thread", TRUE);
menu_set_sensitive(ifactory, "/Label", TRUE);
if (node) {
gtk_sctree_unselect_all(GTK_SCTREE(ctree));
gtk_sctree_select(GTK_SCTREE(ctree), node);
- gtk_ctree_node_moveto(ctree, node, -1, 0.5, 0.0);
+
+ /* BUGFIX: select next unread message
+ * REVERT: causes incorrect folder stats
+ * gtk_ctree_node_moveto(ctree, node, -1, 0.5, 0.0);
+ */
+
if (summaryview->displayed == node)
summaryview->displayed = NULL;
summary_display_msg(summaryview, node, FALSE);
for (; node != NULL; node = GTK_CTREE_NODE_NEXT(node)) {
msginfo = gtk_ctree_node_get_row_data(ctree, node);
- if (MSG_IS_UNREAD(msginfo->flags)) break;
+ if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags)) break;
}
return node;
msginfo = gtk_ctree_node_get_row_data(ctree, node);
- if (MSG_IS_NEW(msginfo->flags))
+ if (MSG_IS_NEW(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
summaryview->newmsgs++;
- if (MSG_IS_UNREAD(msginfo->flags))
+ if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
summaryview->unread++;
if (MSG_IS_DELETED(msginfo->flags))
summaryview->deleted++;
node != NULL; node = GTK_CTREE_NODE_NEXT(node)) {
msginfo = GTKUT_CTREE_NODE_GET_ROW_DATA(node);
- if (MSG_IS_NEW(msginfo->flags))
+ if (MSG_IS_NEW(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
summaryview->newmsgs++;
- if (MSG_IS_UNREAD(msginfo->flags))
+ if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
summaryview->unread++;
if (MSG_IS_DELETED(msginfo->flags))
summaryview->deleted++;
parent = g_hash_table_lookup
(msgid_table, msginfo->inreplyto);
}
- if (parent == NULL && msginfo->subject) {
+ if (parent == NULL && msginfo->subject &&
+ g_strncasecmp(msginfo->subject, "Re: ", 4) == 0) {
parent = subject_table_lookup
(subject_table, msginfo->subject);
}
+ if(parent) {
+ parentinfo = gtk_ctree_node_get_row_data(ctree, parent);
+ if(parentinfo && MSG_IS_IGNORE_THREAD(parentinfo->flags)) {
+/*
+ if (MSG_IS_NEW(msginfo->flags))
+ summaryview->newmsgs--;
+ if (MSG_IS_UNREAD(msginfo->flags))
+ summaryview->unread--;
+*/
+ MSG_SET_FLAGS(msginfo->flags, MSG_IGNORE_THREAD);
+ }
+ }
node = gtk_ctree_insert_node
(ctree, parent, NULL, text, 2,
*cur_msginfo->inreplyto) {
cur_parent = g_hash_table_lookup(msgid_table, cur_msginfo->inreplyto);
}
- if (cur_parent == NULL && cur_msginfo->subject) {
+ if (cur_parent == NULL &&
+ cur_msginfo->subject &&
+ g_strncasecmp(cur_msginfo->subject,
+ "Re: ", 4) == 0) {
cur_parent = subject_table_lookup(subject_table, cur_msginfo->subject);
}
}
}
g_free(filename);
- if (MSG_IS_NEW(msginfo->flags))
+ if (MSG_IS_NEW(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
summaryview->newmsgs--;
- if (MSG_IS_UNREAD(msginfo->flags))
+ if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
summaryview->unread--;
if (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)) {
MSG_UNSET_FLAGS(msginfo->flags, MSG_NEW | MSG_UNREAD);
flags = msginfo->flags;
- gtk_ctree_node_set_foreground(ctree, row, &summaryview->color_normal);
+ gtk_ctree_node_set_foreground(ctree, row, NULL);
/* set new/unread column */
- if (MSG_IS_NEW(flags)) {
+ if (MSG_IS_IGNORE_THREAD(flags)) {
+ gtk_ctree_node_set_pixmap(ctree, row, S_COL_UNREAD,
+ ignorethreadxpm, ignorethreadxpmmask);
+ } else if (MSG_IS_NEW(flags)) {
gtk_ctree_node_set_pixmap(ctree, row, S_COL_UNREAD,
newxpm, newxpmmask);
} else if (MSG_IS_UNREAD(flags)) {
MsgInfo *msginfo;
msginfo = gtk_ctree_node_get_row_data(ctree, row);
- if (MSG_IS_NEW(msginfo->flags))
+ if (MSG_IS_NEW(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
summaryview->newmsgs--;
- if (MSG_IS_UNREAD(msginfo->flags))
+ if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
summaryview->unread--;
if (MSG_IS_NEW(msginfo->flags) ||
MSG_IS_UNREAD(msginfo->flags)) {
if(msginfo->inreplyto) {
parent = g_hash_table_lookup(msgid_table, msginfo->inreplyto);
}
- if (parent == NULL && msginfo->subject) {
+ if (parent == NULL && msginfo->subject &&
+ g_strncasecmp(msginfo->subject, "Re: ", 4) == 0) {
parent = subject_table_lookup(subject_table, msginfo->subject);
}
else
return summary_cmp_by_date(clist, ptr1, ptr2);
}
+
+static void summary_ignore_thread_func(GtkCTree *ctree, GtkCTreeNode *row, gpointer data)
+{
+ SummaryView *summaryview = (SummaryView *) data;
+ MsgInfo *msginfo;
+
+ msginfo = gtk_ctree_node_get_row_data(ctree, row);
+ if (MSG_IS_NEW(msginfo->flags))
+ summaryview->newmsgs--;
+ if (MSG_IS_UNREAD(msginfo->flags))
+ summaryview->unread--;
+ MSG_SET_FLAGS(msginfo->flags, MSG_IGNORE_THREAD);
+
+ CHANGE_FLAGS(msginfo);
+
+ summary_set_row_marks(summaryview, row);
+ debug_print(_("Message %d is marked as ignore thread\n"),
+ msginfo->msgnum);
+}
+
+static void summary_ignore_thread(SummaryView *summaryview)
+{
+ GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
+ GList *cur;
+
+ for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next) {
+ gtk_ctree_pre_recursive(ctree, GTK_CTREE_NODE(cur->data), GTK_CTREE_FUNC(summary_ignore_thread_func), summaryview);
+ }
+
+ summary_status_show(summaryview);
+}
+
+static void summary_unignore_thread_func(GtkCTree *ctree, GtkCTreeNode *row, gpointer data)
+{
+ SummaryView *summaryview = (SummaryView *) data;
+ MsgInfo *msginfo;
+
+ msginfo = gtk_ctree_node_get_row_data(ctree, row);
+ if (MSG_IS_NEW(msginfo->flags))
+ summaryview->newmsgs++;
+ if (MSG_IS_UNREAD(msginfo->flags))
+ summaryview->unread++;
+ MSG_UNSET_FLAGS(msginfo->flags, MSG_IGNORE_THREAD);
+
+ CHANGE_FLAGS(msginfo);
+
+ summary_set_row_marks(summaryview, row);
+ debug_print(_("Message %d is marked as unignore thread\n"),
+ msginfo->msgnum);
+}
+
+static void summary_unignore_thread(SummaryView *summaryview)
+{
+ GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
+ GList *cur;
+
+ for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next) {
+ gtk_ctree_pre_recursive(ctree, GTK_CTREE_NODE(cur->data), GTK_CTREE_FUNC(summary_unignore_thread_func), summaryview);
+ }
+
+ summary_status_show(summaryview);
+}
+