]> code.delx.au - offlineimap/commitdiff
Tweaks some more
authorJohn Goerzen <jgoerzen@complete.org>
Thu, 29 May 2008 03:05:37 +0000 (22:05 -0500)
committerJohn Goerzen <jgoerzen@complete.org>
Thu, 29 May 2008 03:05:37 +0000 (22:05 -0500)
src/Data/Syncable.hs

index fd5d1623406a1424e8d6991b7b7426ca2ca668c3..26752458b42bafdcab7a5fd283cc848c6f6c12b2 100644 (file)
@@ -117,14 +117,15 @@ syncBiDir masterstate childstate lastchildstate =
                           findAdded masterstate childstate $ lastchildstate)
                          ++ (map (pairToFunc ModifyContent) . Map.toList $ childPayloadChanges)
           masterPayloadChanges = 
-              findModified childstate lastchildstate
+              Map.union (findModified childstate lastchildstate)
+                 (findModified childstate masterstate)
           -- The child's payload takes precedence, so we are going to
           -- calculate the changes made on the master to apply to the client,
           -- then subtract out any items in the master changes that have the
           -- same key.
           childPayloadChanges = 
               foldl (flip Map.delete) (findModified masterstate lastchildstate)
-                    (Map.keys masterPayloadChanges)
+                    (Map.keys (findModified childstate masterstate))
                     
 
 {- | Compares two SyncCollections, and returns the commands that, when