Re: [PATCH] filter issues

Dennis Preiser <[email protected]> Mon, 8 Mar 2010 19:00:03 +0100
Newsgroups gmane.network.tin.devel
Message-ID <[email protected]>
On Mon, Mar 08, 2010 at 09:41:28AM +0100, Urs Janßen wrote:
> with your patch: when in page level viewing an unscored article and
> pressing EditFilter ('E') but do not add/change a filter which would
> affect that article I get:
> 
> | Can't find base article 168
> 
> and I'm not returned to the article I viewed before. there are some
> filter rules active which might affect other threads/articles in that
> group, but as the last article viewed before 'E' is still unscored
> one should not be kicked back in the (in that case "emtpy"; all other
> threads were read and show_only_unread is on) group-level.

The current article (page level) is marked as read. find_base() (called
from make_threads()) skips all threads whith only unread articles when
show_only_unread is ON. Thus, the basenote of this thread is no longer
in base[] and which_thread() returns -1.

In other words: all read threads disappear after make_threads() when
show_only_unread is ON.

We could change the status of the current article temporary to unread at
page level before calling make_threads(). This would keep at least the
current thread in base[].  The patch below does this, but I'm not happy
with the disappearing read threads. I'll try to find a better solution.

Dennis

--- tin-1.9.6_r4/src/page.c	2010-03-07 18:05:17.000000000 +0100
+++ tin-1.9.6_r5/src/page.c	2010-03-08 18:51:39.000000000 +0100
@@ -680,10 +680,12 @@ page_goto_next_unread:
 					old_artnum = arts[this_resp].artnum;
 					unfilter_articles(group);
 					filter_articles(group);
+					arts[this_resp].status = ART_UNREAD;
 					make_threads(group, FALSE);
 					if ((n = find_artnum(old_artnum)) == -1 || which_thread(n) == -1) /* We have lost the thread */
 						return GRP_KILLED;
 					this_resp = n;
+					arts[this_resp].status = ART_READ;
 					draw_page(group->name, 0);
 					info_message((func == GLOBAL_QUICK_FILTER_KILL) ? _(txt_info_add_kill) : _(txt_info_add_select));
 				}
@@ -696,10 +698,12 @@ page_goto_next_unread:
 					old_artnum = arts[this_resp].artnum;
 					unfilter_articles(group);
 					filter_articles(group);
+					arts[this_resp].status = ART_UNREAD;
 					make_threads(group, FALSE);
 					if ((n = find_artnum(old_artnum)) == -1 || which_thread(n) == -1) /* We have lost the thread */
 						return GRP_KILLED;
 					this_resp = n;
+					arts[this_resp].status = ART_READ;
 				}
 				draw_page(group->name, 0);
 				break;
@@ -711,10 +715,12 @@ page_goto_next_unread:
 					unfilter_articles(group);
 					(void) read_filter_file(filter_file);
 					filter_articles(group);
+					arts[this_resp].status = ART_UNREAD;
 					make_threads(group, FALSE);
 					if ((n = find_artnum(old_artnum)) == -1 || which_thread(n) == -1) /* We have lost the thread */
 						return GRP_KILLED;
 					this_resp = n;
+					arts[this_resp].status = ART_READ;
 				}
 				draw_page(group->name, 0);
 				break;