summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterimnearbychat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterimnearbychat.cpp')
-rwxr-xr-xindra/newview/llfloaterimnearbychat.cpp48
1 files changed, 28 insertions, 20 deletions
diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp
index 56b0c15cb9..3d77ea4f0b 100755
--- a/indra/newview/llfloaterimnearbychat.cpp
+++ b/indra/newview/llfloaterimnearbychat.cpp
@@ -125,7 +125,7 @@ BOOL LLFloaterIMNearbyChat::postBuild()
setTitle(LLTrans::getString("NearbyChatTitle"));
// obsolete, but may be needed for backward compatibility?
- gSavedSettings.declareS32("nearbychat_showicons_and_names", 2, "NearByChat header settings", true);
+ gSavedSettings.declareS32("nearbychat_showicons_and_names", 2, "NearByChat header settings", LLControlVariable::PERSIST_NONDFT);
if (gSavedPerAccountSettings.getBOOL("LogShowHistory"))
{
@@ -138,19 +138,28 @@ BOOL LLFloaterIMNearbyChat::postBuild()
// virtual
void LLFloaterIMNearbyChat::closeHostedFloater()
{
- // Should check how many conversations are ongoing. Close all if 1 only (the Nearby Chat), select next one otherwise
+ // If detached from conversations window close anyway
+ if (!getHost())
+ {
+ setVisible(FALSE);
+ }
+
+ // Should check how many conversations are ongoing. Select next to "Nearby Chat" in case there are some other besides.
+ // Close conversations window in case "Nearby Chat" is attached and the only conversation
LLFloaterIMContainer* floater_container = LLFloaterIMContainer::getInstance();
if (floater_container->getConversationListItemSize() == 1)
{
- floater_container->closeFloater();
+ if (getHost())
+ {
+ floater_container->closeFloater();
+ }
}
else
{
if (!getHost())
{
- setVisible(FALSE);
+ floater_container->selectNextConversationByID(LLUUID());
}
- floater_container->selectNextConversationByID(LLUUID());
}
}
@@ -262,7 +271,7 @@ void LLFloaterIMNearbyChat::setVisibleAndFrontmost(BOOL take_focus, const LLSD&
{
LLFloaterIMSessionTab::setVisibleAndFrontmost(take_focus, key);
- if(!isTornOff() && matchesKey(key))
+ if(matchesKey(key))
{
LLFloaterIMContainer::getInstance()->selectConversationPair(mSessionID, true, take_focus);
}
@@ -296,7 +305,6 @@ void LLFloaterIMNearbyChat::onClose(bool app_quitting)
{
// Override LLFloaterIMSessionTab::onClose() so that Nearby Chat is not removed from the conversation floater
LLFloaterIMSessionTab::restoreFloater();
- onClickCloseBtn();
}
// virtual
@@ -306,13 +314,7 @@ void LLFloaterIMNearbyChat::onClickCloseBtn()
{
return;
}
- LLFloaterIMSessionTab::onTearOffClicked();
-
- LLFloaterIMContainer *im_box = LLFloaterIMContainer::findInstance();
- if (im_box)
- {
- im_box->onNearbyChatClosed();
- }
+ closeHostedFloater();
}
void LLFloaterIMNearbyChat::onChatFontChange(LLFontGL* fontp)
@@ -350,11 +352,17 @@ bool LLFloaterIMNearbyChat::isChatVisible() const
void LLFloaterIMNearbyChat::showHistory()
{
openFloater();
+ LLFloaterIMContainer::getInstance()->selectConversation(LLUUID(NULL));
+
if(!isMessagePaneExpanded())
{
restoreFloater();
setFocus(true);
}
+ else
+ {
+ LLFloaterIMContainer::getInstance()->setFocus(TRUE);
+ }
setResizeLimits(getMinWidth(), EXPANDED_MIN_HEIGHT);
}
@@ -568,7 +576,10 @@ void LLFloaterIMNearbyChat::sendChat( EChatType type )
if (0 == channel)
{
// discard returned "found" boolean
- LLGestureMgr::instance().triggerAndReviseString(utf8text, &utf8_revised_text);
+ if(!LLGestureMgr::instance().triggerAndReviseString(utf8text, &utf8_revised_text))
+ {
+ utf8_revised_text = utf8text;
+ }
}
else
{
@@ -582,7 +593,7 @@ void LLFloaterIMNearbyChat::sendChat( EChatType type )
if (!utf8_revised_text.empty())
{
// Chat with animation
- sendChatFromViewer(utf8_revised_text, type, TRUE);
+ sendChatFromViewer(utf8_revised_text, type, gSavedSettings.getBOOL("PlayChatAnim"));
}
}
@@ -636,10 +647,7 @@ void LLFloaterIMNearbyChat::addMessage(const LLChat& chat,bool archive,const LLS
void LLFloaterIMNearbyChat::onChatBoxCommit()
{
- if (mInputEditor->getText().length() > 0)
- {
- sendChat(CHAT_TYPE_NORMAL);
- }
+ sendChat(CHAT_TYPE_NORMAL);
gAgent.stopTyping();
}