diff options
author | Diva Canto | 2015-08-16 21:23:41 -0700 |
---|---|---|
committer | Diva Canto | 2015-08-16 21:23:41 -0700 |
commit | 0cdd1165c80c6542927a8470e44346ee0e524085 (patch) | |
tree | 4b7fd605e2e575080aaded3b8a81b43d10bf3b27 | |
parent | MANTIS-7684 - Use the user management module to get username for script dialogs (diff) | |
download | opensim-SC_OLD-0cdd1165c80c6542927a8470e44346ee0e524085.zip opensim-SC_OLD-0cdd1165c80c6542927a8470e44346ee0e524085.tar.gz opensim-SC_OLD-0cdd1165c80c6542927a8470e44346ee0e524085.tar.bz2 opensim-SC_OLD-0cdd1165c80c6542927a8470e44346ee0e524085.tar.xz |
Minor improvement of previous patch.
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs index 4b41867..a896897 100644 --- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs | |||
@@ -134,11 +134,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
134 | int ch, string[] buttonlabels) | 134 | int ch, string[] buttonlabels) |
135 | { | 135 | { |
136 | string username = m_scene.UserManagementModule.GetUserName(ownerID); | 136 | string username = m_scene.UserManagementModule.GetUserName(ownerID); |
137 | string ownerFirstName, ownerLastName; | 137 | string ownerFirstName, ownerLastName = String.Empty; |
138 | if (!String.IsNullOrEmpty(username)) | 138 | if (!String.IsNullOrEmpty(username)) |
139 | { | 139 | { |
140 | ownerFirstName = username.Split(' ')[0]; | 140 | string[] parts = username.Split(' '); |
141 | ownerLastName = username.Split(' ')[1]; | 141 | ownerFirstName = parts[0]; |
142 | if (parts.Length > 1) | ||
143 | ownerLastName = username.Split(' ')[1]; | ||
142 | } | 144 | } |
143 | else | 145 | else |
144 | { | 146 | { |
@@ -172,11 +174,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
172 | int chatChannel, string name, UUID objectid, UUID ownerID) | 174 | int chatChannel, string name, UUID objectid, UUID ownerID) |
173 | { | 175 | { |
174 | string username = m_scene.UserManagementModule.GetUserName(ownerID); | 176 | string username = m_scene.UserManagementModule.GetUserName(ownerID); |
175 | string ownerFirstName, ownerLastName; | 177 | string ownerFirstName, ownerLastName = String.Empty; |
176 | if (!String.IsNullOrEmpty(username)) | 178 | if (!String.IsNullOrEmpty(username)) |
177 | { | 179 | { |
178 | ownerFirstName = username.Split(' ')[0]; | 180 | string[] parts = username.Split(' '); |
179 | ownerLastName = username.Split(' ')[1]; | 181 | ownerFirstName = parts[0]; |
182 | if (parts.Length > 1) | ||
183 | ownerLastName = username.Split(' ')[1]; | ||
180 | } | 184 | } |
181 | else | 185 | else |
182 | { | 186 | { |