From a41d414625b07c3aff9bdd7be487c5b908d6a49f Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 26 May 2010 16:45:54 -0700 Subject: DEV-50013 Viewer only reads "username" from People API never "sl_id" --- indra/llcommon/llavatarname.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 13b6ad705b..6e0582f865 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -40,7 +40,6 @@ // 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"); @@ -80,17 +79,7 @@ LLSD LLAvatarName::asLLSD() const 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(); -- cgit v1.2.3 From 39bf9a6eec24bc480a7f4de19a3e09b98b9ae5ef Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 26 May 2010 17:38:04 -0700 Subject: changed you paid... message to use non-linked name url --- indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') 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); -- cgit v1.2.3 From c7a6a2e08f34b2cd21816a905c21e8017646001c Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 27 May 2010 14:56:29 -0700 Subject: DEV-50013 Friendlier info if you can't change name due to time lockout Reviewed with Leyla --- indra/llcommon/llavatarname.cpp | 7 +++- indra/llcommon/llavatarname.h | 5 +++ indra/llcommon/llstring.cpp | 11 +++-- indra/newview/llpanelme.cpp | 48 ++++++++++++++-------- .../newview/skins/default/xui/en/notifications.xml | 25 ++++++++--- 5 files changed, 69 insertions(+), 27 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 6e0582f865..14dc41591b 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -46,6 +46,7 @@ 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(), @@ -54,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 @@ -74,6 +76,7 @@ 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; } @@ -86,6 +89,8 @@ void LLAvatarName::fromLLSD(const LLSD& sd) 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/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?
[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 + + + +Sorry, you cannot change your display name until: +[TIME] + +See http://wiki.secondlife.com/wiki/Setting_your_display_name + -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. -- cgit v1.2.3