Skip to content

Commit

Permalink
fix: corrects selectRecentNumber join, makes phonebook results limit …
Browse files Browse the repository at this point in the history
…configurable
  • Loading branch information
hbrock78 committed Nov 15, 2024
1 parent 9428e79 commit 6289bb2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/CiscoDirectory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class CiscoDirectory : CiscoRoomOsFeature, IHasDirectory
{
private int searchinProgress;

private int phonebookResultsLimit = 10;
private uint phonebookResultsLimit = 10;
private bool phoneBookIsLocal;
private bool currentDirectoryIsNotRoot;

Expand All @@ -30,8 +30,13 @@ public class CiscoDirectory : CiscoRoomOsFeature, IHasDirectory

public CiscoDirectory(CiscoRoomOsDevice parent) : base(parent.Key + "-directory")
{

this.parent = parent;


if (parent.phoneBookLimit != 0)
phonebookResultsLimit = parent.phoneBookLimit;

SearchIsInProgress = new BoolFeedback("SearchInProgress", () => searchinProgress > 0);

searchTimeout = new CTimer(_ =>
Expand All @@ -56,7 +61,7 @@ public void SearchDirectory(string searchString)
: "\"" + searchString + "\"";

var phonebookMode = phoneBookIsLocal ? "Local" : "Corporate";

var command = string.Format(
"xCommand Phonebook Search SearchString: {0} PhonebookType: {1} Limit: {2}",
nameToSearch, phonebookMode, phonebookResultsLimit);
Expand Down
2 changes: 1 addition & 1 deletion src/CiscoJoinMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ public class CiscoJoinMap : JoinMapBaseAdvanced
[JoinName("SelectRecentNumber")] public JoinDataComplete SelectRecentNumber = new JoinDataComplete(
new JoinData
{
JoinNumber = 171,
JoinNumber = 172,
JoinSpan = 1
},
new JoinMetadata
Expand Down
5 changes: 4 additions & 1 deletion src/CiscoRoomOsDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class CiscoRoomOsDevice : EssentialsDevice, IHasCodecCameras, IOnline, IC
internal readonly CiscoSelfView SelfView;
internal readonly CiscoLayouts Layouts;

internal readonly uint phoneBookLimit;

private readonly IBasicCommunication communications;
private readonly IList<CiscoRoomOsFeature> features = new List<CiscoRoomOsFeature>();
private readonly CTimer requestTimeout;
Expand All @@ -47,7 +49,8 @@ public CiscoRoomOsDevice(string key, string name, CiscoCodecConfig props, IBasic
{
username = props.Username ?? string.Empty;
password = props.Password ?? string.Empty;

phoneBookLimit = props.PhonebookResultsLimit;

this.communications = communications;

var gather = new CommunicationGather(communications, Delimiter);
Expand Down

0 comments on commit 6289bb2

Please sign in to comment.