mirror of
				https://github.com/Kopano-dev/kopano-ol-extension.git
				synced 2023-10-10 11:37:40 +00:00 
			
		
		
		
	[KOE-168] Added recursive setting of send-as address
This commit is contained in:
		@@ -948,6 +948,25 @@ namespace Acacia.Features.SharedFolders
 | 
			
		||||
                if (node.SharedFolder.SendAsAddress != textSendAsAddress.Text)
 | 
			
		||||
                {
 | 
			
		||||
                    node.SharedFolder = node.SharedFolder.WithSendAsAddress(textSendAsAddress.Text);
 | 
			
		||||
 | 
			
		||||
                    // Try any children
 | 
			
		||||
                    ApplySendAsAddressChildren(node, textSendAsAddress.Text);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void ApplySendAsAddressChildren(FolderTreeNode node, string address)
 | 
			
		||||
        {
 | 
			
		||||
            foreach(FolderTreeNode child in node.Children)
 | 
			
		||||
            {
 | 
			
		||||
                if (child.SharedFolder == null || !child.SharedFolder.FlagSendAsOwner)
 | 
			
		||||
                    continue;
 | 
			
		||||
 | 
			
		||||
                if (string.IsNullOrWhiteSpace(child.SharedFolder.SendAsAddress))
 | 
			
		||||
                {
 | 
			
		||||
                    child.SharedFolder = child.SharedFolder.WithSendAsAddress(address);
 | 
			
		||||
 | 
			
		||||
                    ApplySendAsAddressChildren(child, address);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user