mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 21:24:54 +00:00
Merge pull request #1056 from PepperDash/hotfix/video-codec-base-updateDirectoryXsig
fix: updates to resolve directory issues
This commit is contained in:
@@ -1004,7 +1004,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
if (codec.DirectoryRoot != null)
|
if (codec.DirectoryRoot != null)
|
||||||
{
|
{
|
||||||
trilist.SetUshort(joinMap.DirectoryRowCount.JoinNumber, (ushort)codec.DirectoryRoot.CurrentDirectoryResults.Count);
|
var contactsCount = codec.DirectoryRoot.CurrentDirectoryResults.Where(c => c.ParentFolderId.Equals("root")).ToList().Count;
|
||||||
|
trilist.SetUshort(joinMap.DirectoryRowCount.JoinNumber, (ushort)contactsCount);
|
||||||
|
Debug.Console(2, this, ">>> contactsCount: {0}", contactsCount);
|
||||||
|
|
||||||
var clearBytes = XSigHelpers.ClearOutputs();
|
var clearBytes = XSigHelpers.ClearOutputs();
|
||||||
|
|
||||||
@@ -1020,7 +1022,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
codec.DirectoryResultReturned += (sender, args) =>
|
codec.DirectoryResultReturned += (sender, args) =>
|
||||||
{
|
{
|
||||||
trilist.SetUshort(joinMap.DirectoryRowCount.JoinNumber, (ushort)args.Directory.CurrentDirectoryResults.Count);
|
var isRoot = codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue == false;
|
||||||
|
var argsCount = isRoot
|
||||||
|
? args.Directory.CurrentDirectoryResults.Where(a => a.ParentFolderId.Equals("root")).ToList().Count
|
||||||
|
: args.Directory.CurrentDirectoryResults.Count;
|
||||||
|
|
||||||
|
trilist.SetUshort(joinMap.DirectoryRowCount.JoinNumber, (ushort)argsCount);
|
||||||
|
Debug.Console(2, this, ">>> argsCount: {0}", argsCount);
|
||||||
|
|
||||||
var clearBytes = XSigHelpers.ClearOutputs();
|
var clearBytes = XSigHelpers.ClearOutputs();
|
||||||
|
|
||||||
@@ -1191,26 +1199,29 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
? xSigMaxIndex
|
? xSigMaxIndex
|
||||||
: directory.CurrentDirectoryResults.Count];
|
: directory.CurrentDirectoryResults.Count];
|
||||||
|
|
||||||
Debug.Console(2, this, "IsRoot: {0}, Directory Count: {1}, TokenArray.Length: {2}", isRoot,
|
Debug.Console(2, this, "IsRoot: {0}, Directory Count: {1}, TokenArray.Length: {2}", isRoot, directory.CurrentDirectoryResults.Count, tokenArray.Length);
|
||||||
directory.CurrentDirectoryResults.Count, tokenArray.Length);
|
|
||||||
|
|
||||||
var contacts = directory.CurrentDirectoryResults.Count > xSigMaxIndex
|
var contacts = directory.CurrentDirectoryResults.Count > xSigMaxIndex
|
||||||
? directory.CurrentDirectoryResults.Take(xSigMaxIndex)
|
? directory.CurrentDirectoryResults.Take(xSigMaxIndex)
|
||||||
: directory.CurrentDirectoryResults;
|
: directory.CurrentDirectoryResults;
|
||||||
|
|
||||||
|
var contactsToDisplay = isRoot
|
||||||
|
? contacts.Where(c => c.ParentFolderId == "root")
|
||||||
|
: contacts.Where(c => c.ParentFolderId != "root");
|
||||||
|
|
||||||
var counterIndex = 1;
|
var counterIndex = 1;
|
||||||
foreach (var entry in contacts)
|
foreach (var entry in contactsToDisplay)
|
||||||
{
|
{
|
||||||
var arrayIndex = counterIndex - 1;
|
var arrayIndex = counterIndex - 1;
|
||||||
var entryIndex = counterIndex;
|
var entryIndex = counterIndex;
|
||||||
|
|
||||||
Debug.Console(2, this, "Entry{2:0000} Name: {0}, Folder ID: {1}", entry.Name, entry.FolderId, entryIndex);
|
Debug.Console(2, this, "Entry{2:0000} Name: {0}, Folder ID: {1}, Type: {3}, ParentFolderId: {4}",
|
||||||
|
entry.Name, entry.FolderId, entryIndex, entry.GetType().GetCType().FullName, entry.ParentFolderId);
|
||||||
|
|
||||||
if (entry is DirectoryFolder && entry.ParentFolderId == "root")
|
if (entry is DirectoryFolder)
|
||||||
{
|
{
|
||||||
tokenArray[arrayIndex] = new XSigSerialToken(entryIndex, String.Format("[+] {0}", entry.Name));
|
tokenArray[arrayIndex] = new XSigSerialToken(entryIndex, String.Format("[+] {0}", entry.Name));
|
||||||
|
|
||||||
counterIndex++;
|
|
||||||
counterIndex++;
|
counterIndex++;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@@ -1222,8 +1233,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
}
|
}
|
||||||
|
|
||||||
return GetXSigString(tokenArray);
|
return GetXSigString(tokenArray);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LinkVideoCodecCallControlsToApi(BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
private void LinkVideoCodecCallControlsToApi(BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||||
|
|||||||
@@ -303,11 +303,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
{
|
{
|
||||||
var contact = new InvitableDirectoryContact { Name = c.ScreenName, ContactId = c.Jid };
|
var contact = new InvitableDirectoryContact { Name = c.ScreenName, ContactId = c.Jid };
|
||||||
|
|
||||||
contact.ContactMethods.Add(new ContactMethod() { Number = c.Jid, Device = eContactMethodDevice.Video, CallType = eContactMethodCallType.Video, ContactMethodId = c.Jid });
|
contact.ContactMethods.Add(new ContactMethod()
|
||||||
|
{
|
||||||
|
Number = c.Jid,
|
||||||
|
Device = eContactMethodDevice.Video,
|
||||||
|
CallType = eContactMethodCallType.Video,
|
||||||
|
ContactMethodId = c.Jid
|
||||||
|
});
|
||||||
|
|
||||||
if (folders.Count > 0)
|
if (folders.Count > 0)
|
||||||
{
|
{
|
||||||
contact.ParentFolderId = c.IsZoomRoom ? "rooms" : "contacts";
|
contact.ParentFolderId = c.IsZoomRoom
|
||||||
|
? roomFolder.FolderId // "rooms"
|
||||||
|
: contactFolder.FolderId; // "contacts"
|
||||||
}
|
}
|
||||||
|
|
||||||
contacts.Add(contact);
|
contacts.Add(contact);
|
||||||
|
|||||||
Reference in New Issue
Block a user