[smuxi/experiments/sqlite: 5/27] [Engine] Use milli-second precision in MessageModel.Equals()



commit 06938bf4388d9ec4b402e872be8684b511e1feff
Author: Mirco Bauer <meebey meebey net>
Date:   Thu Feb 23 23:03:07 2012 +0100

    [Engine] Use milli-second precision in MessageModel.Equals()

 src/Engine/Messages/MessageModel.cs |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/Engine/Messages/MessageModel.cs b/src/Engine/Messages/MessageModel.cs
index 679624c..24977fc 100644
--- a/src/Engine/Messages/MessageModel.cs
+++ b/src/Engine/Messages/MessageModel.cs
@@ -180,7 +180,8 @@ namespace Smuxi.Engine
                 return false;
             }
 
-            if (f_TimeStamp != msg.TimeStamp) {
+            // millisecond precision
+            if (Math.Abs(f_TimeStamp.Subtract(msg.TimeStamp).TotalMilliseconds) > 1) {
                 return false;
             }
             if (f_MessageType != msg.MessageType) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]