Bug 2927 - Optional case insensitivity for the attach-warner-plugin
Summary: Optional case insensitivity for the attach-warner-plugin
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Plugins/AttachWarner (show other bugs)
Version: 3.9.2
Hardware: PC Linux
: P3 enhancement
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2013-05-17 18:17 UTC by Henri Bauer
Modified: 2013-08-06 07:46 UTC (History)
1 user (show)

See Also:


Attachments
Patch proposal (6.06 KB, patch)
2013-05-17 18:17 UTC, Henri Bauer
no flags Details | Diff
Fix for address_keeper plugin (688 bytes, patch)
2013-05-21 16:40 UTC, Henri Bauer
no flags Details | Diff

Description Henri Bauer 2013-05-17 18:17:18 UTC
Created attachment 1266 [details]
Patch proposal

Add a checkbox in the attach-warner-plugin preferences in order to make patterns case insensitive. This is the new default behavior.

Side effect on the address-keeper-plugin, which uses the same function in matcher.c

address-keeper-plugin now also defaults to case insensitive (seams to be the best option for email addresses). I'm not sure it makes much sense to make this optional through the preferences dialog...

Another slight side-effect in matcher.c :

The matcherlist_new_from_lines function had different behaviors for unix-like and non-unix-like systems in terms of case sensitivity.

Now, the behavior is coherent and set by an additional boolean parameter.

I checked if this function was in use in the code base with a find/grep combination, but only found the two aforementioned plugins.

Certainly needs further testing, although there are only small changes in the code.
Comment 1 Ricardo Mones 2013-05-21 00:52:22 UTC
Thanks for the patch! Looks good!

> Add a checkbox in the attach-warner-plugin preferences in order to
> make patterns case insensitive. This is the new default behavior.

Well, that breaks the meaning of existing configurations so I've
kept this as case sensitive. Also reordered a bit the position of
the checkbox.

> Side effect on the address-keeper-plugin, which uses the same 
> function in matcher.c
>
> address-keeper-plugin now also defaults to case insensitive (seams
> to be the best option for email addresses). I'm not sure it makes 
> much sense to make this optional through the preferences dialog...

Probably not, as a@b.c is same address as A@B.C, cannot figure out
why one would like to keep both as if they were different.

> Another slight side-effect in matcher.c :
>
> The matcherlist_new_from_lines function had different behaviors
> for unix-like and non-unix-like systems in terms of case sensitivity.
>
> Now, the behavior is coherent and set by an additional boolean parameter.

Nice.

> I checked if this function was in use in the code base with a find/grep
> combination, but only found the two aforementioned plugins.

Yep, was common code on both, no other uses it, yet :)

> Certainly needs further testing, although there are only small changes
> in the code.

Tested and works well, committing.
Comment 2 Henri Bauer 2013-05-21 16:40:38 UTC
Created attachment 1268 [details]
Fix for address_keeper plugin

The logic has changed from "ignore_case" to "case_sensitive". This has an impact on the address_keeper plugin, which should NOT be case sensitive.
Comment 3 Henri Bauer 2013-05-21 16:44:43 UTC
(In reply to comment #2)
> Created attachment 1268 [details]
> Fix for address_keeper plugin
> 
> The logic has changed from "ignore_case" to "case_sensitive". This has an
> impact on the address_keeper plugin, which should NOT be case sensitive.

Sorry, I missed this one when I refactored my code, in order to stay coherent with the rest of the code base.
Comment 4 users 2013-06-11 14:08:07 UTC
Changes related to this bug have been committed.
Please check latest Git and update the bug accordingly.
You can also get the patch from:
http://git.claws-mail.org/

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=3459aff5b7bbabc9fcc84f1446dab8415716e566
Author: Ricardo Mones <ricardo@mones.org>
Date:   Tue Jun 11 14:04:59 2013 +0200

    Revert undesired effect of fixing bug #2927
    
    Patch thanks to Henri Bauer, also added to authors file.

Note You need to log in before you can comment on or make changes to this bug.