summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llconversationmodel.cpp33
-rwxr-xr-xindra/newview/llconversationmodel.h6
-rw-r--r--indra/newview/llfloaterimcontainer.cpp2
-rwxr-xr-xindra/newview/llfloaterpreference.cpp13
4 files changed, 42 insertions, 12 deletions
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp
index b1f45d6d64..bc5b72e029 100644
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -434,24 +434,31 @@ void LLConversationItemParticipant::fetchAvatarName()
}
}
-void LLConversationItemParticipant::buildContextMenu(LLMenuGL& menu, U32 flags)
+void LLConversationItemParticipant::updateAvatarName()
{
- menuentry_vec_t items;
- menuentry_vec_t disabled_items;
-
- buildParticipantMenuOptions(items);
-
- hide_context_entries(menu, items, disabled_items);
+ llassert(getUUID().notNull());
+ if (getUUID().notNull())
+ {
+ LLAvatarName av_name;
+ if (LLAvatarNameCache::get(getUUID(),&av_name))
+ {
+ updateAvatarName(av_name);
+ }
+ }
}
void LLConversationItemParticipant::onAvatarNameCache(const LLAvatarName& av_name)
{
mAvatarNameCacheConnection.disconnect();
+ updateAvatarName(av_name);
+}
+void LLConversationItemParticipant::updateAvatarName(const LLAvatarName& av_name)
+{
mName = av_name.getUserName();
mDisplayName = av_name.getDisplayName();
mNeedsRefresh = true;
- if(mParent != NULL)
+ if (mParent != NULL)
{
LLConversationItemSession* parent_session = dynamic_cast<LLConversationItemSession*>(mParent);
if (parent_session != NULL)
@@ -463,6 +470,16 @@ void LLConversationItemParticipant::onAvatarNameCache(const LLAvatarName& av_nam
}
}
+void LLConversationItemParticipant::buildContextMenu(LLMenuGL& menu, U32 flags)
+{
+ menuentry_vec_t items;
+ menuentry_vec_t disabled_items;
+
+ buildParticipantMenuOptions(items);
+
+ hide_context_entries(menu, items, disabled_items);
+}
+
LLConversationItemSession* LLConversationItemParticipant::getParentSession()
{
LLConversationItemSession* parent_session = NULL;
diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h
index 743a6ba40b..6ae891203d 100755
--- a/indra/newview/llconversationmodel.h
+++ b/indra/newview/llconversationmodel.h
@@ -195,14 +195,16 @@ public:
virtual const bool getDistanceToAgent(F64& dist) const { dist = mDistToAgent; return (dist >= 0.0); }
- void fetchAvatarName();
+ void fetchAvatarName(); // fetch and update the avatar name
+ void updateAvatarName(); // get from the cache (do *not* fetch) and update the avatar name
LLConversationItemSession* getParentSession();
void dumpDebugData();
void setModeratorOptionsVisible(bool visible) { mDisplayModeratorOptions = visible; }
private:
- void onAvatarNameCache(const LLAvatarName& av_name);
+ void onAvatarNameCache(const LLAvatarName& av_name); // callback used by fetchAvatarName
+ void updateAvatarName(const LLAvatarName& av_name);
bool mIsMuted; // default is false
bool mIsModerator; // default is false
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 3c85f21188..e1288a763c 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -393,7 +393,7 @@ void LLFloaterIMContainer::processParticipantsStyleUpdate()
{
LLConversationItemParticipant* participant_model = dynamic_cast<LLConversationItemParticipant*>(*current_participant_model);
// Get the avatar name for this participant id from the cache and update the model
- participant_model->fetchAvatarName();
+ participant_model->updateAvatarName();
// Next participant
current_participant_model++;
}
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 13d8a79f8d..3d4a1c44d8 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -1682,6 +1682,17 @@ LLPanelPreference::LLPanelPreference()
//virtual
BOOL LLPanelPreference::postBuild()
{
+ ////////////////////// PanelGeneral ///////////////////
+ if (hasChild("display_names_check"))
+ {
+ BOOL use_people_api = gSavedSettings.getBOOL("UsePeopleAPI");
+ LLCheckBoxCtrl* ctrl_display_name = getChild<LLCheckBoxCtrl>("display_names_check");
+ ctrl_display_name->setEnabled(use_people_api);
+ if (!use_people_api)
+ {
+ ctrl_display_name->setValue(FALSE);
+ }
+ }
////////////////////// PanelVoice ///////////////////
if (hasChild("voice_unavailable"))
@@ -1732,7 +1743,7 @@ BOOL LLPanelPreference::postBuild()
getChild<LLCheckBoxCtrl>("favorites_on_login_check")->setCommitCallback(boost::bind(&showFavoritesOnLoginWarning, _1, _2));
}
- // Panel Advanced
+ //////////////////////PanelAdvanced ///////////////////
if (hasChild("modifier_combo"))
{
//localizing if push2talk button is set to middle mouse