diff --git a/AuroraService/addon-modules/AuroraWebUI/Modules/WebUIHandler.cs b/AuroraService/addon-modules/AuroraWebUI/Modules/WebUIHandler.cs index 0832310..655e360 100644 --- a/AuroraService/addon-modules/AuroraWebUI/Modules/WebUIHandler.cs +++ b/AuroraService/addon-modules/AuroraWebUI/Modules/WebUIHandler.cs @@ -1472,40 +1472,68 @@ private OSDMap GetGroups(OSDMap map) OSDArray Groups = new OSDArray(); if (groups != null) { - Dictionary sort = new Dictionary(); - Dictionary boolFields = new Dictionary(); - - if (map.ContainsKey("Sort") && map["Sort"].Type == OSDType.Map) + if (!map.ContainsKey("GroupIDs")) { - OSDMap fields = (OSDMap)map["Sort"]; - foreach (string field in fields.Keys) + Dictionary sort = new Dictionary(); + Dictionary boolFields = new Dictionary(); + + if (map.ContainsKey("Sort") && map["Sort"].Type == OSDType.Map) { - sort[field] = int.Parse(fields[field]) != 0; + OSDMap fields = (OSDMap)map["Sort"]; + foreach (string field in fields.Keys) + { + sort[field] = int.Parse(fields[field]) != 0; + } } - } - if (map.ContainsKey("BoolFields") && map["BoolFields"].Type == OSDType.Map) - { - OSDMap fields = (OSDMap)map["BoolFields"]; - foreach (string field in fields.Keys) + if (map.ContainsKey("BoolFields") && map["BoolFields"].Type == OSDType.Map) { - boolFields[field] = int.Parse(fields[field]) != 0; + OSDMap fields = (OSDMap)map["BoolFields"]; + foreach (string field in fields.Keys) + { + boolFields[field] = int.Parse(fields[field]) != 0; + } } + List reply = groups.GetGroupRecords( + AdminAgentID, + start, + map.ContainsKey("Count") ? map["Count"].AsUInteger() : 10, + sort, + boolFields + ); + if (reply.Count > 0) + { + foreach (GroupRecord groupReply in reply) + { + Groups.Add(GroupRecord2OSDMap(groupReply)); + } + } + resp["Total"] = groups.GetNumberOfGroups(AdminAgentID, boolFields); } - List reply = groups.GetGroupRecords( - AdminAgentID, - start, - map.ContainsKey("Count") ? map["Count"].AsUInteger() : 10, - sort, - boolFields - ); - if (reply.Count > 0) + else { - foreach (GroupRecord groupReply in reply) + OSDArray groupIDs = (OSDArray)map["Groups"]; + List GroupIDs = new List(); + foreach (string groupID in groupIDs) { - Groups.Add(GroupRecord2OSDMap(groupReply)); + UUID foo; + if (UUID.TryParse(groupID, out foo)) + { + GroupIDs.Add(foo); + } + } + if (GroupIDs.Count > 0) + { + List reply = groups.GetGroupRecords(AdminAgentID, GroupIDs); + if (reply.Count > 0) + { + foreach (GroupRecord groupReply in reply) + { + Groups.Add(GroupRecord2OSDMap(groupReply)); + } + } + resp["Total"] = Groups.Count; } } - resp["Total"] = groups.GetNumberOfGroups(AdminAgentID, boolFields); } resp["Groups"] = Groups;