diff options
Diffstat (limited to 'indra/newview/llfloaterimsession.cpp')
-rw-r--r-- | indra/newview/llfloaterimsession.cpp | 64 |
1 files changed, 35 insertions, 29 deletions
diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index f954e72376..557b3f27c5 100644 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -109,7 +109,7 @@ void LLFloaterIMSession::refresh() if (mMeTypingTimer.getElapsedTimeF32() > ME_TYPING_TIMEOUT && false == mShouldSendTypingState) { LL_DEBUGS("TypingMsgs") << "Send additional Start Typing packet" << LL_ENDL; - LLIMModel::instance().sendTypingState(mSessionID, mOtherParticipantUUID, TRUE); + LLIMModel::instance().sendTypingState(mSessionID, mOtherParticipantUUID, true); mMeTypingTimer.reset(); } @@ -138,8 +138,14 @@ void LLFloaterIMSession::onTearOffClicked() } // virtual -void LLFloaterIMSession::onClickCloseBtn(bool) +void LLFloaterIMSession::onClickCloseBtn(bool app_qutting) { + if (app_qutting) + { + LLFloaterIMSessionTab::onClickCloseBtn(); + return; + } + LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(mSessionID); if (session != NULL) @@ -331,7 +337,7 @@ void LLFloaterIMSession::initIMFloater() // Disable input editor if session cannot accept text if ( mSession && !mSession->mTextIMPossible ) { - mInputEditor->setEnabled(FALSE); + mInputEditor->setEnabled(false); mInputEditor->setLabel(LLTrans::getString("IM_unavailable_text_label")); } @@ -343,9 +349,9 @@ void LLFloaterIMSession::initIMFloater() } //virtual -BOOL LLFloaterIMSession::postBuild() +bool LLFloaterIMSession::postBuild() { - BOOL result = LLFloaterIMSessionTab::postBuild(); + bool result = LLFloaterIMSessionTab::postBuild(); mInputEditor->setMaxTextLength(1023); mInputEditor->setAutoreplaceCallback(boost::bind(&LLAutoReplace::autoreplaceCallback, LLAutoReplace::getInstance(), _1, _2, _3, _4, _5)); @@ -378,7 +384,7 @@ void LLFloaterIMSession::onAddButtonClicked() { LLView * button = findChild<LLView>("toolbar_panel")->findChild<LLButton>("add_btn"); LLFloater* root_floater = gFloaterView->getParentFloater(this); - LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterIMSession::addSessionParticipants, this, _1), TRUE, TRUE, FALSE, root_floater->getName(), button); + LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterIMSession::addSessionParticipants, this, _1), true, true, false, root_floater->getName(), button); if (!picker) { return; @@ -614,13 +620,13 @@ LLFloaterIMSession* LLFloaterIMSession::show(const LLUUID& session_id) LLTabContainer::eInsertionPoint i_pt = LLTabContainer::END; if (floater_container) { - floater_container->addFloater(floater, TRUE, i_pt); + floater_container->addFloater(floater, true, i_pt); } } floater->openFloater(floater->getKey()); - floater->setVisible(TRUE); + floater->setVisible(true); return floater; } @@ -678,7 +684,7 @@ void LLFloaterIMSession::setDocked(bool docked, bool pop_on_undock) } } -void LLFloaterIMSession::setMinimized(BOOL b) +void LLFloaterIMSession::setMinimized(bool b) { bool wasMinimized = isMinimized(); LLFloaterIMSessionTab::setMinimized(b); @@ -695,7 +701,7 @@ void LLFloaterIMSession::setMinimized(BOOL b) } } -void LLFloaterIMSession::setVisible(BOOL visible) +void LLFloaterIMSession::setVisible(bool visible) { LLNotificationsUI::LLScreenChannel* channel = static_cast<LLNotificationsUI::LLScreenChannel*> (LLNotificationsUI::LLChannelManager::getInstance()-> @@ -731,7 +737,7 @@ void LLFloaterIMSession::setVisible(BOOL visible) } -BOOL LLFloaterIMSession::getVisible() +bool LLFloaterIMSession::getVisible() { bool visible; @@ -750,7 +756,7 @@ BOOL LLFloaterIMSession::getVisible() } else { - // getVisible() returns TRUE when Tabbed IM window is minimized. + // getVisible() returns true when Tabbed IM window is minimized. visible = is_active && !im_container->isMinimized() && im_container->getVisible(); } @@ -763,7 +769,7 @@ BOOL LLFloaterIMSession::getVisible() return visible; } -void LLFloaterIMSession::setFocus(BOOL focus) +void LLFloaterIMSession::setFocus(bool focus) { LLFloaterIMSessionTab::setFocus(focus); @@ -791,8 +797,8 @@ bool LLFloaterIMSession::toggle(const LLUUID& session_id) } else if(floater && ((!floater->isDocked() || floater->getVisible()) && !floater->hasFocus())) { - floater->setVisible(TRUE); - floater->setFocus(TRUE); + floater->setVisible(true); + floater->setFocus(true); return true; } } @@ -998,7 +1004,7 @@ void LLFloaterIMSession::setTyping(bool typing) if ( mTypingTimer.getElapsedTimeF32() > 1.f ) { // Still typing, send 'start typing' notification - LLIMModel::instance().sendTypingState(mSessionID, mOtherParticipantUUID, TRUE); + LLIMModel::instance().sendTypingState(mSessionID, mOtherParticipantUUID, true); mShouldSendTypingState = false; mMeTypingTimer.reset(); } @@ -1006,7 +1012,7 @@ void LLFloaterIMSession::setTyping(bool typing) else { // Send 'stop typing' notification immediately - LLIMModel::instance().sendTypingState(mSessionID, mOtherParticipantUUID, FALSE); + LLIMModel::instance().sendTypingState(mSessionID, mOtherParticipantUUID, false); mShouldSendTypingState = false; } } @@ -1016,12 +1022,12 @@ void LLFloaterIMSession::setTyping(bool typing) LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID); if (speaker_mgr) { - speaker_mgr->setSpeakerTyping(gAgent.getID(), FALSE); + speaker_mgr->setSpeakerTyping(gAgent.getID(), false); } } } -void LLFloaterIMSession::processIMTyping(const LLUUID& from_id, BOOL typing) +void LLFloaterIMSession::processIMTyping(const LLUUID& from_id, bool typing) { LL_DEBUGS("TypingMsgs") << "typing=" << typing << LL_ENDL; if ( typing ) @@ -1062,7 +1068,7 @@ void LLFloaterIMSession::processAgentListUpdates(const LLSD& body) // process the moderator mutes if (agent_id == gAgentID && agent_data.has("info") && agent_data["info"].has("mutes")) { - BOOL moderator_muted_text = agent_data["info"]["mutes"]["text"].asBoolean(); + bool moderator_muted_text = agent_data["info"]["mutes"]["text"].asBoolean(); mInputEditor->setEnabled(!moderator_muted_text); std::string label; if (moderator_muted_text) @@ -1107,7 +1113,7 @@ void LLFloaterIMSession::processSessionUpdate(const LLSD& session_update) if ( false && session_update.has("moderated_mode") && session_update["moderated_mode"].has("voice") ) { - BOOL voice_moderated = session_update["moderated_mode"]["voice"]; + bool voice_moderated = session_update["moderated_mode"]["voice"]; const std::string session_label = LLIMModel::instance().getName(mSessionID); if (voice_moderated) @@ -1140,7 +1146,7 @@ void LLFloaterIMSession::draw() } // virtual -BOOL LLFloaterIMSession::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, +bool LLFloaterIMSession::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, @@ -1163,7 +1169,7 @@ BOOL LLFloaterIMSession::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, cargo_type, cargo_data, accept); } - return TRUE; + return true; } bool LLFloaterIMSession::dropPerson(LLUUID* person_id, bool drop) @@ -1186,21 +1192,21 @@ bool LLFloaterIMSession::dropPerson(LLUUID* person_id, bool drop) return res; } -BOOL LLFloaterIMSession::isInviteAllowed() const +bool LLFloaterIMSession::isInviteAllowed() const { return ( (IM_SESSION_CONFERENCE_START == mDialog) || (IM_SESSION_INVITE == mDialog && !gAgent.isInGroup(mSessionID)) || mIsP2PChat); } -BOOL LLFloaterIMSession::inviteToSession(const uuid_vec_t& ids) +bool LLFloaterIMSession::inviteToSession(const uuid_vec_t& ids) { LLViewerRegion* region = gAgent.getRegion(); bool is_region_exist = region != NULL; if (is_region_exist) { - S32 count = ids.size(); + auto count = ids.size(); if( isInviteAllowed() && (count > 0) ) { @@ -1210,7 +1216,7 @@ BOOL LLFloaterIMSession::inviteToSession(const uuid_vec_t& ids) LLSD data; data["params"] = LLSD::emptyArray(); - for (int i = 0; i < count; i++) + for (size_t i = 0; i < count; i++) { data["params"].append(ids[i]); } @@ -1274,7 +1280,7 @@ Note: OTHER_TYPING_TIMEOUT must be > ME_TYPING_TIMEOUT for proper operation of t LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID); if ( speaker_mgr ) { - speaker_mgr->setSpeakerTyping(from_id, TRUE); + speaker_mgr->setSpeakerTyping(from_id, true); } } } @@ -1291,7 +1297,7 @@ void LLFloaterIMSession::removeTypingIndicator(const LLUUID& from_id) LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID); if (speaker_mgr) { - speaker_mgr->setSpeakerTyping(from_id, FALSE); + speaker_mgr->setSpeakerTyping(from_id, false); } } } |