summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-05-27 14:56:29 -0700
committerJames Cook <james@lindenlab.com>2010-05-27 14:56:29 -0700
commitc7a6a2e08f34b2cd21816a905c21e8017646001c (patch)
tree296ca43bd0267418649f0de8d2ee100e360736b0 /indra/newview
parent5250ac075a2bf2ce6712acdb908432229b110c1a (diff)
DEV-50013 Friendlier info if you can't change name due to time lockout
Reviewed with Leyla
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpanelme.cpp48
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml25
2 files changed, 51 insertions, 22 deletions
diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp
index 544ca47da4..eb2d57af52 100644
--- a/indra/newview/llpanelme.cpp
+++ b/indra/newview/llpanelme.cpp
@@ -305,11 +305,7 @@ void LLPanelMyProfileEdit::onCacheSetName(bool success,
{
// Inform the user that the change took place, but will take a while
// to percolate.
- LLSD args;
- // *TODO: get estimated percolation time from service
- S32 timeout_hours = 72;
- args["HOURS"] = llformat("%d", timeout_hours);
- LLNotificationsUtil::add("SetDisplayNameSuccess", args);
+ LLNotificationsUtil::add("SetDisplayNameSuccess");
// Re-fetch my name, as it may have been sanitized by the service
LLAvatarNameCache::get(getAvatarId(),
@@ -322,6 +318,7 @@ void LLPanelMyProfileEdit::onCacheSetName(bool success,
llinfos << "set name failure error_tag " << error_tag << llendl;
// We might have a localized string for this message
+ // error_args will usually be empty from the server.
if (!error_tag.empty()
&& LLNotifications::getInstance()->templateExists(error_tag))
{
@@ -382,29 +379,46 @@ void LLPanelMyProfileEdit::onDialogSetName(const LLSD& notification, const LLSD&
void LLPanelMyProfileEdit::onClickSetName()
{
- // IDEVO
LLUUID agent_id = getAvatarId();
std::string display_name;
LLAvatarName av_name;
- if (LLAvatarNameCache::useDisplayNames()
- && LLAvatarNameCache::get(agent_id, &av_name))
+ if (!LLAvatarNameCache::get(agent_id, &av_name))
{
- display_name = av_name.mDisplayName;
+ // something is wrong, tell user to try again later
+ LLNotificationsUtil::add("SetDisplayNameFailedGeneric");
+ return;
}
- else
+
+ display_name = av_name.mDisplayName;
+ if (display_name.empty())
{
- gCacheName->getFullName(agent_id, display_name);
+ // something is wrong, tell user to try again later
+ LLNotificationsUtil::add("SetDisplayNameFailedGeneric");
+ return;
}
- if (!display_name.empty())
+ F64 now_secs = LLDate::now().secondsSinceEpoch();
+ if (now_secs < av_name.mNextUpdate)
{
+ // ...can't update until some time in the future
+ F64 next_update_local_secs =
+ av_name.mNextUpdate - LLStringOps::getLocalTimeOffset();
+ LLDate next_update_local(next_update_local_secs);
+ // display as "July 18 12:17 PM"
+ std::string next_update_string =
+ next_update_local.toHTTPDateString("%B %d %I:%M %p");
LLSD args;
- args["DISPLAY_NAME"] = display_name;
- LLSD payload;
- payload["agent_id"] = agent_id;
- LLNotificationsUtil::add("SetDisplayName", args, payload,
- boost::bind(&LLPanelMyProfileEdit::onDialogSetName, this, _1, _2));
+ args["TIME"] = next_update_string;
+ LLNotificationsUtil::add("SetDisplayNameFailedLockout", args);
+ return;
}
+
+ LLSD args;
+ args["DISPLAY_NAME"] = display_name;
+ LLSD payload;
+ payload["agent_id"] = agent_id;
+ LLNotificationsUtil::add("SetDisplayName", args, payload,
+ boost::bind(&LLPanelMyProfileEdit::onDialogSetName, this, _1, _2));
}
void LLPanelMyProfileEdit::enableEditing(bool enable)
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 51b88cf59a..904084cfa7 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -3145,9 +3145,11 @@ You are no longer frozen.
icon="alertmodal.tga"
name="SetDisplayName"
type="alertmodal">
-Change your display name (used for name tags, chat, etc.)?
+Your new display name will be used for name tags, chat, friends lists, etc. You can also reset it back to your original username. There will be a delay before you can change your display name again, so choose wisely.
-You can also reset it back to your original username.
+See http://wiki.secondlife.com/wiki/Setting_your_display_name
+
+Change your display name?
<form name="form">
<input name="display_name" type="text">
[DISPLAY_NAME]
@@ -3174,9 +3176,19 @@ You can also reset it back to your original username.
type="alertmodal">
Thanks for updating your name!
-Just like in real life, it takes a while for everyone to learn about a new name. Please allow [HOURS] hours for your name to update in object ownership, scripts, search, etc.
+Just like in real life, it takes a while for everyone to learn about a new name. Please allow several days for your name to update in object ownership, scripts, search, etc.
-See http://wiki.secondlife.com/wiki/Setting_your_display_name for details.
+See http://wiki.secondlife.com/wiki/Setting_your_display_name
+ </notification>
+
+ <notification
+ icon="alertmodal.tga"
+ name="SetDisplayNameFailedLockout"
+ type="alertmodal">
+Sorry, you cannot change your display name until:
+[TIME]
+
+See http://wiki.secondlife.com/wiki/Setting_your_display_name
</notification>
<notification
@@ -3195,11 +3207,14 @@ Please try a shorter name.
Sorry, we could not set your display name. Please try again later.
</notification>
+<!-- *NOTE: This should never happen, users should see SetDisplayNameFailedLockout above -->
<notification
icon="alertmodal.tga"
name="AgentDisplayNameUpdateThresholdExceeded"
type="alertmodal">
-Sorry, you can only change your name once every 24 hours.
+Sorry, you have to wait longer before you can change your display name.
+
+See http://wiki.secondlife.com/wiki/Setting_your_display_name for details.
Please try again later.
</notification>