MANTIS-7684 - Use the user management module to get username for script dialogs

Signed-off-by: Diva Canto <diva@metaverseink.com>
0.8.2-post-fixes
Cinder 2015-08-16 14:54:15 -06:00 committed by Diva Canto
parent ce2aeb8424
commit fc6fe75268
1 changed files with 9 additions and 13 deletions

View File

@ -133,13 +133,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
UUID objectID, UUID ownerID, string message, UUID textureID, UUID objectID, UUID ownerID, string message, UUID textureID,
int ch, string[] buttonlabels) int ch, string[] buttonlabels)
{ {
UserAccount account = m_scene.UserAccountService.GetUserAccount( string username = m_scene.UserManagementModule.GetUserName(ownerID);
m_scene.RegionInfo.ScopeID, ownerID);
string ownerFirstName, ownerLastName; string ownerFirstName, ownerLastName;
if (account != null) if (!String.IsNullOrEmpty(username))
{ {
ownerFirstName = account.FirstName; ownerFirstName = username.Split(' ')[0];
ownerLastName = account.LastName; ownerLastName = username.Split(' ')[1];
} }
else else
{ {
@ -170,17 +169,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
} }
public void SendTextBoxToUser(UUID avatarid, string message, 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( string username = m_scene.UserManagementModule.GetUserName(ownerID);
m_scene.RegionInfo.ScopeID, ownerid);
string ownerFirstName, ownerLastName; string ownerFirstName, ownerLastName;
UUID ownerID = UUID.Zero; if (!String.IsNullOrEmpty(username))
if (account != null)
{ {
ownerFirstName = account.FirstName; ownerFirstName = username.Split(' ')[0];
ownerLastName = account.LastName; ownerLastName = username.Split(' ')[1];
ownerID = account.PrincipalID;
} }
else else
{ {