After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 211058 - filter for 'x time in future' instead of past
filter for 'x time in future' instead of past
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
2.6.x (obsolete)
Other All
: Normal enhancement
: Future
Assigned To: evolution-mail-maintainers
Evolution QA team
evolution[filters]
: 235160 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2001-09-27 06:13 UTC by Trever Adams
Modified: 2007-05-11 05:56 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Update a table in an attempt to do future date filtering (959 bytes, patch)
2006-04-27 22:57 UTC, Trever Adams
none Details | Review
Tested patch for adding future dates instead of just "ago" (15.98 KB, patch)
2006-06-29 03:01 UTC, Trever Adams
committed Details | Review

Description Trever Adams 2001-09-27 06:12:45 UTC
Package: Evolution
Priority: Normal
Version: cvs.2001.0925.08.08
Synopsis: comparing time in filters
Bugzilla-Product: Evolution
Bugzilla-Component: Mailer

Description:
If date sent was after 1 month ago? umm.. how can I say if it is more
than so long in the future?

I hate getting mail with bad dates, so I am trying to write a filter
that kills it.


Comment 1 Luis Villa 2001-10-15 18:39:43 UTC
Would be handy at times.
Comment 2 André Klapper 2004-08-28 02:34:06 UTC
*** bug 235160 has been marked as a duplicate of this bug. ***
Comment 3 André Klapper 2005-02-28 21:21:53 UTC
adding "filters" keyword
Comment 4 Trever Adams 2006-04-27 22:57:25 UTC
Created attachment 64427 [details] [review]
Update a table in an attempt to do future date filtering

I may not be reading the code correctly. However, I believe I am. If I am, there just needs to be translation updates with this patch and all functionality will be present.
Comment 5 Trever Adams 2006-04-27 22:57:47 UTC
Is this as simple as changing (in /evolution/filter/filter-datespec.c):
static const timespan timespans[] = {
	{ 1, ngettext("1 second ago", "%d seconds ago"), 59.0 },
	{ 60, ngettext("1 minute ago", "%d minutes ago"), 59.0 },
	{ 3600, ngettext("1 hour ago", "%d hours ago"), 23.0 },
	{ 86400, ngettext("1 day ago", "%d days ago"), 31.0 },
	{ 604800, ngettext("1 week ago", "%d weeks ago"), 52.0 },
	{ 2419200, ngettext("1 month ago", "%d months ago"), 12.0 },
	{ 31557600, ngettext("1 year ago", "%d years ago"), 1000.0 },
};

to

static const timespan timespans[] = {
	{ 1, ngettext("1 second ago", "%d seconds ago"), 59.0 },
	{ 60, ngettext("1 minute ago", "%d minutes ago"), 59.0 },
	{ 3600, ngettext("1 hour ago", "%d hours ago"), 23.0 },
	{ 86400, ngettext("1 day ago", "%d days ago"), 31.0 },
	{ 604800, ngettext("1 week ago", "%d weeks ago"), 52.0 },
	{ 2419200, ngettext("1 month ago", "%d months ago"), 12.0 },
	{ 31557600, ngettext("1 year ago", "%d years ago"), 1000.0 },
	{ -1, ngettext("1 second in the future", "%d seconds in the future"), 59.0 },
	{ -60, ngettext("1 minute in the future", "%d minutes in the future"), 59.0 },
	{ -3600, ngettext("1 hour in the future", "%d hours in the future"), 23.0 },
	{ -86400, ngettext("1 day in the future", "%d days in the future"), 31.0 },
	{ -604800, ngettext("1 week in the future", "%d weeks in the future"), 52.0 },
	{ -2419200, ngettext("1 month in the future", "%d months in the future"), 12.0 },
	{ -31557600, ngettext("1 year in the future", "%d years in the future"), 1000.0 },
};

It seems to me that it would be. However, I always have problems compiling evolution CVS so I cannot try it. Would someone mind trying it. I have attached a patch. Of course, translations would be needed. I think I am reading this code right, but I might not be.
Comment 6 Trever Adams 2006-04-27 22:58:44 UTC
Changing version to 2.6.x as this bug is still present. Has been a bug since 1.5.x.
Comment 7 Trever Adams 2006-06-28 20:14:52 UTC
This patch as is is completely bogus. I am working on a new one outside of this bug report.
Comment 8 Trever Adams 2006-06-29 02:59:11 UTC
Ok, I learned a lot by seeing how my previous patch didn't work. I had a learning curve with rpmbuild (namely that you can't build rpms with the short circuit feature). Having spent hours from that here are my comments:

I will be submitting a patch. It has one hack in set_values function due to the hack to provide a history. It is much better than my other methods that required abs or other ways of doing abs. This one is safe for all platforms as written, I believe, and only requires one hack, versus several if done another way.

The patch is attached. I will be submitting it to the evolution patches mailing list. I have this patch in the redhat rawhide bugzilla. Bug 190359. They may be including it in rawhide for further testing. I have tested it for both future and past dates, everything works for me.
Comment 9 Trever Adams 2006-06-29 03:01:12 UTC
Created attachment 68141 [details] [review]
Tested patch for adding future dates instead of just "ago"

Sorry for some of the diff spam, this is due to me using glade-2 to do a few necessary changes.

This does not include any translation updates - they are needed!
Comment 10 Trever Adams 2006-07-11 04:01:27 UTC
This patch catches most of the spam that spamassassin does not for me because a good deal of the spam I get is from the future. Is there anyway this patch can be integrated. I have been using it now for about 2 weeks without any problems and with 100% success.
Comment 11 Trever Adams 2006-07-13 08:54:06 UTC
This patch has now been integrated (as of July 12, 2006) into Redhat Rawhide. I would like to see some testing by others here and inclusion when appropriate.
Comment 12 Srinivasa Ragavan 2007-05-11 05:56:58 UTC
Committed in svn trunk for 2.11.2