summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelme.cpp
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2010-05-12 16:46:58 -0700
committerLeyla Farazha <leyla@lindenlab.com>2010-05-12 16:46:58 -0700
commitb95d1142a0a9c91388d4674951c319fff0785c0c (patch)
tree5828a8e719a01744aad6bea2ec63d90eecbcab08 /indra/newview/llpanelme.cpp
parentc3ccbecfdae1df3738775d1165cb3361b4f06d90 (diff)
parentbece97b1e11552a3feda74ffc24a5aac15728227 (diff)
Merge
Diffstat (limited to 'indra/newview/llpanelme.cpp')
-rw-r--r--indra/newview/llpanelme.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp
index 483741e643..f38c8859ef 100644
--- a/indra/newview/llpanelme.cpp
+++ b/indra/newview/llpanelme.cpp
@@ -352,8 +352,19 @@ void LLPanelMyProfileEdit::onDialogSetName(const LLSD& notification, const LLSD&
LLUUID agent_id = notification["payload"]["agent_id"];
if (agent_id.isNull()) return;
- std::string display_name = response["display_name"].asString();
- LLViewerDisplayName::set(display_name,
+ std::string display_name_utf8 = response["display_name"].asString();
+
+ const U32 DISPLAY_NAME_MAX_LENGTH = 31; // characters, not bytes
+ LLWString display_name_wstr = utf8string_to_wstring(display_name_utf8);
+ if (display_name_wstr.size() > DISPLAY_NAME_MAX_LENGTH)
+ {
+ LLSD args;
+ args["LENGTH"] = llformat("%d", DISPLAY_NAME_MAX_LENGTH);
+ LLNotificationsUtil::add("SetDisplayNameFailedLength", args);
+ return;
+ }
+
+ LLViewerDisplayName::set(display_name_utf8,
boost::bind(&LLPanelMyProfileEdit::onCacheSetName, this,
_1, _2, _3));
}