summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llcommon/llavatarname.cpp20
-rw-r--r--indra/llcommon/llavatarname.h5
-rw-r--r--indra/llcommon/llstring.cpp11
-rw-r--r--indra/newview/llpanelme.cpp48
-rw-r--r--indra/newview/llviewermessage.cpp2
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml25
6 files changed, 71 insertions, 40 deletions
diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp
index 13b6ad705b..14dc41591b 100644
--- a/indra/llcommon/llavatarname.cpp
+++ b/indra/llcommon/llavatarname.cpp
@@ -40,13 +40,13 @@
// Store these in pre-built std::strings to avoid memory allocations in
// LLSD map lookups
-static const std::string SL_ID("sl_id");
static const std::string USERNAME("username");
static const std::string DISPLAY_NAME("display_name");
static const std::string LEGACY_FIRST_NAME("legacy_first_name");
static const std::string LEGACY_LAST_NAME("legacy_last_name");
static const std::string IS_DISPLAY_NAME_DEFAULT("is_display_name_default");
static const std::string DISPLAY_NAME_EXPIRES("display_name_expires");
+static const std::string DISPLAY_NAME_NEXT_UPDATE("display_name_next_update");
LLAvatarName::LLAvatarName()
: mUsername(),
@@ -55,7 +55,8 @@ LLAvatarName::LLAvatarName()
mLegacyLastName(),
mIsDisplayNameDefault(false),
mIsDummy(false),
- mExpires(F64_MAX)
+ mExpires(F64_MAX),
+ mNextUpdate(0.0)
{ }
bool LLAvatarName::operator<(const LLAvatarName& rhs) const
@@ -75,28 +76,21 @@ LLSD LLAvatarName::asLLSD() const
sd[LEGACY_LAST_NAME] = mLegacyLastName;
sd[IS_DISPLAY_NAME_DEFAULT] = mIsDisplayNameDefault;
sd[DISPLAY_NAME_EXPIRES] = LLDate(mExpires);
+ sd[DISPLAY_NAME_NEXT_UPDATE] = LLDate(mNextUpdate);
return sd;
}
void LLAvatarName::fromLLSD(const LLSD& sd)
{
- // *HACK: accept both wire formats for now, as we are transitioning
- // People API to use "username"
- if (sd.has(USERNAME))
- {
- mUsername = sd[USERNAME].asString();
- }
- else
- {
- // *TODO: Remove
- mUsername = sd[SL_ID].asString();
- }
+ mUsername = sd[USERNAME].asString();
mDisplayName = sd[DISPLAY_NAME].asString();
mLegacyFirstName = sd[LEGACY_FIRST_NAME].asString();
mLegacyLastName = sd[LEGACY_LAST_NAME].asString();
mIsDisplayNameDefault = sd[IS_DISPLAY_NAME_DEFAULT].asBoolean();
LLDate expires = sd[DISPLAY_NAME_EXPIRES];
mExpires = expires.secondsSinceEpoch();
+ LLDate next_update = sd[DISPLAY_NAME_NEXT_UPDATE];
+ mNextUpdate = next_update.secondsSinceEpoch();
}
std::string LLAvatarName::getCompleteName() const
diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h
index 8b74e006c3..650a09a125 100644
--- a/indra/llcommon/llavatarname.h
+++ b/indra/llcommon/llavatarname.h
@@ -91,6 +91,11 @@ public:
// last checked.
// Unix time-from-epoch seconds for efficiency
F64 mExpires;
+
+ // You can only change your name every N hours, so record
+ // when the next update is allowed
+ // Unix time-from-epoch seconds
+ F64 mNextUpdate;
};
#endif
diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp
index b5a73ec1d1..637064d75f 100644
--- a/indra/llcommon/llstring.cpp
+++ b/indra/llcommon/llstring.cpp
@@ -694,14 +694,17 @@ void LLStringOps::setupDatetimeInfo (bool daylight)
nowT = time (NULL);
- tmpT = localtime (&nowT);
- localT = mktime (tmpT);
-
tmpT = gmtime (&nowT);
gmtT = mktime (tmpT);
+ tmpT = localtime (&nowT);
+ localT = mktime (tmpT);
+
sLocalTimeOffset = (long) (gmtT - localT);
-
+ if (tmpT->tm_isdst)
+ {
+ sLocalTimeOffset -= 60 * 60; // 1 hour
+ }
sPacificDaylightTime = daylight;
sPacificTimeOffset = (sPacificDaylightTime? 7 : 8 ) * 60 * 60;
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/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index ccd2f6ea0e..6ead2e2457 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -5017,7 +5017,7 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg)
const char* dest_type = (is_dest_group ? "group" : "agent");
std::string dest_slurl =
- LLSLURL( dest_type, dest_id, "inspect").getSLURLString();
+ LLSLURL( dest_type, dest_id, "completename").getSLURLString();
std::string reason =
reason_from_transaction_type(transaction_type, item_description);
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>