Fix incorrect check in Selective Sync that prevented folder changes to propagate...
[pithos-ms-client] / trunk / Pithos.Core / Agents / FileAgent.cs
index 7db1293..b64773a 100644 (file)
@@ -94,7 +94,7 @@ namespace Pithos.Core.Agents
                     if (change.ChangeType == WatcherChangeTypes.Renamed)
                     {
                         var rename = (MovedEventArgs) change;
-                        _agent.Post(new WorkflowState
+                        _agent.Post(new WorkflowState(change)
                                         {
                                             AccountInfo = AccountInfo,
                                             OldPath = rename.OldFullPath,
@@ -105,7 +105,7 @@ namespace Pithos.Core.Agents
                                         });
                     }
                     else
-                        _agent.Post(new WorkflowState
+                        _agent.Post(new WorkflowState(change)
                         {
                             AccountInfo = AccountInfo,
                             Path = change.FullPath,
@@ -311,9 +311,12 @@ namespace Pithos.Core.Agents
                 return true;
             if (_ignoreFiles.ContainsKey(filePath.ToLower()))
                 return true;
-
+            
+            //If selective sync is enabled, propagate folder events
+            if (Selectives.IsSelectiveEnabled(AccountInfo.AccountKey) && Directory.Exists(filePath))
+                return false;
             //Ignore if selective synchronization is defined, 
-                //And the target file is not below any of the selective paths
+            //And the target file is not below any of the selective paths
             return !Selectives.IsSelected(AccountInfo, filePath);
         }