summaryrefslogtreecommitdiff
path: root/indra/newview/llimfloatercontainer.cpp
diff options
context:
space:
mode:
authorMaximB ProductEngine <mberezhnoy@productengine.com>2012-11-01 20:22:55 +0200
committerMaximB ProductEngine <mberezhnoy@productengine.com>2012-11-01 20:22:55 +0200
commitb9116764a97dfdccf803315c8c3b0d29fa3ce654 (patch)
treeedeeb2af6d1a2bec9ed562edc224f448c0645940 /indra/newview/llimfloatercontainer.cpp
parent51cabb2089244f170b307b436e0014a872a145ed (diff)
parent424a80155ac755bc0191ddd44ef125bdbda39fa5 (diff)
merging into latest changes
Diffstat (limited to 'indra/newview/llimfloatercontainer.cpp')
-rw-r--r--indra/newview/llimfloatercontainer.cpp36
1 files changed, 17 insertions, 19 deletions
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index f46ecd905a..f85aa9a353 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -98,7 +98,7 @@ LLIMFloaterContainer::~LLIMFloaterContainer()
void LLIMFloaterContainer::sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id)
{
- LLIMFloater::addToHost(session_id);
+ LLIMConversation::addToHost(session_id);
addConversationListItem(session_id);
}
@@ -109,7 +109,7 @@ void LLIMFloaterContainer::sessionActivated(const LLUUID& session_id, const std:
void LLIMFloaterContainer::sessionVoiceOrIMStarted(const LLUUID& session_id)
{
- LLIMFloater::addToHost(session_id);
+ LLIMConversation::addToHost(session_id);
addConversationListItem(session_id);
}
@@ -358,16 +358,7 @@ void LLIMFloaterContainer::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
- LLUUID participant_id = participant_model->getUUID();
- LLAvatarName av_name;
- LLAvatarNameCache::get(participant_id,&av_name);
- // Avoid updating the model though if the cache is still waiting for its first update
- if (!av_name.mDisplayName.empty())
- {
- participant_model->onAvatarNameCache(av_name);
- }
- // Bind update to the next cache name signal
- LLAvatarNameCache::get(participant_id, boost::bind(&LLConversationItemParticipant::onAvatarNameCache, participant_model, _2));
+ participant_model->fetchAvatarName();
// Next participant
current_participant_model++;
}
@@ -499,9 +490,9 @@ void LLIMFloaterContainer::setVisible(BOOL visible)
}
nearby_chat = LLFloaterReg::findTypedInstance<LLNearbyChat>("nearby_chat");
- if (nearby_chat && !nearby_chat->isHostSet())
+ if (nearby_chat)
{
- nearby_chat->addToHost();
+ LLIMConversation::addToHost(LLUUID());
}
// We need to show/hide all the associated conversations that have been torn off
@@ -1215,6 +1206,7 @@ bool LLIMFloaterContainer::removeConversationListItem(const LLUUID& uuid, bool c
// Note : since the mConversationsItems is also the listener to the widget, deleting
// the widget will also delete its listener
bool isWidgetSelected = false;
+ LLFolderViewItem* new_selection = NULL;
conversations_widgets_map::iterator widget_it = mConversationsWidgets.find(uuid);
if (widget_it != mConversationsWidgets.end())
{
@@ -1222,6 +1214,11 @@ bool LLIMFloaterContainer::removeConversationListItem(const LLUUID& uuid, bool c
if (widget)
{
isWidgetSelected = widget->isSelected();
+ new_selection = mConversationsRoot->getNextFromChild(widget);
+ if(new_selection == NULL)
+ {
+ new_selection = mConversationsRoot->getPreviousFromChild(widget);
+ }
widget->destroyView();
}
}
@@ -1234,12 +1231,13 @@ bool LLIMFloaterContainer::removeConversationListItem(const LLUUID& uuid, bool c
if (change_focus)
{
setFocus(TRUE);
- conversations_widgets_map::iterator widget_it = mConversationsWidgets.begin();
- if (widget_it != mConversationsWidgets.end())
+ if(new_selection != NULL)
{
- mSelectedSession = widget_it->first;
- LLFolderViewItem* widget = widget_it->second;
- widget->selectItem();
+ LLConversationItem* vmi = dynamic_cast<LLConversationItem*>(new_selection->getViewModelItem());
+ if(vmi != NULL)
+ {
+ selectConversation(vmi->getUUID());
+ }
}
}
return isWidgetSelected;