fix(essentials): #865 Adds SelectedContactMethodCount join to report the number of methods for the selected contact

This commit is contained in:
Neil Dorin
2021-12-07 16:45:14 -07:00
parent 4552a15cbb
commit 90e22e9136
2 changed files with 22 additions and 1 deletions

View File

@@ -1204,6 +1204,20 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Analog
});
[JoinName("SelectedContactMethodCount")]
public JoinDataComplete SelectedContactMethodCount = new JoinDataComplete(
new JoinData
{
JoinNumber = 102,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Reports the number of contact methods for the selected contact",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("CameraPresetSelect")]
public JoinDataComplete CameraPresetSelect = new JoinDataComplete(
new JoinData

View File

@@ -972,6 +972,7 @@ ScreenIndexIsPinnedTo: {8} (a{17})
if (entry is DirectoryFolder)
{
codec.GetDirectoryFolderContents(entry.FolderId);
trilist.SetUshort(joinMap.SelectedContactMethodCount.JoinNumber, 0);
return;
}
@@ -998,10 +999,16 @@ ScreenIndexIsPinnedTo: {8} (a{17})
// If auto dial is disabled...
var entryToDial = entry as DirectoryContact;
if (entryToDial == null) return;
if (entryToDial == null)
{
trilist.SetUshort(joinMap.SelectedContactMethodCount.JoinNumber, 0);
return;
}
trilist.SetSigFalseAction(joinMap.DirectoryDialSelectedLine.JoinNumber, () => Dial(entryToDial.ContactMethods[0].Number));
trilist.SetUshort(joinMap.SelectedContactMethodCount.JoinNumber, (ushort)entryToDial.ContactMethods.Count);
var clearBytes = XSigHelpers.ClearOutputs();
trilist.SetString(joinMap.ContactMethods.JoinNumber,