summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llconversationmodel.cpp8
-rw-r--r--indra/newview/llconversationmodel.h3
-rw-r--r--indra/newview/llconversationview.cpp15
-rw-r--r--indra/newview/llconversationview.h1
-rw-r--r--indra/newview/llimfloatercontainer.cpp1
-rw-r--r--indra/newview/llparticipantlist.cpp5
6 files changed, 28 insertions, 5 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/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 2f71e92a7d..9f3df93aba 100644
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -100,7 +100,8 @@ LLConversationViewParticipant* LLConversationViewSession::findParticipant(const
void LLConversationViewSession::refresh()
{
// Refresh the session view from its model data
- // LLConversationItemSession* vmi = dynamic_cast<LLConversationItemSession*>(getViewModelItem());
+ LLConversationItem* vmi = dynamic_cast<LLConversationItem*>(getViewModelItem());
+ vmi->resetRefresh();
// Note: for the moment, all that needs to be done is done by LLFolderViewItem::refresh()
@@ -122,4 +123,16 @@ LLConversationViewParticipant::LLConversationViewParticipant( const LLConversati
{
}
+void LLConversationViewParticipant::refresh()
+{
+ // Refresh the participant view from its model data
+ LLConversationItem* vmi = dynamic_cast<LLConversationItem*>(getViewModelItem());
+ vmi->resetRefresh();
+
+ // Note: for the moment, all that needs to be done is done by LLFolderViewItem::refresh()
+
+ // Do the regular upstream refresh
+ LLFolderViewItem::refresh();
+}
+
// EOF
diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h
index 27ceb2af3b..a3755d9722 100644
--- a/indra/newview/llconversationview.h
+++ b/indra/newview/llconversationview.h
@@ -81,6 +81,7 @@ public:
bool hasSameValue(const LLUUID& uuid) { return (uuid == mUUID); }
+ virtual void refresh();
private:
LLUUID mUUID; // UUID of the participant
};
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index 1be0c5f075..56648d09b5 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -552,7 +552,6 @@ void LLIMFloaterContainer::repositioningWidgets()
}
}
-// CHUI-137 : Temporary implementation of conversations list
void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid)
{
bool is_nearby_chat = uuid.isNull();
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))