diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 01d39f0f5..21131a737 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -112,7 +112,11 @@ BOOL LLFloaterChat::postBuild() { mPanel = getChild("active_speakers_panel"); - getChild("toggle_active_speakers_btn")->setCommitCallback(boost::bind(&LLFloaterChat::onClickToggleActiveSpeakers, this, _2)); +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + getChild("toggle_active_speakers_btn")->setCommitCallback(boost::bind(&LLView::setVisible, mPanel, boost::bind(std::logical_and(), _2, !boost::bind(&RlvHandler::hasBehaviour, boost::ref(gRlvHandler), RLV_BHVR_SHOWNAMES)))); +// [/RLVa:KB] + //getChild("toggle_active_speakers_btn")->setCommitCallback(boost::bind(&LLView::setVisible, mPanel, _2)); + mChatPanel.connect(this,"chat_panel"); mChatPanel->setGestureCombo(getChild( "Gesture")); return TRUE; @@ -496,21 +500,11 @@ LLColor4 get_text_color(const LLChat& chat, bool from_im) } } - static const LLCachedControl mKeywordsChangeColor(gSavedPerAccountSettings, "KeywordsChangeColor", false); - static const LLCachedControl mKeywordsColor(gSavedPerAccountSettings, "KeywordsColor", LLColor4(1.f, 1.f, 1.f, 1.f)); - - if ((gAgent.getID() != chat.mFromID) && (chat.mSourceType != CHAT_SOURCE_SYSTEM)) + static const LLCachedControl sKeywordsChangeColor(gSavedPerAccountSettings, "KeywordsChangeColor", false); + if (sKeywordsChangeColor && gAgentID != chat.mFromID && chat.mSourceType != CHAT_SOURCE_SYSTEM && AscentKeyword::hasKeyword(chat.mText.substr(chat.mFromName.length()), 1)) { - if (mKeywordsChangeColor) - { - std::string shortmsg(chat.mText); - shortmsg.erase(0, chat.mFromName.length()); - - if (AscentKeyword::hasKeyword(shortmsg, 1)) - { - text_color = mKeywordsColor; - } - } + static const LLCachedControl sKeywordsColor(gSavedPerAccountSettings, "KeywordsColor", LLColor4(1.f, 1.f, 1.f, 1.f)); + text_color = sKeywordsColor; } return text_color; @@ -556,16 +550,6 @@ void* LLFloaterChat::createChatPanel(void* data) return new LLChatBar; } -// static -void LLFloaterChat::onClickToggleActiveSpeakers(const LLSD& val) -{ -// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) - mPanel->setVisible(val && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); -// [/RLVa:KB] - //mPanel->setVisible(val); -} - - //static bool LLFloaterChat::visible(LLFloater* instance, const LLSD& key) { diff --git a/indra/newview/llfloaterchat.h b/indra/newview/llfloaterchat.h index 3af635356..e1c55e779 100644 --- a/indra/newview/llfloaterchat.h +++ b/indra/newview/llfloaterchat.h @@ -71,7 +71,6 @@ public: static void triggerAlerts(const std::string& text); void onClickToggleShowMute(bool show_mute, class LLTextEditor* history_editor, LLTextEditor* history_editor_with_mute); - void onClickToggleActiveSpeakers(const LLSD& val); static void chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata); static void loadHistory(); static void* createSpeakersPanel(void* data); diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 802fc7608..255a428fb 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -510,7 +510,7 @@ BOOL LLFloaterIMPanel::postBuild() getChild("end_call_btn")->setCommitCallback(boost::bind(&LLIMMgr::endCall, gIMMgr, boost::ref(mSessionUUID))); getChild("send_btn")->setCommitCallback(boost::bind(&LLFloaterIMPanel::onSendMsg,this)); if (LLButton* btn = findChild("toggle_active_speakers_btn")) - btn->setCommitCallback(boost::bind(&LLFloaterIMPanel::onClickToggleActiveSpeakers, this, _2)); + btn->setCommitCallback(boost::bind(&LLView::setVisible, getChildView("active_speakers_panel"), _2)); mHistoryEditor = getChild("im_history"); mHistoryEditor->setParseHTML(TRUE); @@ -600,8 +600,6 @@ void LLFloaterIMPanel::draw() if (mSpeakerPanel) mSpeakerPanel->setVisible(true); mShowSpeakersOnConnect = false; } - if (LLUICtrl* ctrl = findChild("toggle_active_speakers_btn")) - ctrl->setValue(getChildView("active_speakers_panel")->getVisible()); if (mTyping) { @@ -1031,11 +1029,6 @@ void LLFloaterIMPanel::onClickHistory() } } -void LLFloaterIMPanel::onClickToggleActiveSpeakers(const LLSD& value) -{ - childSetVisible("active_speakers_panel", !value); -} - void LLFloaterIMPanel::onInputEditorFocusReceived() { if (gSavedSettings.getBOOL("LiruLegacyScrollToEnd")) diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index 83bfcd815..463df3147 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -105,7 +105,6 @@ public: void onClickHistory(); void onFlyoutCommit(class LLComboBox* flyout, const LLSD& value); - void onClickToggleActiveSpeakers(const LLSD& value); static void* createSpeakersPanel(void* data); //callbacks for P2P muting and volume control diff --git a/indra/newview/skins/default/xui/en-us/floater_chat_history.xml b/indra/newview/skins/default/xui/en-us/floater_chat_history.xml index 7143c352f..f7b05c724 100644 --- a/indra/newview/skins/default/xui/en-us/floater_chat_history.xml +++ b/indra/newview/skins/default/xui/en-us/floater_chat_history.xml @@ -18,7 +18,7 @@