From: John Goerzen Date: Thu, 29 May 2008 05:57:12 +0000 (-0500) Subject: Working to fix Syncable, but still issues X-Git-Url: https://code.delx.au/offlineimap/commitdiff_plain/ffa07115665104c8db15a4c39bdd492ed4e6d322 Working to fix Syncable, but still issues --- diff --git a/src/Data/Syncable.hs b/src/Data/Syncable.hs index 62e2ee4..d872905 100644 --- a/src/Data/Syncable.hs +++ b/src/Data/Syncable.hs @@ -118,10 +118,19 @@ syncBiDir masterstate childstate lastchildstate = findAdded masterstate childstate $ lastchildstate) ++ (map (pairToFunc ModifyContent) . Map.toList $ childPayloadChanges) masterPayloadChanges = - Map.intersection - (Map.union (findModified childstate lastchildstate) - (findModified childstate masterstate)) - masterstate + (Map.filterWithKey filterKV + (Map.intersection + (Map.union (findModified childstate lastchildstate) + (findModified childstate masterstate) + ) + masterstate + ) + ) + where filterKV k v = -- Eliminate changes that would set the value to what it already is + case Map.lookup k masterstate of + (Just m) -> m /= v + Nothing -> False + -- 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