From fc6fe75268d611fe1f4f87e698ae3df8e152c983 Mon Sep 17 00:00:00 2001 From: Cinder Date: Sun, 16 Aug 2015 14:54:15 -0600 Subject: MANTIS-7684 - Use the user management module to get username for script dialogs Signed-off-by: Diva Canto --- .../CoreModules/Avatar/Dialog/DialogModule.cs | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs') diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs index d26907b..4b41867 100644 --- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs @@ -133,13 +133,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog UUID objectID, UUID ownerID, string message, UUID textureID, int ch, string[] buttonlabels) { - UserAccount account = m_scene.UserAccountService.GetUserAccount( - m_scene.RegionInfo.ScopeID, ownerID); + string username = m_scene.UserManagementModule.GetUserName(ownerID); string ownerFirstName, ownerLastName; - if (account != null) + if (!String.IsNullOrEmpty(username)) { - ownerFirstName = account.FirstName; - ownerLastName = account.LastName; + ownerFirstName = username.Split(' ')[0]; + ownerLastName = username.Split(' ')[1]; } else { @@ -170,17 +169,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog } public void SendTextBoxToUser(UUID avatarid, string message, - int chatChannel, string name, UUID objectid, UUID ownerid) + int chatChannel, string name, UUID objectid, UUID ownerID) { - UserAccount account = m_scene.UserAccountService.GetUserAccount( - m_scene.RegionInfo.ScopeID, ownerid); + string username = m_scene.UserManagementModule.GetUserName(ownerID); string ownerFirstName, ownerLastName; - UUID ownerID = UUID.Zero; - if (account != null) + if (!String.IsNullOrEmpty(username)) { - ownerFirstName = account.FirstName; - ownerLastName = account.LastName; - ownerID = account.PrincipalID; + ownerFirstName = username.Split(' ')[0]; + ownerLastName = username.Split(' ')[1]; } else { -- cgit v1.1