summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterimnearbychat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterimnearbychat.cpp')
-rw-r--r--indra/newview/llfloaterimnearbychat.cpp42
1 files changed, 37 insertions, 5 deletions
diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp
index dfaf4bbdd6..b287950c21 100644
--- a/indra/newview/llfloaterimnearbychat.cpp
+++ b/indra/newview/llfloaterimnearbychat.cpp
@@ -257,14 +257,25 @@ void LLFloaterIMNearbyChat::setVisible(BOOL visible)
}
}
+
+void LLFloaterIMNearbyChat::setVisibleAndFrontmost(BOOL take_focus, const LLSD& key)
+{
+ LLFloaterIMSessionTab::setVisibleAndFrontmost(take_focus, key);
+
+ if(!isTornOff() && matchesKey(key))
+ {
+ LLFloaterIMContainer::getInstance()->selectConversationPair(mSessionID, true, false);
+ }
+}
+
// virtual
void LLFloaterIMNearbyChat::onTearOffClicked()
{
LLFloaterIMSessionTab::onTearOffClicked();
// see CHUI-170: Save torn-off state of the nearby chat between sessions
- BOOL in_the_multifloater = !isTornOff();
- gSavedSettings.setBOOL("NearbyChatIsNotTornOff", in_the_multifloater);
+ BOOL in_the_multifloater = (BOOL)getHost();
+ gSavedPerAccountSettings.setBOOL("NearbyChatIsNotTornOff", in_the_multifloater);
}
@@ -279,6 +290,7 @@ void LLFloaterIMNearbyChat::onOpen(const LLSD& key)
void LLFloaterIMNearbyChat::onClose(bool app_quitting)
{
// Override LLFloaterIMSessionTab::onClose() so that Nearby Chat is not removed from the conversation floater
+ LLFloaterIMSessionTab::restoreFloater();
onClickCloseBtn();
}
@@ -286,8 +298,10 @@ void LLFloaterIMNearbyChat::onClose(bool app_quitting)
void LLFloaterIMNearbyChat::onClickCloseBtn()
{
if (!isTornOff())
+ {
return;
- onTearOffClicked();
+ }
+ LLFloaterIMSessionTab::onTearOffClicked();
LLFloaterIMContainer *im_box = LLFloaterIMContainer::findInstance();
if (im_box)
@@ -323,7 +337,7 @@ bool LLFloaterIMNearbyChat::isChatVisible() const
if (im_box != NULL)
{
isVisible =
- isChatMultiTab() && gSavedSettings.getBOOL("NearbyChatIsNotTornOff")?
+ isChatMultiTab() && gSavedPerAccountSettings.getBOOL("NearbyChatIsNotTornOff")?
im_box->getVisible() && !im_box->isMinimized() :
getVisible() && !isMinimized();
}
@@ -334,6 +348,11 @@ bool LLFloaterIMNearbyChat::isChatVisible() const
void LLFloaterIMNearbyChat::showHistory()
{
openFloater();
+ if(!isMessagePaneExpanded())
+ {
+ restoreFloater();
+ setFocus(true);
+ }
setResizeLimits(getMinWidth(), EXPANDED_MIN_HEIGHT);
}
@@ -406,6 +425,12 @@ BOOL LLFloaterIMNearbyChat::matchChatTypeTrigger(const std::string& in_str, std:
void LLFloaterIMNearbyChat::onChatBoxKeystroke()
{
+ LLFloaterIMContainer* im_box = LLFloaterIMContainer::findInstance();
+ if (im_box)
+ {
+ im_box->flashConversationItemWidget(mSessionID,false);
+ }
+
LLFirstUse::otherAvatarChatFirst(false);
LLWString raw_text = mInputEditor->getWText();
@@ -714,7 +739,14 @@ void LLFloaterIMNearbyChat::startChat(const char* line)
LLFloaterIMNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLFloaterIMNearbyChat>("nearby_chat");
if (nearby_chat)
{
- nearby_chat->show();
+ if(!nearby_chat->isTornOff())
+ {
+ nearby_chat->show();
+ }
+ if(nearby_chat->isMinimized())
+ {
+ nearby_chat->setMinimized(false);
+ }
nearby_chat->setVisible(TRUE);
nearby_chat->setFocus(TRUE);
nearby_chat->mInputEditor->setFocus(TRUE);