#115 patch group alias - resolves issue where wildcard aliases were being matched against a temporary patch group id and removed from the alias list for the lifespan of the patch group. General cleanup of the rollup methods for the patch group alias. Adds a new method to alias list that allows alias lookup from a tgid while excluding wildcard talkgroups.

This commit is contained in:
Denny
2017-01-17 20:43:49 -05:00
parent 6a9e522d77
commit 95a6deaae1
3 changed files with 35 additions and 20 deletions

View File

@@ -133,19 +133,16 @@ public class PatchGroupAlias extends Alias
}
else
{
if(getId().size() > 0)
for(AliasID id: getId())
{
for(AliasID id: getId())
if(id.getType() == AliasIDType.TALKGROUP)
{
if(id.getType() == AliasIDType.TALKGROUP)
{
return "PATCH:" + ((TalkgroupID)id).getTalkgroup();
}
return "PATCH:" + ((TalkgroupID)id).getTalkgroup();
}
}
}
return "PATCH";
return "PATCH:****";
}
@Override
@@ -153,16 +150,22 @@ public class PatchGroupAlias extends Alias
{
List<AliasAction> aliasActions = new ArrayList<>();
for(Alias alias: mPatchedAliases)
{
aliasActions.addAll(alias.getAction());
}
if(hasPatchGroupAlias())
{
aliasActions.addAll(getPatchGroupAlias().getAction());
}
for(Alias alias: mPatchedAliases)
{
for(AliasAction action: alias.getAction())
{
if(!aliasActions.contains(action))
{
aliasActions.add(action);
}
}
}
return aliasActions;
}
@@ -187,7 +190,7 @@ public class PatchGroupAlias extends Alias
for(Alias alias: mPatchedAliases)
{
if(alias.getCallPriority() < highestPriority)
if(alias.hasCallPriority() && alias.getCallPriority() < highestPriority)
{
highestPriority = alias.getCallPriority();
}