From 06978c99d12a1261f3834fa2ebc19e24c54fd1d4 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 24 Oct 2012 13:06:30 +0300 Subject: CHUI-430 FIXED Open Nearby chat if is is the only conversation in the list. --- indra/newview/llimfloatercontainer.cpp | 16 ++++++++++++++++ indra/newview/llimfloatercontainer.h | 1 + 2 files changed, 17 insertions(+) diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index cf4d054dd5..7821f2ee0d 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -222,6 +222,7 @@ BOOL LLIMFloaterContainer::postBuild() void LLIMFloaterContainer::onOpen(const LLSD& key) { LLMultiFloater::onOpen(key); + openNearbyChat(); } // virtual @@ -508,6 +509,7 @@ void LLIMFloaterContainer::setVisible(BOOL visible) LLSD name("nearby_chat"); LLFloaterReg::toggleInstanceOrBringToFront(name); } + openNearbyChat(); } nearby_chat = LLFloaterReg::findTypedInstance("nearby_chat"); @@ -1491,4 +1493,18 @@ void LLIMFloaterContainer::toggleAllowTextChat(const LLUUID& participant_uuid) } } +void LLIMFloaterContainer::openNearbyChat() +{ + // If there's only one conversation in the container and that conversation is the nearby chat + //(which it should be...), open it so to make the list of participants visible. This happens to be the most common case when opening the Chat floater. + if(mConversationsItems.size() == 1) + { + LLConversationViewSession* nearby_chat = dynamic_cast(mConversationsWidgets[LLUUID()]); + if (nearby_chat) + { + nearby_chat->setOpen(TRUE); + } + } +} + // EOF diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index ba2d085858..75fed18502 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -138,6 +138,7 @@ private: void moderateVoiceAllParticipants(bool unmute); void moderateVoiceParticipant(const LLUUID& avatar_id, bool unmute); void toggleAllowTextChat(const LLUUID& participant_uuid); + void openNearbyChat(); LLButton* mExpandCollapseBtn; LLLayoutPanel* mMessagesPane; -- cgit v1.2.3