summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-11-04 08:37:07 -0800
committerMerov Linden <merov@lindenlab.com>2012-11-04 08:37:07 -0800
commit749416fa7f9543c2b8a06e186b80c5e8ae354cb0 (patch)
treedec17ccc7b3618091e2dc98bd07334bec4201255 /indra/newview
parent7c7cc56b037f05f148a7215d0c5f567989a0c012 (diff)
parent00da007acdae01eafdef8c1b74ad042228a4eacc (diff)
Merge viewer-hui-441
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llimconversation.cpp60
-rw-r--r--indra/newview/llimfloater.cpp22
-rw-r--r--indra/newview/llimfloater.h3
3 files changed, 31 insertions, 54 deletions
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp
index 920666ef90..de769d95ac 100644
--- a/indra/newview/llimconversation.cpp
+++ b/indra/newview/llimconversation.cpp
@@ -29,6 +29,8 @@
#include "llimconversation.h"
+#include "llagent.h"
+#include "llavataractions.h"
#include "llchatentry.h"
#include "llchathistory.h"
#include "llchiclet.h"
@@ -419,50 +421,47 @@ void LLIMConversation::updateConversationViewParticipant(const LLUUID& participa
if (widget)
{
widget->refresh();
- refreshConversation();
}
+ refreshConversation();
}
void LLIMConversation::refreshConversation()
{
- // Debug : Check that all participant models do have a view (debug consistency check)
- /*
- LLParticipantList* item = getParticipantList();
- llinfos << "Merov debug : Start consistency check" << llendl;
- LLFolderViewModelItemCommon::child_list_t::const_iterator current_participant_model = item->getChildrenBegin();
- LLFolderViewModelItemCommon::child_list_t::const_iterator end_participant_model = item->getChildrenEnd();
- while (current_participant_model != end_participant_model)
+ // Note: We collect participants names to change the session name only in the case of ad-hoc conversations
+ bool is_ad_hoc = (mSession ? mSession->isAdHocSessionType() : false);
+ uuid_vec_t participants_uuids; // uuids vector for building the added participants name string
+ // For P2P chat, we still need to update the session name who may have changed (switch display name for instance)
+ if (mIsP2PChat && mSession)
{
- LLConversationItemParticipant* participant_model = dynamic_cast<LLConversationItemParticipant*>(*current_participant_model);
- if (participant_model != NULL)
- {
- LLUUID uuid = participant_model->getUUID();
- LLFolderViewItem* widget = get_ptr_in_map(mConversationsWidgets,uuid);
- if (!widget)
- {
- llinfos << "Merov debug : Consistency error! Couldn't find widget for " << participant_model->getName() << llendl;
- }
- else
- {
- llinfos << "Merov debug : Consistency check pass for " << participant_model->getName() << llendl;
- }
- }
- else
- {
- llinfos << "Merov debug : Consistency check, skip non participant child" << llendl;
- }
- current_participant_model++;
+ participants_uuids.push_back(mSession->mOtherParticipantID);
}
- llinfos << "Merov debug : End consistency check" << llendl;
- */
-
+
conversations_widgets_map::iterator widget_it = mConversationsWidgets.begin();
while (widget_it != mConversationsWidgets.end())
{
+ // Add the participant to the list except if it's the agent itself (redundant)
+ if (is_ad_hoc && (widget_it->first != gAgentID))
+ {
+ participants_uuids.push_back(widget_it->first);
+ }
widget_it->second->refresh();
widget_it->second->setVisible(TRUE);
++widget_it;
}
+ if (is_ad_hoc || mIsP2PChat)
+ {
+ // Build the session name and update it
+ std::string session_name;
+ if (participants_uuids.size() != 0)
+ {
+ LLAvatarActions::buildResidentsString(participants_uuids, session_name);
+ }
+ else
+ {
+ session_name = LLIMModel::instance().getName(mSessionID);
+ }
+ updateSessionName(session_name);
+ }
mConversationViewModel.requestSortAll();
mConversationsRoot->arrangeAll();
mConversationsRoot->update();
@@ -559,7 +558,6 @@ void LLIMConversation::hideOrShowTitle()
void LLIMConversation::updateSessionName(const std::string& name)
{
- llinfos << "Merov debug : updateSessionName, name = " << name << llendl;
mInputEditor->setLabel(LLTrans::getString("IM_to_label") + " " + name);
}
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index 607cdbd265..8742460689 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -270,14 +270,7 @@ void LLIMFloater::initIMFloater()
mInputEditor->setLabel(LLTrans::getString("IM_unavailable_text_label"));
}
- if (mIsP2PChat)
- {
- // look up display name for window title
- LLAvatarNameCache::get(mSession->mOtherParticipantID,
- boost::bind(&LLIMFloater::onAvatarNameCache,
- this, _1, _2));
- }
- else
+ if (!mIsP2PChat)
{
std::string session_name(LLIMModel::instance().getName(mSessionID));
updateSessionName(session_name);
@@ -530,18 +523,7 @@ void LLIMFloater::updateSessionName(const std::string& name)
{
LLIMConversation::updateSessionName(name);
setTitle(name);
-}
-
-void LLIMFloater::onAvatarNameCache(const LLUUID& agent_id,
- const LLAvatarName& av_name)
-{
- // Use display name for label
- updateSessionName(av_name.mDisplayName);
-
- // Overwrite the floater title with the extended name
- std::string ui_title = av_name.getCompleteName();
- setTitle(ui_title);
- mTypingStart.setArg("[NAME]", ui_title);
+ mTypingStart.setArg("[NAME]", name);
}
void LLIMFloater::onParticipantsListChanged(LLUICtrl* ctrl)
diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h
index 39210546fb..dba3a4bcbd 100644
--- a/indra/newview/llimfloater.h
+++ b/indra/newview/llimfloater.h
@@ -141,9 +141,6 @@ private:
// Update the window title and input field help text
/*virtual*/ void updateSessionName(const std::string& name);
- // For display name lookups for IM window titles
- void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name);
-
/// Updates the list of ad hoc conference participants
/// in an IM floater title.
void onParticipantsListChanged(LLUICtrl* ctrl);