Bug 288930 - Threading by subject: Subject Prefixes not case-insensitive
Summary: Threading by subject: Subject Prefixes not case-insensitive
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: message list (show other bugs)
Version: 4.7
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-14 00:54 UTC by Bernd Oliver Sünderhauf
Modified: 2012-11-05 14:09 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Oliver Sünderhauf 2011-12-14 00:54:29 UTC
Version:           4.7 (using KDE 4.7.3) 
OS:                Linux

When messages are threaded by subject, Subject Prefixes are not recognized on a case-insensitive basis as stated in the config dialog (Composer->Subject).

Reproducible: Didn't try

Steps to Reproduce:
Turn on threading by subject.
Now write three empty emails to yourself, each as a new email (not a reply), with the following subjects:
(1st) "Test"
(2nd) "Re: Test"
(3rd) "Re : Test"
(4th) "Re[2]: Test"
(5th) "RE: Test"
(6th) "RE : Test"
(7th) "RE[2]: Test"


Actual Results:  
You will find the 2nd, 3rd and 4th mail be wrapped under the 1st one, but not the 5th, 6th and 7th one.

Expected Results:  
The 5th, 6th and 7th mail should be wrapped just as well under the 1st message.

Additional remarks:
- The Subject Prefixes are indeed correctly recognized on a case-insensitive basis for replacement in an answer's subject.
Comment 1 Bernd Oliver Sünderhauf 2011-12-14 00:56:07 UTC
It's of course reproducible every time. Sorry.
Comment 2 Laurent Montel 2011-12-14 07:53:25 UTC
How we configure to thread by subject ?
Comment 3 Laurent Montel 2011-12-14 08:13:48 UTC
Was regexp do you use for threaded ? RE\*s ? or default value ?
Comment 4 Bernd Oliver Sünderhauf 2011-12-14 12:18:52 UTC
Re\s*:
Re\[\d+\]:
Re\d+:

That's what was given as defaults. Didn't change anything.
However, the regex can't be the problem, because they do work correctly (case-insensitive) for replacement in the subject line of a reply.
Obviously the regex needs to be declared case-insensitive in the code line where it is included for Subject Threading.
Comment 5 Bernd Oliver Sünderhauf 2011-12-14 12:21:28 UTC
Btw.: adding "RE\*s" in another line etc. makes it work.
So yes, it seems to be just a minor codefix.
Comment 6 Laurent Montel 2011-12-14 14:34:45 UTC
Ok but how we configure messagelist to thread just by subject ?
I can't reproduce bug so perhaps it's because I can't thread by subject.

could you add a screenshot please.
Thanks
Comment 7 Torgny Nyblom 2011-12-14 16:15:27 UTC
Git commit e12cb6ec46e2fd77df1a29015002075d5a5a5715 by Torgny Nyblom.
Committed on 14/12/2011 at 17:14.
Pushed by tnyblom into branch 'master'.

Make reply prefix case-insensitive

CCBUG: 288930

M  +1    -0    messagecore/stringutil.cpp

http://commits.kde.org/kdepim/e12cb6ec46e2fd77df1a29015002075d5a5a5715
Comment 8 Bernd Oliver Sünderhauf 2011-12-15 02:29:29 UTC
@Torgny:
Thanks. This looks good.
However, MessageComposer::MessageHelper::replacePrefixes() duplicates quite some code of MessageCore::StringUtil::stripOffPrefixes(), which contributed to this bug slipping through. It might be a good idea to consolidate these two functions.
Otherwise this should be fixed.

@Laurent:
Of course, it's not possible to make messagelist thread only by subject. However, if there is no exact match (In-Reply-To) and References don't help either, messagelist falls back on by-subject threading.
This might look like a rare scenario, but is in fact the predominant case, if interacting a lot with people using Microsoft Outlook.
Creating separate new mails with faked Re-prefixes (as proposed above) is just a way to reproduce this situation without using Outlook.
Comment 9 Laurent Montel 2011-12-15 09:17:32 UTC
I didn't see that theses two function was similar.
Will merge them.
Thanks.