1
0
mirror of https://github.com/Kopano-dev/kopano-ol-extension.git synced 2023-10-10 13:37:40 +02:00

[KOE-168] Added recursive setting of send-as address

This commit is contained in:
Patrick Simpson 2018-04-18 15:27:43 +03:00
parent 0179e20a01
commit 08e50f9e42

View File

@ -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);
}
}
}