From a61cbab799886e43749bc4d0803e579fec000f4c Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Mon, 4 May 2009 16:15:30 +0000
Subject: * Insert profile references for creators for items saved into iars
---
OpenSim/Framework/Communications/OspResolver.cs | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Framework/Communications')
diff --git a/OpenSim/Framework/Communications/OspResolver.cs b/OpenSim/Framework/Communications/OspResolver.cs
index 924a4a9..073abf8 100644
--- a/OpenSim/Framework/Communications/OspResolver.cs
+++ b/OpenSim/Framework/Communications/OspResolver.cs
@@ -50,7 +50,22 @@ namespace OpenSim.Framework.Communications
public const string OSPA_PAIR_SEPARATOR = "=";
///
- /// Make an OSPA given an avatar name
+ /// Make an OSPA given a user UUID
+ ///
+ ///
+ ///
+ /// The OSPA. Null if a user with the given UUID could not be found.
+ public static string MakeOspa(UUID userId, CommunicationsManager commsManager)
+ {
+ CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userId);
+ if (userInfo != null)
+ return MakeOspa(userInfo.UserProfile.FirstName, userInfo.UserProfile.SurName);
+
+ return null;
+ }
+
+ ///
+ /// Make an OSPA given a user name
///
///
///
@@ -58,7 +73,7 @@ namespace OpenSim.Framework.Communications
{
return
OSPA_PREFIX + OSPA_NAME_KEY + OSPA_PAIR_SEPARATOR + firstName + OSPA_NAME_VALUE_SEPARATOR + lastName;
- }
+ }
///
/// Resolve an osp string into the most suitable internal OpenSim identifier.
@@ -74,7 +89,7 @@ namespace OpenSim.Framework.Communications
/// return that same string. If the input string was ospi data but no valid profile information has been found,
/// then returns null.
///
- public static string Resolve(string ospa, CommunicationsManager commsManager)
+ public static string ResolveOspa(string ospa, CommunicationsManager commsManager)
{
m_log.DebugFormat("[OSP RESOLVER]: Resolving {0}", ospa);
--
cgit v1.1