summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llimconversation.cpp6
-rw-r--r--indra/newview/llimconversation.h3
-rw-r--r--indra/newview/llimfloater.cpp54
-rw-r--r--indra/newview/llimfloater.h4
4 files changed, 44 insertions, 23 deletions
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp
index aee6642150..a6a246a01e 100644
--- a/indra/newview/llimconversation.cpp
+++ b/indra/newview/llimconversation.cpp
@@ -508,6 +508,12 @@ void LLIMConversation::hideOrShowTitle()
floater_contents->setShape(contents_rect);
}
+void LLIMConversation::updateSessionName(const std::string& name)
+{
+ llinfos << "Merov debug : updateSessionName, name = " << name << llendl;
+ mInputEditor->setLabel(LLTrans::getString("IM_to_label") + " " + name);
+}
+
void LLIMConversation::hideAllStandardButtons()
{
for (S32 i = 0; i < BUTTON_COUNT; i++)
diff --git a/indra/newview/llimconversation.h b/indra/newview/llimconversation.h
index 4e66d000e6..2bd1582e87 100644
--- a/indra/newview/llimconversation.h
+++ b/indra/newview/llimconversation.h
@@ -104,6 +104,9 @@ protected:
/// Update floater header and toolbar buttons when hosted/torn off state is toggled.
void updateHeaderAndToolbar();
+ // Update the input field help text and other places that need the session name
+ virtual void updateSessionName(const std::string& name);
+
// set the enable/disable state for the Call button
virtual void enableDisableCallBtn();
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index 6d90b6a0b2..4e1bfb4e77 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -243,7 +243,6 @@ void LLIMFloater::initIMSession(const LLUUID& session_id)
{
mIsP2PChat = mSession->isP2PSessionType();
mSessionInitialized = mSession->mSessionInitialized;
-
mDialog = mSession->mType;
}
}
@@ -281,7 +280,7 @@ void LLIMFloater::initIMFloater()
else
{
std::string session_name(LLIMModel::instance().getName(mSessionID));
- updateSessionName(session_name, session_name);
+ updateSessionName(session_name);
// For ad hoc conferences we should update the title with participants names.
if ((IM_SESSION_INVITE == mDialog && !gAgent.isInGroup(mSessionID))
@@ -292,6 +291,8 @@ void LLIMFloater::initIMFloater()
mParticipantsListRefreshConnection.disconnect();
}
+ // CHUI-441: We shouldn't have any avatar_list anymore... see floater_im_session.xml
+ // *TODO: Track and delete if not necessary anymore
LLAvatarList* avatar_list = getChild<LLAvatarList>("speakers_list");
mParticipantsListRefreshConnection = avatar_list->setRefreshCompleteCallback(
boost::bind(&LLIMFloater::onParticipantsListChanged, this, _1));
@@ -525,20 +526,21 @@ void LLIMFloater::onVoiceChannelStateChanged(
updateCallBtnState(callIsActive);
}
-void LLIMFloater::updateSessionName(const std::string& ui_title,
- const std::string& ui_label)
+void LLIMFloater::updateSessionName(const std::string& name)
{
- mInputEditor->setLabel(LLTrans::getString("IM_to_label") + " " + ui_label);
- setTitle(ui_title);
+ LLIMConversation::updateSessionName(name);
+ setTitle(name);
}
void LLIMFloater::onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name)
{
- // Use display name only for labels, as the extended name will be in the
- // floater title
+ // Use display name for label
+ updateSessionName(av_name.mDisplayName);
+
+ // Overwrite the floater title with the extended name
std::string ui_title = av_name.getCompleteName();
- updateSessionName(ui_title, av_name.mDisplayName);
+ setTitle(ui_title);
mTypingStart.setArg("[NAME]", ui_title);
}
@@ -550,35 +552,45 @@ void LLIMFloater::onParticipantsListChanged(LLUICtrl* ctrl)
return;
}
- bool all_names_resolved = true;
std::vector<LLSD> participants_uuids;
uuid_vec_t temp_uuids; // uuids vector for building the added participants' names string
+ LLUUID unfound_id;
avatar_list->getValues(participants_uuids);
- // Check whether we have all participants names in LLAvatarNameCache
+ // Check participants names in LLAvatarNameCache
for (std::vector<LLSD>::const_iterator it = participants_uuids.begin(); it != participants_uuids.end(); ++it)
{
const LLUUID& id = it->asUUID();
- temp_uuids.push_back(id);
LLAvatarName av_name;
if (!LLAvatarNameCache::get(id, &av_name))
{
- all_names_resolved = false;
-
- // If a name is not found in cache, request it and continue the process recursively
- // until all ids are resolved into names.
- LLAvatarNameCache::get(id,
- boost::bind(&LLIMFloater::onParticipantsListChanged, this, avatar_list));
- break;
+ // Keep the first not found avatar id
+ if (unfound_id.isNull())
+ {
+ unfound_id = id;
+ }
}
+ else
+ {
+ // Add the participant to the list of existing names
+ temp_uuids.push_back(id);
+ }
}
- if (all_names_resolved)
+ if (temp_uuids.size() != 0)
{
+ // Build the session name and update it
std::string ui_title;
LLAvatarActions::buildResidentsString(temp_uuids, ui_title);
- updateSessionName(ui_title, ui_title);
+ updateSessionName(ui_title);
+ }
+
+ if (unfound_id.notNull())
+ {
+ // If a name is not found in cache, request it and continue the process recursively
+ // until all ids are resolved into names.
+ LLAvatarNameCache::get(unfound_id, boost::bind(&LLIMFloater::onParticipantsListChanged, this, avatar_list));
}
}
diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h
index 8a0d6f10e0..ec3a96f694 100644
--- a/indra/newview/llimfloater.h
+++ b/indra/newview/llimfloater.h
@@ -139,8 +139,8 @@ private:
/*virtual*/ void onClickCloseBtn();
- // Update the window title, input field help text, etc.
- void updateSessionName(const std::string& ui_title, const std::string& ui_label);
+ // 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);