From d781742d8e966bedb7ac0f9e637003d090a35375 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 7 Aug 2019 17:58:08 +0100 Subject: Fix scope support to get friends list names across co-hosted grids --- OpenSim/Services/UserAccountService/UserAccountService.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'OpenSim/Services/UserAccountService/UserAccountService.cs') diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 24f436d..9ac8418 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -26,6 +26,7 @@ */ using System; +using System.Linq; using System.Collections.Generic; using System.Reflection; using log4net; @@ -292,15 +293,8 @@ namespace OpenSim.Services.UserAccountService public List GetUserAccounts(UUID scopeID, List IDs) { - // do it one at a time db access should be fast, so no need to break its api - List accs = new List(); - UUID uuid = UUID.Zero; - foreach(string id in IDs) - { - if (UUID.TryParse(id, out uuid) && uuid != UUID.Zero) - accs.Add(GetUserAccount(scopeID, uuid)); - } - return accs; + UserAccountData[] ret = m_Database.GetUsersWhere(scopeID, "PrincipalID in ('" + String.Join("', '", IDs) + "')"); + return new List(ret.Select((x) => MakeUserAccount(x))); } public void InvalidateCache(UUID userID) -- cgit v1.1