summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-09-06 16:32:17 -0700
committerMerov Linden <merov@lindenlab.com>2012-09-06 16:32:17 -0700
commitee5e689331ff6ba44cebaf9e9fb48f7bc3f590c4 (patch)
tree4d27af57324725eddf3caf297f0ec24c4c5a29e5
parent1229f42ade088f69164b59742305119bacc8f4de (diff)
CHUI-285 : Completed. Update the names of the participants.
-rw-r--r--indra/newview/llconversationmodel.cpp8
-rw-r--r--indra/newview/llconversationmodel.h3
-rw-r--r--indra/newview/llparticipantlist.cpp5
3 files changed, 13 insertions, 3 deletions
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp
index aa21b08ec8..fa49987d15 100644
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -193,6 +193,14 @@ LLConversationItemParticipant::LLConversationItemParticipant(const LLUUID& uuid,
{
}
+void LLConversationItemParticipant::onAvatarNameCache(const LLAvatarName& av_name)
+{
+ mName = av_name.mDisplayName;
+ // *TODO : we should also store that one, to be used in the tooltip : av_name.mUsername
+ // *TODO : we need to request or initiate a list resort
+ mNeedsRefresh = true;
+}
+
void LLConversationItemParticipant::dumpDebugData()
{
llinfos << "Merov debug : participant, uuid = " << mUUID << ", name = " << mName << ", muted = " << mIsMuted << ", moderator = " << mIsModerator << llendl;
diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h
index 5947055e0f..26c7a29d76 100644
--- a/indra/newview/llconversationmodel.h
+++ b/indra/newview/llconversationmodel.h
@@ -29,6 +29,7 @@
#include "llfolderviewitem.h"
#include "llfolderviewmodel.h"
+#include "llavatarname.h"
// Implementation of conversations list
@@ -149,6 +150,8 @@ public:
void setIsMuted(bool is_muted) { mIsMuted = is_muted; mNeedsRefresh = true; }
void setIsModerator(bool is_moderator) { mIsModerator = is_moderator; mNeedsRefresh = true; }
+ void onAvatarNameCache(const LLAvatarName& av_name);
+
void dumpDebugData();
private:
diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index fa3432fc89..2282734109 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -652,6 +652,8 @@ void LLParticipantList::addAvatarIDExceptAgent(const LLUUID& avatar_id)
LLAvatarName avatar_name;
bool has_name = LLAvatarNameCache::get(avatar_id, &avatar_name);
participant = new LLConversationItemParticipant(!has_name ? LLTrans::getString("AvatarNameWaiting") : avatar_name.mDisplayName , avatar_id, mRootViewModel);
+ // Binds avatar's name update callback
+ LLAvatarNameCache::get(avatar_id, boost::bind(&LLConversationItemParticipant::onAvatarNameCache, participant, _2));
if (mAvatarList)
{
mAvatarList->getIDs().push_back(avatar_id);
@@ -670,9 +672,6 @@ void LLParticipantList::addAvatarIDExceptAgent(const LLUUID& avatar_id)
mAvalineUpdater->watchAvalineCaller(avatar_id);
}
- // *TODO : Merov : need to declare and bind a name update callback on that "participant" instance. See LLAvatarListItem::updateAvatarName() for pattern.
- // For the moment, we'll get the correct name only if it's already in the name cache (see call to LLAvatarNameCache::get() here above)
-
// *TODO : Merov : need to update the online/offline status of the participant.
// Hack for this: LLAvatarTracker::instance().isBuddyOnline(avatar_id))