#include "prefs_common.h"
#include "prefs_summary_column.h"
#include "prefs_filter.h"
+#include "prefs_filtering.h"
#include "account.h"
#include "compose.h"
#include "utils.h"
gconstpointer ptr1,
gconstpointer ptr2);
-static void news_process_crossposted (MsgInfo *msginfo);
static void news_flag_crosspost (MsgInfo *msginfo);
GtkTargetEntry summary_drag_types[1] =
guint displayed_msgnum = 0;
GtkCTreeNode *selected_node = summaryview->folderview->selected;
GSList *cur;
- gint sort_mode;
- gint sort_type;
- static gboolean locked = FALSE;
if (summary_is_locked(summaryview)) return FALSE;
if (summaryview->folder_item->hide_read_msgs) {
GSList *not_killed;
- gint kill_score;
summary_set_hide_read_msgs_menu(summaryview, TRUE);
not_killed = NULL;
}
} else {
/* select first unread message */
- if (sort_mode == SORT_BY_SCORE)
+ if (item->sort_key == SORT_BY_SCORE)
node = summary_find_next_important_score(summaryview,
NULL);
else
(summaryview, summaryview->selected, MSG_UNREAD, FALSE);
if (!node) {
- AlertValue val;
+ AlertValue val = 0;
switch (prefs_common.next_unread_msg_dialog) {
case NEXTUNREADMSGDIALOG_ALWAYS:
node = summary_find_next_flagged_msg
(summaryview, NULL, MSG_UNREAD, FALSE);
if (node == NULL) {
- AlertValue val;
+ AlertValue val = 0;
switch (prefs_common.next_unread_msg_dialog) {
case NEXTUNREADMSGDIALOG_ALWAYS:
for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
msginfo = gtk_ctree_node_get_row_data(ctree, node);
- if ((msginfo->flags.perm_flags & flags) != 0) break;
+ /* Find msg with matching flags but ignore messages with
+ ignore flags, if searching for new or unread messages */
+ if (!(((flags & (MSG_NEW | MSG_UNREAD)) != 0) && MSG_IS_IGNORE_THREAD(msginfo->flags)) &&
+ ((msginfo->flags.perm_flags & flags) != 0))
+ break;
}
return node;
summary_set_column_titles(summaryview);
summary_set_menu_sensitive(summaryview);
- gtk_ctree_sort_recursive(ctree, NULL);
+ gtk_sctree_sort_recursive(ctree, NULL);
gtk_ctree_node_moveto(ctree, summaryview->selected, -1, 0.5, 0);
{
GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
MsgInfo *msginfo;
- MsgInfo *parentinfo;
- MsgInfo *cur_msginfo;
- GtkCTreeNode *node = NULL;
+ GtkCTreeNode *node = NULL;
GHashTable *msgid_table;
GHashTable *subject_table;
GSList * cur;
- GtkCTreeNode *cur_parent;
-
+
if (!mlist) return;
debug_print(_("\tSetting summary from message data..."));
{
static gchar date_modified[80];
static gchar *to = NULL;
- static gchar *from_name = NULL;
- static gchar col_number[11];
static gchar col_score[11];
static gchar buf[BUFFSIZE];
PrefsFolderItem *prefs = summaryview->folder_item->prefs;
GSList * processing_list;
FolderItem * folder_item;
GSList * cur;
- gchar * id;
gchar * buf;
folder_item = summaryview->folder_item;
void summary_reply(SummaryView *summaryview, ComposeMode mode)
{
- GtkWidget *widget;
GList *sel = GTK_CLIST(summaryview->ctree)->selection;
MsgInfo *msginfo;
gchar *text;
break;
case COMPOSE_FORWARD:
if (prefs_common.forward_as_attachment) {
- summary_reply_cb(summaryview, COMPOSE_FORWARD_AS_ATTACH, widget);
+ summary_reply_cb(summaryview, COMPOSE_FORWARD_AS_ATTACH, NULL);
return;
} else {
- summary_reply_cb(summaryview, COMPOSE_FORWARD_INLINE, widget);
+ summary_reply_cb(summaryview, COMPOSE_FORWARD_INLINE, NULL);
return;
}
break;
GString *line;
gpointer key;
gpointer value;
- MsgPermFlags flags;
Folder *mff = msginfo->folder->folder;
if (mff->account->mark_crosspost_read && MSG_IS_NEWS(msginfo->flags)) {
debug_print(_("nfcp: checking <%s>"), line->str);
if (mff->newsart &&
g_hash_table_lookup_extended(mff->newsart, line->str, &key, &value)) {
- debug_print(_(" <%s>"), value);
+ debug_print(_(" <%s>"), (gchar *)value);
if (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)) {
- MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_NEW | MSG_UNREAD);
- MSG_SET_COLORLABEL_VALUE(msginfo->flags, mff->account->crosspost_col);
+ procmsg_msginfo_unset_flags(msginfo, MSG_NEW | MSG_UNREAD, 0);
+ procmsg_msginfo_set_flags(msginfo, mff->account->crosspost_col, 0);
}
g_hash_table_remove(mff->newsart, key);
g_free(key);
}
}
-static void news_process_crossposted(MsgInfo *msginfo)
-{
- gchar **crossref;
- gchar **crp;
- gchar *cp;
- gint cnt;
- static char *read = "read";
- Folder *mff = msginfo->folder->folder;
-
- /* Get the Xref: line */
- if (msginfo->xref) {
- /* Retrieve the cross-posted groups and message ids */
- /* Format of Xref is Xref: server message:id message:id ... */
- crossref = g_strsplit(msginfo->xref, " ", 1024);
- for (crp = crossref+2, cnt = 0; *crp; crp++, cnt++) {
- if ((cp = strchr(*crp, ':'))) {
- *cp = '\0';
- if (!strcmp(*crp, msginfo->folder->path)) continue;
- *cp = ':';
-
- /* On first pass, create a GHashTable to hold the list of
- * article numbers per newsgroup that have been read. */
- if (!mff->newsart) {
- mff->newsart = g_hash_table_new(g_str_hash, g_str_equal);
- }
- /* When a summary is selected, the articles for that
- * newsgroup are marked based on this entry */
- g_hash_table_insert(mff->newsart, g_strdup(*crp), read);
- debug_print(_("Cross-reference %d: Hash <%s>\n"), cnt, *crp);
- }
- }
- g_strfreev(crossref);
- }
-}
-
static gint summary_cmp_by_score(GtkCList *clist,
gconstpointer ptr1, gconstpointer ptr2)
{
static void summary_select_thread_func(GtkCTree *ctree, GtkCTreeNode *row, gpointer data)
{
- SummaryView *summaryview = (SummaryView *) data;
MsgInfo *msginfo;
msginfo = gtk_ctree_node_get_row_data(ctree, row);
gtk_ctree_select(GTK_CTREE(ctree), row);
- debug_print(_("Message %d selected\n"),
- msginfo->msgnum);
+ debug_print(_("Message %d selected\n"), msginfo->msgnum);
}
/* select current thread */
void summary_reflect_prefs_pixmap_theme(SummaryView *summaryview)
{
- GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
- GtkCList *clist = GTK_CLIST(summaryview->ctree);
- GtkCTreeNode *node;
+ GtkWidget *ctree = summaryview->ctree;
GtkWidget *pixmap;
gtk_widget_destroy(summaryview->folder_pixmap);
- stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_MARK, &markxpm, &markxpmmask);
- stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_DELETED, &deletedxpm, &deletedxpmmask);
- stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_NEW, &newxpm, &newxpmmask);
- stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_UNREAD, &unreadxpm, &unreadxpmmask);
- stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_REPLIED, &repliedxpm, &repliedxpmmask);
- stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_FORWARDED, &forwardedxpm, &forwardedxpmmask);
- stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_CLIP, &clipxpm, &clipxpmmask);
- stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_LOCKED, &lockedxpm, &lockedxpmmask);
- stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_IGNORETHREAD, &ignorethreadxpm, &ignorethreadxpmmask);
- stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_CLIP_KEY, &clipkeyxpm, &clipkeyxpmmask);
- stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_KEY, &keyxpm, &keyxpmmask);
+ stock_pixmap_gdk(ctree, STOCK_PIXMAP_MARK, &markxpm, &markxpmmask);
+ stock_pixmap_gdk(ctree, STOCK_PIXMAP_DELETED, &deletedxpm, &deletedxpmmask);
+ stock_pixmap_gdk(ctree, STOCK_PIXMAP_NEW, &newxpm, &newxpmmask);
+ stock_pixmap_gdk(ctree, STOCK_PIXMAP_UNREAD, &unreadxpm, &unreadxpmmask);
+ stock_pixmap_gdk(ctree, STOCK_PIXMAP_REPLIED, &repliedxpm, &repliedxpmmask);
+ stock_pixmap_gdk(ctree, STOCK_PIXMAP_FORWARDED, &forwardedxpm, &forwardedxpmmask);
+ stock_pixmap_gdk(ctree, STOCK_PIXMAP_CLIP, &clipxpm, &clipxpmmask);
+ stock_pixmap_gdk(ctree, STOCK_PIXMAP_LOCKED, &lockedxpm, &lockedxpmmask);
+ stock_pixmap_gdk(ctree, STOCK_PIXMAP_IGNORETHREAD, &ignorethreadxpm, &ignorethreadxpmmask);
+ stock_pixmap_gdk(ctree, STOCK_PIXMAP_CLIP_KEY, &clipkeyxpm, &clipkeyxpmmask);
+ stock_pixmap_gdk(ctree, STOCK_PIXMAP_KEY, &keyxpm, &keyxpmmask);
pixmap = stock_pixmap_widget(summaryview->hbox, STOCK_PIXMAP_DIR_OPEN);
gtk_box_pack_start(GTK_BOX(summaryview->hbox), pixmap, FALSE, FALSE, 4);