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:
parent
0179e20a01
commit
08e50f9e42
@ -948,6 +948,25 @@ namespace Acacia.Features.SharedFolders
|
|||||||
if (node.SharedFolder.SendAsAddress != textSendAsAddress.Text)
|
if (node.SharedFolder.SendAsAddress != textSendAsAddress.Text)
|
||||||
{
|
{
|
||||||
node.SharedFolder = node.SharedFolder.WithSendAsAddress(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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user