I'm running the Athens (Dec 2001) release of TWiki under SuSE Linux/Apache.
Issue
I just recently got WebNotify going and found it a little strange that a mail notification of changes over the last 24 hours should say in a message dated 08:00 on 04 Oct 2002:
Topics in TWiki.PA that changed since 02 Oct 2002 - 14:27 GMT:
...
ie it was going back to the 24-hours notified in the
previous email at 08:00 on 03 Oct, covering the period of 08:00 02 Oct to 08:00 03 Oct!
A more easily-understood - and cleaner - email would have said in the notification of 03 Oct:
Topics in TWiki.PA that have changed since 02 Oct 2002 - 0800 GMT:
<list of changes>
The last update to files in the PA web took place at 14:27 GMT 02 Oct 2002.
Exactly the same information as in the current implementation would have been communicated to users, but within the correct 24 hour time period.
Suggested changes
- The
.mailnotify file should store the last date/time that a notification run was performed ie 08:00 03 Oct 2002 in the above example, rather than the last topic modification date prior to the current run and should be made available to the mailnotify template as variable %LASTDATE%
- The date/time of the last modified file within the current 24-hour period (ie the final value of
$currLastmodify) should be made available as variable %LASTUPDATE%
This will require some minor changes to the rest of the script.
--
RichardLewis - 07 Oct 2002
Done! Now implemented on my version of
mailnotify with a corresponding change to
mailnotify.tmpl.
The diff file for mailnotify is:
89a90,91
> # Richard Lewis addition:
> my $currTime = time();
100c102,103
< if( $prevLastmodify eq $bar[2] ) {
---
> # Richard Lewis change: eq to ge
> if( $prevLastmodify ge $bar[2] ) {
167a171,172
> # Richard Lewis addition:
> $text =~ s/%LASTUPDATE%/&TWiki::formatGmTime($currLastmodify)/geo;
183c188,189
< &TWiki::Store::saveFile( "$dataDir/$webName/.mailnotify", $currLastmodify );
---
> # Richard Lewis change: $currLastmodify to $currTime
> &TWiki::Store::saveFile( "$dataDir/$webName/.mailnotify", $currTime );
mailnotify.tmpl now contains the lines:
Topics in %WIKITOOLNAME%.%WEB% that have changed since %LASTDATE% GMT:
%TOPICLIST%
The most recent change was on %LASTUPDATE% GMT.
Review recent changes in:
%SCRIPTURL%/view%SCRIPTSUFFIX%/%WEB%/WebChanges
--
RichardLewis - 07 Oct 2002
Did this go in?
--
MartinCleaver - 31 Mar 2004
Nope, it didn't. It is a good idea though, and the changes are pretty simple. Because there's no patch file attached I can't commit to taking care of this one just yet, so I'm marking it as
PatchAdjustmentRequired in case someone gets the itch to update it and attach a CVS diff. If not, I'll move it to
PatchReadyForCVS as soon as I can be sure I'll have time to take care of it promptly.
--
WalterMundt - 20 Apr 2004