Bug 1563

Summary: Folder view: show complete threads if they contain unread messages
Product: Claws Mail (GTK 2) Reporter: Malte J. Wetz <claws-mail-bugs>
Component: UI/Folder ListAssignee: users
Status: RESOLVED FIXED    
Severity: enhancement CC: bothie, dirtyepic
Priority: P3    
Version: 3.3.1   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Patch implementing this feature. none

Description Malte J. Wetz 2008-04-02 21:27:46 UTC
I would love to have the possibility to show all threads that contain at least one unread message (specifically in newsgroups).

claws-mail can either display all thread or hide all read messages, breaking the threads apart.

So if there is one unread message within a thread the entire thread should be displayed. Otherwise it should be hidden.
Comment 1 Bodo Thiesen 2008-06-13 07:36:27 UTC
Yea, just wanted to post the same Feature Request. Additionally, it would be nice to have the ability to sort the threads according to it's NEWEST message - regardless where exactly in the thread it is. So even a very old thread would be shown on top (bottom) together with the new threads if someone answers to that.
Comment 2 Colin Leroy 2008-06-13 07:46:08 UTC
(In reply to comment #1)
> Yea, just wanted to post the same Feature Request. Additionally, it would be
> nice to have the ability to sort the threads according to it's NEWEST message -
> regardless where exactly in the thread it is. So even a very old thread would
> be shown on top (bottom) together with the new threads if someone answers to
> that.

This is possible, using View/Sort/by thread date.
Comment 3 Paul Ollis 2010-04-08 21:55:23 UTC
Created attachment 829 [details]
Patch implementing this feature.

This patch implements this feature.

It only based on about 3-4 hours work, starting with no familiarity with the code. So this may be a dumb implementation and almost certainly needs tidying up. I am happily using the modified code, for the last 3 days.

I do not consider it finished, just proof of concept. However, if people think this is worth pursuing then I am happy to put it the additional effort to clean this up.
Comment 4 Colin Leroy 2010-04-09 10:09:09 UTC
This seems to be a nice patch. You can take a shortcut and stop traversing nodes as soon as you get an unread mail by returning TRUE from summary_update_is_read().
Comment 5 Graham P Davis 2011-11-15 20:27:41 UTC
I started using Claws a few days ago and was surprised that this option is not available. TB has "view ==> threads ==> threads with unread," Pan has a filter button "match only unread articles" but this keeps the whole thread visible. Knode has "filter ==> threads with unread." 

Could Claws have "view ==> hide read threads" in addition to "view ==> hide read messages?" I've now looked at Paul's patch and I see we're of the same mind. 

Any chance of Paul's patch getting implemented?
Comment 6 users 2011-11-19 16:15:36 UTC
Changes related to this bug have been committed.
Please check latest CVS and update the bug accordingly.
You can also get the patch from:
http://www.colino.net/claws-mail/

2011-11-19 [pawel]	3.7.10cvs90

	* src/folder.c
	* src/folder.h
	* src/folder_item_prefs.c
	* src/folderview.c
	* src/mainwindow.c
	* src/mainwindow.h
	* src/summaryview.c
	* src/summaryview.h
	* src/gtk/authors.h
		Fix bug #1563 'Folder view: show complete threads if they
		contain unread messages'
		Add option to show only threads with unread messages
		initial patch by Paul Ollis, my small additions:
		- when checking thread for unread finish on first unread
		- make thread options unavailable when threading is off
		- hide_unread_msgs and hide_unread_threads are mutually
		  exclusive options, set menus sensitivity accordingly
		- set folder item icon type similiar to hide_unread_msgs