Fixed #514: recent changes are never repeated in case of similar subsequent edits.

This commit is contained in:
Dario Solera 2010-03-30 12:26:27 +00:00
parent fb90ca2400
commit 2c65f30a1c
2 changed files with 16 additions and 2 deletions

View file

@ -16,5 +16,5 @@ using System.Reflection;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("3.0.2.523")]
[assembly: AssemblyFileVersion("3.0.2.523")]
[assembly: AssemblyVersion("3.0.2.524")]
[assembly: AssemblyFileVersion("3.0.2.524")]

View file

@ -36,6 +36,20 @@ namespace ScrewTurn.Wiki {
/// <param name="change">The change.</param>
/// <param name="descr">The description (optional).</param>
public static void AddChange(string page, string title, string messageSubject, DateTime dateTime, string user, Change change, string descr) {
RecentChange[] allChanges = GetAllChanges();
if(allChanges.Length > 0) {
RecentChange lastChange = allChanges[allChanges.Length - 1];
if(lastChange.Page == page && lastChange.Title == title &&
lastChange.MessageSubject == messageSubject + "" &&
lastChange.User == user &&
lastChange.Change == change &&
(dateTime - lastChange.DateTime).TotalMinutes <= 60) {
// Skip this change
return;
}
}
Settings.Provider.AddRecentChange(page, title, messageSubject, dateTime, user, change, descr);
}