From e1e736eff89a279114d3fdc0381e1b669ea5a406 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 26 Apr 2011 14:02:41 -0700 Subject: EXP-752 FIX -- When "View Display Names" is disabled, only my own profile loads, when I click others profiles Avatar username is now looked up in the name cache when it is blank, which happens when display names are turned off apparently. Reviewed by Fredrik. --- indra/newview/llavataractions.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index ca7ec7cc30..cbbdcb2983 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -302,8 +302,14 @@ void LLAvatarActions::startConference(const uuid_vec_t& ids) static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarName& av_name) { - llinfos << "opening web profile for " << av_name.mUsername << llendl; - std::string url = getProfileURL(av_name.mUsername); + std::string username = av_name.mUsername; + if (username.empty()) + { + username = LLCacheName::buildUsername(av_name.mDisplayName); + } + + llinfos << "opening web profile for " << username << llendl; + std::string url = getProfileURL(username); // PROFILES: open in webkit window LLWeb::loadWebURLInternal(url, "", agent_id.asString()); -- cgit v1.2.3 From 31a2923b3d96ed4a04d0b27018fc71d0d66b6a5b Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 28 Apr 2011 14:56:46 -0700 Subject: EXP-749 FIX [REGRESSION] Voice status indicator shown in IM session instead of profile pic in Basic and Advanced modes reviewed by Leyla --- indra/llui/tests/llurlentry_stub.cpp | 2 +- indra/llui/tests/llurlmatch_test.cpp | 2 +- indra/llxuixml/llinitparam.cpp | 4 +- indra/llxuixml/llinitparam.h | 63 ++++++++++++++++------ .../skins/default/xui/en/widgets/avatar_icon.xml | 1 + .../skins/default/xui/en/widgets/scroll_bar.xml | 18 ++++--- 6 files changed, 63 insertions(+), 27 deletions(-) diff --git a/indra/llui/tests/llurlentry_stub.cpp b/indra/llui/tests/llurlentry_stub.cpp index 75946b2416..26b3b17577 100644 --- a/indra/llui/tests/llurlentry_stub.cpp +++ b/indra/llui/tests/llurlentry_stub.cpp @@ -127,7 +127,7 @@ namespace LLInitParam bool BaseBlock::deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack, S32 generation){ return true; } void BaseBlock::serializeBlock(Parser& parser, Parser::name_stack_t name_stack, const LLInitParam::BaseBlock* diff_block) const {} bool BaseBlock::inspectBlock(Parser& parser, Parser::name_stack_t name_stack, S32 min_value, S32 max_value) const { return true; } - bool BaseBlock::merge(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { return true; } + bool BaseBlock::mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { return true; } bool BaseBlock::validateBlock(bool emit_errors) const { return true; } ParamValue >::ParamValue(const LLUIColor& color) diff --git a/indra/llui/tests/llurlmatch_test.cpp b/indra/llui/tests/llurlmatch_test.cpp index aea605c9f2..e09ef33d49 100644 --- a/indra/llui/tests/llurlmatch_test.cpp +++ b/indra/llui/tests/llurlmatch_test.cpp @@ -101,7 +101,7 @@ namespace LLInitParam bool BaseBlock::deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack, S32 generation){ return true; } void BaseBlock::serializeBlock(Parser& parser, Parser::name_stack_t name_stack, const LLInitParam::BaseBlock* diff_block) const {} bool BaseBlock::inspectBlock(Parser& parser, Parser::name_stack_t name_stack, S32 min_count, S32 max_count) const { return true; } - bool BaseBlock::merge(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { return true; } + bool BaseBlock::mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { return true; } bool BaseBlock::validateBlock(bool emit_errors) const { return true; } ParamValue >::ParamValue(const LLUIColor& color) diff --git a/indra/llxuixml/llinitparam.cpp b/indra/llxuixml/llinitparam.cpp index 3c4eb70a5d..b3312798dd 100644 --- a/indra/llxuixml/llinitparam.cpp +++ b/indra/llxuixml/llinitparam.cpp @@ -375,7 +375,7 @@ namespace LLInitParam //static void BaseBlock::addParam(BlockDescriptor& block_data, const ParamDescriptorPtr in_param, const char* char_name) { - // create a copy of the paramdescriptor in allparams + // create a copy of the param descriptor in mAllParams // so other data structures can store a pointer to it block_data.mAllParams.push_back(in_param); ParamDescriptorPtr param(block_data.mAllParams.back()); @@ -469,7 +469,7 @@ namespace LLInitParam // take all provided params from other and apply to self // NOTE: this requires that "other" is of the same derived type as this - bool BaseBlock::merge(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) + bool BaseBlock::mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { bool some_param_changed = false; BlockDescriptor::all_params_list_t::const_iterator end_it = block_data.mAllParams.end(); diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index 858f8405b4..35c3106198 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -476,8 +476,12 @@ namespace LLInitParam void init(BlockDescriptor& descriptor, BlockDescriptor& base_descriptor, size_t block_size); + bool mergeBlockParam(bool param_provided, BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) + { + mergeBlock(block_data, other, overwrite); + } // take all provided params from other and apply to self - bool merge(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite); + bool mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite); // can be updated in getters mutable S32 mChangeVersion; @@ -896,12 +900,14 @@ namespace LLInitParam const self_t& src_typed_param = static_cast(src); self_t& dst_typed_param = static_cast(dst); - if (src_typed_param.isProvided() - && (overwrite || !dst_typed_param.isProvided())) + if (src_typed_param.anyProvided()) { - if (dst_typed_param.merge(param_value_t::selfBlockDescriptor(), src_typed_param, overwrite)) + bool param_provided = src_typed_param.isProvided() && (overwrite || !dst_typed_param.isProvided()); + if (dst_typed_param.mergeBlockParam(param_provided, param_value_t::selfBlockDescriptor(), src_typed_param, overwrite)) { dst_typed_param.clearValueName(); + dst_typed_param.setProvided(true); + dst_typed_param.enclosingBlock().paramChanged(dst_typed_param, true); return true; } } @@ -1082,6 +1088,12 @@ namespace LLInitParam std::copy(dst_typed_param.begin(), dst_typed_param.end(), std::back_inserter(new_values)); std::swap(dst_typed_param.mValues, new_values); } + + if (src_typed_param.begin() != src_typed_param.end()) + { + dst_typed_param.setProvided(true); + dst_typed_param.enclosingBlock().paramChanged(dst_typed_param, true); + } return true; } @@ -1282,6 +1294,13 @@ namespace LLInitParam std::copy(dst_typed_param.begin(), dst_typed_param.end(), std::back_inserter(new_values)); std::swap(dst_typed_param.mValues, new_values); } + + if (src_typed_param.begin() != src_typed_param.end()) + { + dst_typed_param.setProvided(true); + dst_typed_param.enclosingBlock().paramChanged(dst_typed_param, true); + } + return true; } @@ -1301,24 +1320,28 @@ namespace LLInitParam // take all provided params from other and apply to self bool overwriteFrom(const self_t& other) { - return merge(selfBlockDescriptor(), other, true); + return mergeBlock(selfBlockDescriptor(), other, true); } // take all provided params that are not already provided, and apply to self bool fillFrom(const self_t& other) { - return merge(selfBlockDescriptor(), other, false); + return mergeBlock(selfBlockDescriptor(), other, false); } - // merge with other block - bool merge(BlockDescriptor& block_data, const self_t& other, bool overwrite) + bool mergeBlockParam(bool param_provided, BlockDescriptor& block_data, const self_t& other, bool overwrite) { - // only merge a choice if we are overwriting with other's contents - if (overwrite) + if (param_provided) { - mCurChoice = other.mCurChoice; - return BaseBlock::merge(selfBlockDescriptor(), other, overwrite); + mergeBlock(block_data, other, overwrite); } + } + + // merge with other block + bool mergeBlock(BlockDescriptor& block_data, const self_t& other, bool overwrite) + { + mCurChoice = other.mCurChoice; + return BaseBlock::mergeBlock(selfBlockDescriptor(), other, overwrite); return false; } @@ -1445,13 +1468,13 @@ namespace LLInitParam // take all provided params from other and apply to self bool overwriteFrom(const self_t& other) { - return static_cast(this)->merge(selfBlockDescriptor(), other, true); + return static_cast(this)->mergeBlock(selfBlockDescriptor(), other, true); } // take all provided params that are not already provided, and apply to self bool fillFrom(const self_t& other) { - return static_cast(this)->merge(selfBlockDescriptor(), other, false); + return static_cast(this)->mergeBlock(selfBlockDescriptor(), other, false); } virtual const BlockDescriptor& mostDerivedBlockDescriptor() const { return selfBlockDescriptor(); } @@ -1862,7 +1885,15 @@ namespace LLInitParam mValue = value; } - bool merge(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) + bool mergeBlockParam(bool param_provided, BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) + { + if (param_provided) + { + mergeBlock(block_data, other, overwrite); + } + } + + bool mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { const derived_t& src_typed_param = static_cast(other); @@ -1875,7 +1906,7 @@ namespace LLInitParam else { // merge individual parameters into destination - return block_t::merge(block_t::selfBlockDescriptor(), src_typed_param, overwrite); + return block_t::mergeBlock(block_t::selfBlockDescriptor(), src_typed_param, overwrite); } } diff --git a/indra/newview/skins/default/xui/en/widgets/avatar_icon.xml b/indra/newview/skins/default/xui/en/widgets/avatar_icon.xml index a1e32e44de..4d69dda7eb 100644 --- a/indra/newview/skins/default/xui/en/widgets/avatar_icon.xml +++ b/indra/newview/skins/default/xui/en/widgets/avatar_icon.xml @@ -1,6 +1,7 @@ diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml b/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml index 830ea12e41..e6d4bff8b5 100644 --- a/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml +++ b/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml @@ -6,20 +6,24 @@ track_color="ScrollbarTrackColor" thumb_color="ScrollbarThumbColor" thickness="15"> - - - - + -- cgit v1.2.3 From c14d9b6e5f3fb52d1c8e743c5d28d212551458a1 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 28 Apr 2011 16:56:05 -0700 Subject: fixed build --- indra/llxuixml/llinitparam.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index 35c3106198..70dad4c8bf 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -478,7 +478,7 @@ namespace LLInitParam bool mergeBlockParam(bool param_provided, BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { - mergeBlock(block_data, other, overwrite); + return mergeBlock(block_data, other, overwrite); } // take all provided params from other and apply to self bool mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite); @@ -1333,8 +1333,9 @@ namespace LLInitParam { if (param_provided) { - mergeBlock(block_data, other, overwrite); + return mergeBlock(block_data, other, overwrite); } + return false; } // merge with other block @@ -1889,8 +1890,9 @@ namespace LLInitParam { if (param_provided) { - mergeBlock(block_data, other, overwrite); + return mergeBlock(block_data, other, overwrite); } + return false; } bool mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) -- cgit v1.2.3 From 6e5794376d5b64dffd965265d484e67346e02f31 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 28 Apr 2011 19:04:08 -0700 Subject: STORM-1039 FIXED Bad iterator access in llavatarnamecache.cpp:564 fixed crash on startup --- indra/llmessage/llavatarnamecache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 33e6709983..e0b77e3105 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -554,7 +554,7 @@ void LLAvatarNameCache::eraseUnrefreshed() { sLastExpireCheck = now; - for (cache_t::iterator it = sCache.begin(); it != sCache.end(); ++it) + for (cache_t::iterator it = sCache.begin(); it != sCache.end();) { const LLAvatarName& av_name = it->second; if (av_name.mExpires < max_unrefreshed) @@ -564,7 +564,7 @@ void LLAvatarNameCache::eraseUnrefreshed() << " user '" << av_name.mUsername << "' " << "expired " << now - av_name.mExpires << " secs ago" << LL_ENDL; - sCache.erase(it); + sCache.erase(it++); } } LL_INFOS("AvNameCache") << sCache.size() << " cached avatar names" << LL_ENDL; -- cgit v1.2.3 From 443e38f94d3c8538b457304bbe17ed0ab04eeef2 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 28 Apr 2011 19:13:15 -0700 Subject: fixed build (again) --- indra/llxuixml/llinitparam.h | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index 70dad4c8bf..a853999e94 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -1343,7 +1343,6 @@ namespace LLInitParam { mCurChoice = other.mCurChoice; return BaseBlock::mergeBlock(selfBlockDescriptor(), other, overwrite); - return false; } // clear out old choice when param has changed -- cgit v1.2.3 From 72c43237fc184d07936edbc4f1dbd18d394c4ce9 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 28 Apr 2011 19:33:20 -0700 Subject: STORM-1039 FIXED Bad iterator access in llavatarnamecache.cpp:564 missed else case --- indra/llmessage/llavatarnamecache.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index e0b77e3105..97f2792686 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -566,6 +566,10 @@ void LLAvatarNameCache::eraseUnrefreshed() << LL_ENDL; sCache.erase(it++); } + else + { + ++it; + } } LL_INFOS("AvNameCache") << sCache.size() << " cached avatar names" << LL_ENDL; } -- cgit v1.2.3