From 6220ce33700d011be5831b1bb480c81dec98665e Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Mon, 5 Nov 2012 15:18:53 +0200 Subject: CHUI-450 (Your own name does not appear in nearby chat participant list if voice chat disabled) --- indra/newview/llvoicevivox.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index f1bf4a6d75..f236123ef1 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -394,7 +394,15 @@ const LLVoiceVersionInfo& LLVivoxVoiceClient::getVersion() void LLVivoxVoiceClient::updateSettings() { - setVoiceEnabled(gSavedSettings.getBOOL("EnableVoiceChat")); + if(!mAudioSession) + { + // If audio module is not initialized, pretend that voice is enabled, thus letting state machine to take a full cycle + setVoiceEnabled(true); + } + else + { + setVoiceEnabled(gSavedSettings.getBOOL("EnableVoiceChat")); + } setEarLocation(gSavedSettings.getS32("VoiceEarLocation")); std::string inputDevice = gSavedSettings.getString("VoiceInputAudioDevice"); @@ -1478,6 +1486,9 @@ void LLVivoxVoiceClient::stateMachine() mUpdateTimer.setTimerExpirySec(UPDATE_THROTTLE_SECONDS); sendPositionalUpdate(); } + + // Now that audio module is fully initialized, check for actual mVoiceEnabled value + updateSettings(); } break; -- cgit v1.2.3 From 990a8c6085b43cb0290a631b664b3160938b0536 Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Tue, 6 Nov 2012 22:44:22 +0200 Subject: CHUI-462 (Torn-off Nearby Chat can't be closed) --- indra/newview/llimconversation.cpp | 4 ---- indra/newview/llimfloatercontainer.cpp | 7 +++++++ indra/newview/llimfloatercontainer.h | 2 ++ indra/newview/llnearbychat.cpp | 22 +++++++++++++++++++++- indra/newview/llnearbychat.h | 2 ++ 5 files changed, 32 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp index b687e18cae..44cf300930 100644 --- a/indra/newview/llimconversation.cpp +++ b/indra/newview/llimconversation.cpp @@ -202,10 +202,6 @@ BOOL LLIMConversation::postBuild() if (isChatMultiTab()) { - if (mIsNearbyChat) - { - setCanClose(FALSE); - } result = LLFloater::postBuild(); } else diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index f85aa9a353..c9cd013317 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -1475,4 +1475,11 @@ void LLIMFloaterContainer::openNearbyChat() } } +void LLIMFloaterContainer::onNearbyChatClosed() +{ + // If nearby chat is the only remaining conversation and it is closed, close whole conversation floater as well + if (mConversationsItems.size() == 1) + closeFloater(); +} + // EOF diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 05ea94019b..16218fc287 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -92,6 +92,8 @@ public: LLUUID getSelectedSession() { return mSelectedSession; } void setSelectedSession(LLUUID sessionID) { mSelectedSession = sessionID; } + void onNearbyChatClosed(); + private: typedef std::map avatarID_panel_map_t; avatarID_panel_map_t mSessions; diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index d1c7c6bfd7..cf42fcb91a 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -293,7 +293,7 @@ void LLNearbyChat::setVisible(BOOL visible) setFocus(visible); } - +// virtual void LLNearbyChat::onTearOffClicked() { LLIMConversation::onTearOffClicked(); @@ -311,6 +311,26 @@ void LLNearbyChat::onOpen(const LLSD& key) showTranslationCheckbox(LLTranslate::isTranslationConfigured()); } +// virtual +void LLNearbyChat::onClose(bool app_quitting) +{ + // Override LLIMConversation::onClose() so that Nearby Chat is not removed from the conversation floater +} + +// virtual +void LLNearbyChat::onClickCloseBtn() +{ + if (!isTornOff()) + return; + onTearOffClicked(); + + LLIMFloaterContainer *im_box = LLIMFloaterContainer::findInstance(); + if (im_box) + { + im_box->onNearbyChatClosed(); + } +} + void LLNearbyChat::onChatFontChange(LLFontGL* fontp) { // Update things with the new font whohoo diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h index b155fd3c26..a6c4439b1d 100644 --- a/indra/newview/llnearbychat.h +++ b/indra/newview/llnearbychat.h @@ -52,6 +52,7 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void setFocus(BOOL focusFlag); /*virtual*/ void setVisible(BOOL visible); @@ -96,6 +97,7 @@ protected: void onChatFontChange(LLFontGL* fontp); /*virtual*/ void onTearOffClicked(); + /*virtual*/ void onClickCloseBtn(); static LLWString stripChannelNumber(const LLWString &mesg, S32* channel); EChatType processChatTypeTriggers(EChatType type, std::string &str); -- cgit v1.2.3 From 4ec5ee63e28a427d88dfc0329151eacaf375fdb6 Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Wed, 7 Nov 2012 12:07:52 +0200 Subject: CHUI-450 (Your own name does not appear in nearby chat participant list if voice chat disabled) Added audio module initialization without faking mVoiceEnabled value --- indra/newview/llspeakers.cpp | 2 +- indra/newview/llvoicevivox.cpp | 42 +++++++++++++++++------------------------- indra/newview/llvoicevivox.h | 2 ++ 3 files changed, 20 insertions(+), 26 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 46fd8c1290..726199b7aa 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -504,7 +504,7 @@ void LLSpeakerMgr::update(BOOL resort_ok) void LLSpeakerMgr::updateSpeakerList() { // are we bound to the currently active voice channel? - if ((!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive())) + if ((!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel)) { std::set participants; LLVoiceClient::getInstance()->getParticipantList(participants); diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index f236123ef1..839de395a7 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -291,6 +291,7 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() : mCaptureDeviceDirty(false), mRenderDeviceDirty(false), mSpatialCoordsDirty(false), + mIsInitialized(false), mMuteMic(false), mMuteMicDirty(false), @@ -394,15 +395,7 @@ const LLVoiceVersionInfo& LLVivoxVoiceClient::getVersion() void LLVivoxVoiceClient::updateSettings() { - if(!mAudioSession) - { - // If audio module is not initialized, pretend that voice is enabled, thus letting state machine to take a full cycle - setVoiceEnabled(true); - } - else - { - setVoiceEnabled(gSavedSettings.getBOOL("EnableVoiceChat")); - } + setVoiceEnabled(gSavedSettings.getBOOL("EnableVoiceChat")); setEarLocation(gSavedSettings.getS32("VoiceEarLocation")); std::string inputDevice = gSavedSettings.getString("VoiceInputAudioDevice"); @@ -528,7 +521,7 @@ void LLVivoxVoiceClient::requestVoiceAccountProvision(S32 retries) { LLViewerRegion *region = gAgent.getRegion(); - if ( region && mVoiceEnabled ) + if ( region && (mVoiceEnabled || !mIsInitialized)) { std::string url = region->getCapability("ProvisionVoiceAccountRequest"); @@ -699,7 +692,7 @@ void LLVivoxVoiceClient::stateMachine() setVoiceEnabled(false); } - if(mVoiceEnabled) + if(mVoiceEnabled || !mIsInitialized) { updatePosition(); } @@ -744,7 +737,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateDisabled case stateDisabled: - if(mTuningMode || (mVoiceEnabled && !mAccountName.empty())) + if(mTuningMode || ((mVoiceEnabled || !mIsInitialized) && !mAccountName.empty())) { setState(stateStart); } @@ -899,7 +892,7 @@ void LLVivoxVoiceClient::stateMachine() mTuningExitState = stateIdle; setState(stateMicTuningStart); } - else if(!mVoiceEnabled) + else if(!mVoiceEnabled && mIsInitialized) { // We never started up the connector. This will shut down the daemon. setState(stateConnectorStopped); @@ -1093,7 +1086,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateConnectorStart case stateConnectorStart: - if(!mVoiceEnabled) + if(!mVoiceEnabled && mIsInitialized) { // We were never logged in. This will shut down the connector. setState(stateLoggedOut); @@ -1111,7 +1104,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateConnectorStarted case stateConnectorStarted: // connector handle received - if(!mVoiceEnabled) + if(!mVoiceEnabled && mIsInitialized) { // We were never logged in. This will shut down the connector. setState(stateLoggedOut); @@ -1255,7 +1248,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateCreatingSessionGroup case stateCreatingSessionGroup: - if(mSessionTerminateRequested || !mVoiceEnabled) + if(mSessionTerminateRequested || !mVoiceEnabled && mIsInitialized) { // *TODO: Question: is this the right way out of this state setState(stateSessionTerminated); @@ -1271,7 +1264,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateRetrievingParcelVoiceInfo case stateRetrievingParcelVoiceInfo: // wait until parcel voice info is received. - if(mSessionTerminateRequested || !mVoiceEnabled) + if(mSessionTerminateRequested || !mVoiceEnabled && mIsInitialized) { // if a terminate request has been received, // bail and go to the stateSessionTerminated @@ -1291,7 +1284,7 @@ void LLVivoxVoiceClient::stateMachine() // Otherwise, if you log in but don't join a proximal channel (such as when your login location has voice disabled), your friends list won't sync. sendFriendsListUpdates(); - if(mSessionTerminateRequested || !mVoiceEnabled) + if(mSessionTerminateRequested || !mVoiceEnabled && mIsInitialized) { // TODO: Question: Is this the right way out of this state? setState(stateSessionTerminated); @@ -1372,7 +1365,7 @@ void LLVivoxVoiceClient::stateMachine() } // joinedAudioSession() will transition from here to stateSessionJoined. - if(!mVoiceEnabled) + if(!mVoiceEnabled && mIsInitialized) { // User bailed out during connect -- jump straight to teardown. setState(stateSessionTerminated); @@ -1419,7 +1412,7 @@ void LLVivoxVoiceClient::stateMachine() notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_JOINED); } - else if(!mVoiceEnabled) + else if(!mVoiceEnabled && mIsInitialized) { // User bailed out during connect -- jump straight to teardown. setState(stateSessionTerminated); @@ -1439,7 +1432,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateRunning case stateRunning: // steady state // Disabling voice or disconnect requested. - if(!mVoiceEnabled || mSessionTerminateRequested) + if(!mVoiceEnabled && mIsInitialized || mSessionTerminateRequested) { leaveAudioSession(); } @@ -1487,8 +1480,7 @@ void LLVivoxVoiceClient::stateMachine() sendPositionalUpdate(); } - // Now that audio module is fully initialized, check for actual mVoiceEnabled value - updateSettings(); + mIsInitialized = true; } break; @@ -1522,7 +1514,7 @@ void LLVivoxVoiceClient::stateMachine() // Always reset the terminate request flag when we get here. mSessionTerminateRequested = false; - if(mVoiceEnabled && !mRelogRequested) + if((mVoiceEnabled || !mIsInitialized) && !mRelogRequested) { // Just leaving a channel, go back to stateNoChannel (the "logged in but have no channel" state). setState(stateNoChannel); @@ -1550,7 +1542,7 @@ void LLVivoxVoiceClient::stateMachine() mAccountHandle.clear(); cleanUp(); - if(mVoiceEnabled && !mRelogRequested) + if((mVoiceEnabled || !mIsInitialized) && !mRelogRequested) { // User was logged out, but wants to be logged in. Send a new login request. setState(stateNeedsLogin); diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 1142a1a49c..f2a3a7d3dd 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -741,6 +741,8 @@ private: std::string mRenderDevice; bool mCaptureDeviceDirty; bool mRenderDeviceDirty; + + bool mIsInitialized; bool checkParcelChanged(bool update = false); -- cgit v1.2.3 From 7701d421e53da63731d969f66d743792fe72976f Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Wed, 7 Nov 2012 16:48:45 -0800 Subject: CHUI-484: Ensuring that the busy/do-no-disturb message is sent when the user is in the busy/do-not-disturb mode. --- indra/newview/llviewermessage.cpp | 40 +++++++++++++-------------------------- indra/newview/llviewermessage.h | 1 - 2 files changed, 13 insertions(+), 28 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 775280ca34..c5d25ebd1b 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -179,6 +179,8 @@ const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] = FALSE // TeleportYourAgent }; +static void busy_message (LLMessageSystem* msg, const LLUUID& from_id, const LLUUID& session_id = LLUUID::null); + bool friendship_offer_callback(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -2358,12 +2360,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) BOOL is_muted = LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat) // object IMs contain sender object id in session_id (STORM-1209) || dialog == IM_FROM_TASK && LLMuteList::getInstance()->isMuted(session_id); - BOOL is_linden = LLMuteList::getInstance()->isLinden(name); BOOL is_owned_by_me = FALSE; BOOL is_friend = (LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL) ? false : true; BOOL accept_im_from_only_friend = gSavedSettings.getBOOL("VoiceCallsFriendsOnly"); - chat.mMuted = is_muted && !is_linden; + chat.mMuted = is_muted; chat.mFromID = from_id; chat.mFromName = name; chat.mSourceType = (from_id.isNull() || (name == std::string(SYSTEM_FROM))) ? CHAT_SOURCE_SYSTEM : CHAT_SOURCE_AGENT; @@ -2401,7 +2402,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // do nothing -- don't distract newbies in // Prelude with global IMs } - else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) + else if (offline == IM_ONLINE && is_busy && name != SYSTEM_FROM) { // return a standard "busy" message, but only do it to online IM // (i.e. not other auto responses and not store-and-forward IM) @@ -2409,21 +2410,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { // if there is not a panel for this conversation (i.e. it is a new IM conversation // initiated by the other party) then... - std::string my_name; - LLAgentUI::buildFullname(my_name); - std::string response = gSavedPerAccountSettings.getString("BusyModeResponse"); - pack_instant_message( - gMessageSystem, - gAgent.getID(), - FALSE, - gAgent.getSessionID(), - from_id, - my_name, - response, - IM_ONLINE, - IM_BUSY_AUTO_RESPONSE, - session_id); - gAgent.sendReliableMessage(); + busy_message(msg, from_id, session_id); } // now store incoming IM in chat history @@ -2484,7 +2471,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) mute_im = true; } - if (!mute_im || is_linden) + if (!mute_im) { gIMMgr->addMessage( session_id, @@ -2658,11 +2645,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) break; case IM_GROUP_INVITATION: { - //if (!is_linden && (is_busy || is_muted)) - if ((is_busy || is_muted)) + if (is_busy || is_muted) { - LLMessageSystem *msg = gMessageSystem; - busy_message(msg,from_id); + busy_message(msg, from_id); } else { @@ -2974,7 +2959,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else if (is_busy) { - busy_message(msg,from_id); + busy_message(msg, from_id); } else { @@ -3261,7 +3246,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } } -void busy_message (LLMessageSystem* msg, LLUUID from_id) +static void busy_message (LLMessageSystem* msg, const LLUUID& from_id, const LLUUID& session_id) { if (gAgent.getBusy()) { @@ -3269,7 +3254,7 @@ void busy_message (LLMessageSystem* msg, LLUUID from_id) LLAgentUI::buildFullname(my_name); std::string response = gSavedPerAccountSettings.getString("BusyModeResponse"); pack_instant_message( - gMessageSystem, + msg, gAgent.getID(), FALSE, gAgent.getSessionID(), @@ -3277,7 +3262,8 @@ void busy_message (LLMessageSystem* msg, LLUUID from_id) my_name, response, IM_ONLINE, - IM_BUSY_AUTO_RESPONSE); + IM_BUSY_AUTO_RESPONSE, + session_id); gAgent.sendReliableMessage(); } } diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h index 594c22ed9c..b298f0060b 100644 --- a/indra/newview/llviewermessage.h +++ b/indra/newview/llviewermessage.h @@ -67,7 +67,6 @@ enum InventoryOfferResponse BOOL can_afford_transaction(S32 cost); void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_group = FALSE, S32 trx_type = TRANS_GIFT, const std::string& desc = LLStringUtil::null); -void busy_message (LLMessageSystem* msg, LLUUID from_id); void process_logout_reply(LLMessageSystem* msg, void**); void process_layer_data(LLMessageSystem *mesgsys, void **user_data); -- cgit v1.2.3 From c4eaaa3d6a08330863119d550d365315ba7526bb Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Thu, 8 Nov 2012 12:35:15 -0800 Subject: CHUI-484: Updating the code to rather than refer to it as Busy Mode, it now refers to it as Do Not Disturb mode. --- .../newview/app_settings/settings_per_account.xml | 8 +-- indra/newview/llagent.cpp | 36 ++++------ indra/newview/llagent.h | 9 ++- indra/newview/llappearancemgr.cpp | 6 -- indra/newview/llavataractions.cpp | 8 +-- indra/newview/llfloaterpreference.cpp | 46 +++++------- indra/newview/llfloaterpreference.h | 8 +-- indra/newview/llimview.cpp | 8 +-- indra/newview/llinventorybridge.cpp | 21 ------ indra/newview/llnearbychathandler.cpp | 2 +- indra/newview/llviewermenu.cpp | 24 +++---- indra/newview/llviewermenu.h | 2 +- indra/newview/llviewermessage.cpp | 83 ++++++++++------------ indra/newview/llviewerwindow.cpp | 4 +- indra/newview/llvoavatar.cpp | 16 ++--- indra/newview/llvoavatar.h | 2 +- indra/newview/llvoicevivox.cpp | 6 +- indra/newview/skins/default/xui/en/menu_viewer.xml | 4 +- .../newview/skins/default/xui/en/notifications.xml | 14 ++-- .../default/xui/en/panel_preferences_general.xml | 4 +- indra/newview/skins/default/xui/en/strings.xml | 8 +-- 21 files changed, 132 insertions(+), 187 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 1f637ef3ff..8126e20b1b 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -1,9 +1,9 @@ - BusyResponseChanged + DoNotDisturbResponseChanged Comment - Does user's busy mode message differ from default? + Does user's do not disturb mode message differ from default? Persist 1 Type @@ -11,10 +11,10 @@ Value 0 - BusyModeResponse + DoNotDisturbModeResponse Comment - Auto response to instant messages while in busy mode. + Auto response to instant messages while in do not disturb mode. Persist 1 Type diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index bb0dbc7ff0..cefd5c72e8 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -376,7 +376,7 @@ LLAgent::LLAgent() : mShowAvatar(TRUE), mFrameAgent(), - mIsBusy(FALSE), + mIsDoNotDisturb(false), mControlFlags(0x00000000), mbFlagsDirty(FALSE), @@ -1397,39 +1397,27 @@ BOOL LLAgent::getAFK() const } //----------------------------------------------------------------------------- -// setBusy() +// setDoNotDisturb() //----------------------------------------------------------------------------- -void LLAgent::setBusy() +void LLAgent::setDoNotDisturb(bool pIsDotNotDisturb) { - sendAnimationRequest(ANIM_AGENT_BUSY, ANIM_REQUEST_START); - mIsBusy = TRUE; - if (gBusyMenu) - { - gBusyMenu->setLabel(LLTrans::getString("AvatarSetNotBusy")); - } - LLNotificationsUI::LLChannelManager::getInstance()->muteAllChannels(true); -} + mIsDoNotDisturb = pIsDotNotDisturb; + EAnimRequest animRequest = (pIsDotNotDisturb ? ANIM_REQUEST_START : ANIM_REQUEST_STOP); -//----------------------------------------------------------------------------- -// clearBusy() -//----------------------------------------------------------------------------- -void LLAgent::clearBusy() -{ - mIsBusy = FALSE; - sendAnimationRequest(ANIM_AGENT_BUSY, ANIM_REQUEST_STOP); - if (gBusyMenu) + sendAnimationRequest(ANIM_AGENT_DO_NOT_DISTURB, animRequest); + if (gDoNotDisturbMenu) { - gBusyMenu->setLabel(LLTrans::getString("AvatarSetBusy")); + gDoNotDisturbMenu->setLabel(LLTrans::getString((pIsDotNotDisturb ? "AvatarSetAvailable" : "AvatarSetDoNotDisturb"))); } - LLNotificationsUI::LLChannelManager::getInstance()->muteAllChannels(false); + LLNotificationsUI::LLChannelManager::getInstance()->muteAllChannels(pIsDotNotDisturb); } //----------------------------------------------------------------------------- -// getBusy() +// isDoNotDisturb() //----------------------------------------------------------------------------- -BOOL LLAgent::getBusy() const +bool LLAgent::isDoNotDisturb() const { - return mIsBusy; + return mIsDoNotDisturb; } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 99904e118c..daa15b0c1a 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -378,14 +378,13 @@ public: void sitDown(); //-------------------------------------------------------------------- - // Busy + // Do Not Disturb //-------------------------------------------------------------------- public: - void setBusy(); - void clearBusy(); - BOOL getBusy() const; + void setDoNotDisturb(bool pIsDoNotDisturb); + bool isDoNotDisturb() const; private: - BOOL mIsBusy; + bool mIsDoNotDisturb; //-------------------------------------------------------------------- // Grab diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 510abf198a..658da0205f 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1602,8 +1602,6 @@ void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder, boo { gAgentWearables.setWearableOutfit(items, wearables, !append); } - -// dec_busy_count(); } static void remove_non_link_items(LLInventoryModel::item_array_t &items) @@ -2004,7 +2002,6 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego void LLAppearanceMgr::wearOutfitByName(const std::string& name) { LL_INFOS("Avatar") << self_av_string() << "Wearing category " << name << LL_ENDL; - //inc_busy_count(); LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; @@ -2044,8 +2041,6 @@ void LLAppearanceMgr::wearOutfitByName(const std::string& name) llwarns << "Couldn't find outfit " <("language_combobox")->setCommitCallback(boost::bind(&LLFloaterPreference::onLanguageChange, this)); - // if floater is opened before login set default localized busy message + // if floater is opened before login set default localized do not disturb message if (LLStartUp::getStartupState() < STATE_STARTED) { - gSavedPerAccountSettings.setString("BusyModeResponse", LLTrans::getString("BusyModeResponseDefault")); + gSavedPerAccountSettings.setString("DoNotDisturbModeResponse", LLTrans::getString("DoNotDisturbModeResponseDefault")); } return TRUE; } -void LLFloaterPreference::onBusyResponseChanged() +void LLFloaterPreference::onDoNotDisturbResponseChanged() { - // set "BusyResponseChanged" TRUE if user edited message differs from default, FALSE otherwise - bool busy_flag = - LLTrans::getString("BusyModeResponseDefault") - != getChild("busy_response")->getValue().asString(); + // set "DoNotDisturbResponseChanged" TRUE if user edited message differs from default, FALSE otherwise + bool response_changed_flag = + LLTrans::getString("DoNotDisturbModeResponseDefault") + != getChild("do_not_disturb_response")->getValue().asString(); - gSavedPerAccountSettings.setBOOL("BusyResponseChanged", busy_flag ); + gSavedPerAccountSettings.setBOOL("DoNotDisturbResponseChanged", response_changed_flag ); } LLFloaterPreference::~LLFloaterPreference() @@ -542,12 +542,8 @@ void LLFloaterPreference::apply() LLViewerMedia::setProxyConfig(proxy_enable, proxy_address, proxy_port); } -// LLWString busy_response = utf8str_to_wstring(getChild("busy_response")->getValue().asString()); -// LLWStringUtil::replaceTabsWithSpaces(busy_response, 4); - if (mGotPersonalInfo) { -// gSavedSettings.setString("BusyModeResponse2", std::string(wstring_to_utf8str(busy_response))); bool new_im_via_email = getChild("send_im_to_email")->getValue().asBoolean(); bool new_hide_online = getChild("online_visibility")->getValue().asBoolean(); @@ -633,21 +629,21 @@ void LLFloaterPreference::cancel() void LLFloaterPreference::onOpen(const LLSD& key) { - // this variable and if that follows it are used to properly handle busy mode response message + // this variable and if that follows it are used to properly handle do not disturb mode response message static bool initialized = FALSE; - // if user is logged in and we haven't initialized busy_response yet, do it + // if user is logged in and we haven't initialized do not disturb mode response yet, do it if (!initialized && LLStartUp::getStartupState() == STATE_STARTED) { - // Special approach is used for busy response localization, because "BusyModeResponse" is + // Special approach is used for do not disturb response localization, because "DoNotDisturbModeResponse" is // in non-localizable xml, and also because it may be changed by user and in this case it shouldn't be localized. - // To keep track of whether busy response is default or changed by user additional setting BusyResponseChanged + // To keep track of whether do not disturb response is default or changed by user additional setting DoNotDisturbResponseChanged // was added into per account settings. // initialization should happen once,so setting variable to TRUE initialized = TRUE; - // this connection is needed to properly set "BusyResponseChanged" setting when user makes changes in - // busy response message. - gSavedPerAccountSettings.getControl("BusyModeResponse")->getSignal()->connect(boost::bind(&LLFloaterPreference::onBusyResponseChanged, this)); + // this connection is needed to properly set "DoNotDisturbResponseChanged" setting when user makes changes in + // do not disturb response message. + gSavedPerAccountSettings.getControl("DoNotDisturbModeResponse")->getSignal()->connect(boost::bind(&LLFloaterPreference::onDoNotDisturbResponseChanged, this)); } gAgent.sendAgentUserInfoRequest(); @@ -709,12 +705,12 @@ void LLFloaterPreference::onVertexShaderEnable() } //static -void LLFloaterPreference::initBusyResponse() +void LLFloaterPreference::initDoNotDisturbResponse() { - if (!gSavedPerAccountSettings.getBOOL("BusyResponseChanged")) + if (!gSavedPerAccountSettings.getBOOL("DoNotDisturbResponseChanged")) { - //LLTrans::getString("BusyModeResponseDefault") is used here for localization (EXT-5885) - gSavedPerAccountSettings.setString("BusyModeResponse", LLTrans::getString("BusyModeResponseDefault")); + //LLTrans::getString("DoNotDisturbModeResponseDefault") is used here for localization (EXT-5885) + gSavedPerAccountSettings.setString("DoNotDisturbModeResponse", LLTrans::getString("DoNotDisturbModeResponseDefault")); } } @@ -1431,14 +1427,11 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im getChild("send_im_to_email")->setValue(im_via_email); getChildView("log_instant_messages")->setEnabled(TRUE); // getChildView("log_chat")->setEnabled(TRUE); -// getChildView("busy_response")->setEnabled(TRUE); // getChildView("log_instant_messages_timestamp")->setEnabled(TRUE); // getChildView("log_chat_timestamp")->setEnabled(TRUE); getChildView("log_chat_IM")->setEnabled(TRUE); getChildView("log_date_timestamp")->setEnabled(TRUE); -// getChild("busy_response")->setValue(gSavedSettings.getString("BusyModeResponse2")); - getChildView("favorites_on_login_check")->setEnabled(TRUE); getChildView("log_nearby_chat")->setEnabled(TRUE); getChildView("log_instant_messages")->setEnabled(TRUE); @@ -1662,7 +1655,6 @@ BOOL LLPanelPreference::postBuild() if (hasChild("online_visibility") && hasChild("send_im_to_email")) { getChild("email_address")->setValue(getString("log_in_to_change") ); -// getChild("busy_response")->setValue(getString("log_in_to_change")); } //////////////////////PanelPrivacy /////////////////// diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index b71f7c647b..10a416beb5 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -75,8 +75,8 @@ public: // refresh all the graphics preferences menus static void refreshEnabledGraphics(); - // translate user's busy response message according to current locale if message is default, otherwise do nothing - static void initBusyResponse(); + // translate user's do not disturb response message according to current locale if message is default, otherwise do nothing + static void initDoNotDisturbResponse(); void processProperties( void* pData, EAvatarProcessorType type ); void processProfileProperties(const LLAvatarData* pAvatarData ); @@ -93,9 +93,9 @@ protected: void onLanguageChange(); void onNameTagOpacityChange(const LLSD& newvalue); - // set value of "BusyResponseChanged" in account settings depending on whether busy response + // set value of "DoNotDisturbResponseChanged" in account settings depending on whether do not disturb response // string differs from default after user changes. - void onBusyResponseChanged(); + void onDoNotDisturbResponseChanged(); // if the custom settings box is clicked void onChangeCustom(); void updateMeterText(LLUICtrl* ctrl); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index d5f1e81933..9b14a77c08 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -113,8 +113,8 @@ static void on_avatar_name_cache_toast(const LLUUID& agent_id, } void toast_callback(const LLSD& msg){ - // do not show toast in busy mode or it goes from agent - if (gAgent.getBusy() || gAgent.getID() == msg["from_id"]) + // do not show toast in do not disturb mode or it goes from agent + if (gAgent.isDoNotDisturb() || gAgent.getID() == msg["from_id"]) { return; } @@ -3292,13 +3292,13 @@ public: time_t timestamp = (time_t) message_params["timestamp"].asInteger(); - BOOL is_busy = gAgent.getBusy(); + BOOL is_do_not_disturb = gAgent.isDoNotDisturb(); BOOL is_muted = LLMuteList::getInstance()->isMuted( from_id, name, LLMute::flagTextChat); - if (is_busy || is_muted) + if (is_do_not_disturb || is_muted) { return; } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 5d8d82b226..8b04af71c7 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -92,21 +92,6 @@ struct LLMoveInv using namespace LLOldEvents; -// Helpers -// bug in busy count inc/dec right now, logic is complex... do we really need it? -void inc_busy_count() -{ -// gViewerWindow->getWindow()->incBusyCount(); -// check balance of these calls if this code is changed to ever actually -// *do* something! -} -void dec_busy_count() -{ -// gViewerWindow->getWindow()->decBusyCount(); -// check balance of these calls if this code is changed to ever actually -// *do* something! -} - // Function declarations void remove_inventory_category_from_avatar(LLInventoryCategory* category); void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_id); @@ -167,7 +152,6 @@ public: { if (clear_observer) { - dec_busy_count(); gInventory.removeObserver(this); delete this; } @@ -2668,7 +2652,6 @@ void LLRightClickInventoryFetchDescendentsObserver::execute(bool clear_observer) llwarns << "LLRightClickInventoryFetchDescendentsObserver::done with empty mCompleteFolders" << llendl; if (clear_observer) { - dec_busy_count(); gInventory.removeObserver(this); delete this; } @@ -2682,7 +2665,6 @@ void LLRightClickInventoryFetchDescendentsObserver::execute(bool clear_observer) // could notify observers and throw us into an infinite loop. if (clear_observer) { - dec_busy_count(); gInventory.removeObserver(this); delete this; } @@ -2744,7 +2726,6 @@ void LLRightClickInventoryFetchDescendentsObserver::execute(bool clear_observer) { // it's all on its way - add an observer, and the inventory // will call done for us when everything is here. - inc_busy_count(); gInventory.addObserver(outfit); } */ @@ -2763,7 +2744,6 @@ void LLRightClickInventoryFetchDescendentsObserver::execute(bool clear_observer) { // it's all on its way - add an observer, and the inventory // will call done for us when everything is here. - inc_busy_count(); gInventory.addObserver(categories); } } @@ -3475,7 +3455,6 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items else { // it's all on its way - add an observer, and the inventory will call done for us when everything is here. - inc_busy_count(); gInventory.addObserver(fetch); } } diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 7834f6d320..1494d9d6ee 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -560,7 +560,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, || ( chat_msg.mSourceType == CHAT_SOURCE_AGENT && gSavedSettings.getBOOL("UseChatBubbles") ) || mChannel.isDead() - || !mChannel.get()->getShowToasts() ) // to prevent toasts in Busy mode + || !mChannel.get()->getShowToasts() ) // to prevent toasts in Do Not Disturb mode return;//no need in toast if chat is visible or if bubble chat is enabled // arrange a channel on a screen diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 7990b81d92..ac6110f84f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -179,7 +179,7 @@ LLContextMenu* gDetachScreenPieMenu = NULL; LLContextMenu* gDetachBodyPartPieMenus[8]; LLMenuItemCallGL* gAFKMenu = NULL; -LLMenuItemCallGL* gBusyMenu = NULL; +LLMenuItemCallGL* gDoNotDisturbMenu = NULL; // // Local prototypes @@ -471,7 +471,7 @@ void init_menus() gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", upload_cost); gAFKMenu = gMenuBarView->getChild("Set Away", TRUE); - gBusyMenu = gMenuBarView->getChild("Set Busy", TRUE); + gDoNotDisturbMenu = gMenuBarView->getChild("set_do_not_disturb", TRUE); gAttachSubMenu = gMenuBarView->findChildMenuByName("Attach Object", TRUE); gDetachSubMenu = gMenuBarView->findChildMenuByName("Detach Object", TRUE); @@ -5564,18 +5564,18 @@ class LLWorldSetAway : public view_listener_t } }; -class LLWorldSetBusy : public view_listener_t +class LLWorldSetDoNotDisturb : public view_listener_t { bool handleEvent(const LLSD& userdata) { - if (gAgent.getBusy()) + if (gAgent.isDoNotDisturb()) { - gAgent.clearBusy(); + gAgent.setDoNotDisturb(false); } else { - gAgent.setBusy(); - LLNotificationsUtil::add("BusyModeSet"); + gAgent.setDoNotDisturb(true); + LLNotificationsUtil::add("DoNotDisturbModeSet"); } return true; } @@ -5737,7 +5737,7 @@ bool complete_give_money(const LLSD& notification, const LLSD& response, LLObjec S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { - gAgent.clearBusy(); + gAgent.setDoNotDisturb(false); } LLViewerObject* objectp = selection->getPrimaryObject(); @@ -5770,12 +5770,12 @@ bool complete_give_money(const LLSD& notification, const LLSD& response, LLObjec void handle_give_money_dialog() { - LLNotification::Params params("BusyModePay"); + LLNotification::Params params("DoNotDisturbModePay"); params.functor.function(boost::bind(complete_give_money, _1, _2, LLSelectMgr::getInstance()->getSelection())); - if (gAgent.getBusy()) + if (gAgent.isDoNotDisturb()) { - // warn users of being in busy mode during a transaction + // warn users of being in do not disturb mode during a transaction LLNotifications::instance().add(params); } else @@ -8288,7 +8288,7 @@ void initialize_menus() view_listener_t::addMenu(new LLWorldSetHomeLocation(), "World.SetHomeLocation"); view_listener_t::addMenu(new LLWorldTeleportHome(), "World.TeleportHome"); view_listener_t::addMenu(new LLWorldSetAway(), "World.SetAway"); - view_listener_t::addMenu(new LLWorldSetBusy(), "World.SetBusy"); + view_listener_t::addMenu(new LLWorldSetDoNotDisturb(), "World.SetDoNotDisturb"); view_listener_t::addMenu(new LLWorldEnableCreateLandmark(), "World.EnableCreateLandmark"); view_listener_t::addMenu(new LLWorldEnableSetHomeLocation(), "World.EnableSetHomeLocation"); diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 3515aa4302..e8665a6ef6 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -188,7 +188,7 @@ extern LLContextMenu* gAttachBodyPartPieMenus[8]; extern LLContextMenu* gDetachBodyPartPieMenus[8]; extern LLMenuItemCallGL* gAFKMenu; -extern LLMenuItemCallGL* gBusyMenu; +extern LLMenuItemCallGL* gDoNotDisturbMenu; extern LLMenuItemCallGL* gMutePieMenu; extern LLMenuItemCallGL* gMuteObjectPieMenu; extern LLMenuItemCallGL* gBuyPassPieMenu; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index c5d25ebd1b..d500fd78ff 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -179,7 +179,7 @@ const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] = FALSE // TeleportYourAgent }; -static void busy_message (LLMessageSystem* msg, const LLUUID& from_id, const LLUUID& session_id = LLUUID::null); +static void send_do_not_disturb_message (LLMessageSystem* msg, const LLUUID& from_id, const LLUUID& session_id = LLUUID::null); bool friendship_offer_callback(const LLSD& notification, const LLSD& response) { @@ -258,11 +258,6 @@ bool friendship_offer_callback(const LLSD& notification, const LLSD& response) static LLNotificationFunctorRegistration friendship_offer_callback_reg("OfferFriendship", friendship_offer_callback); static LLNotificationFunctorRegistration friendship_offer_callback_reg_nm("OfferFriendshipNoMessage", friendship_offer_callback); -//const char BUSY_AUTO_RESPONSE[] = "The Resident you messaged is in 'busy mode' which means they have " -// "requested not to be disturbed. Your message will still be shown in their IM " -// "panel for later viewing."; - -// // Functions // @@ -1520,8 +1515,6 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& // TODO: when task inventory offers can also be handled the new way, migrate the code that sets these strings here: from_string = chatHistory_string = mFromName; - bool busy = gAgent.getBusy(); - LLNotificationFormPtr modified_form(notification_ptr ? new LLNotificationForm(*notification_ptr->getForm()) : new LLNotificationForm()); switch(button) @@ -1623,9 +1616,9 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& } - if (busy && (!mFromGroup && !mFromObject)) + if (gAgent.isDoNotDisturb() && (!mFromGroup && !mFromObject)) { - busy_message(gMessageSystem, mFromID); + send_do_not_disturb_message(gMessageSystem, mFromID); } if (modified_form != NULL) @@ -1750,7 +1743,7 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const from_string = chatHistory_string = mFromName; } - bool busy = gAgent.getBusy(); + bool is_do_not_disturb = gAgent.isDoNotDisturb(); switch(button) { @@ -1823,9 +1816,9 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const LLNotificationsUtil::add("SystemMessageTip", args); } - if (busy && (!mFromGroup && !mFromObject)) + if (is_do_not_disturb && (!mFromGroup && !mFromObject)) { - busy_message(msg,mFromID); + send_do_not_disturb_message(msg,mFromID); } break; } @@ -2207,7 +2200,7 @@ static std::string clean_name_from_im(const std::string& name, EInstantMessage t case IM_SESSION_SEND: case IM_SESSION_LEAVE: //IM_FROM_TASK - case IM_BUSY_AUTO_RESPONSE: + case IM_DO_NOT_DISTURB_AUTO_RESPONSE: case IM_CONSOLE_AND_CHAT_HISTORY: case IM_LURE_USER: case IM_LURE_ACCEPTED: @@ -2356,7 +2349,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // IDEVO convert new-style "Resident" names for display name = clean_name_from_im(name, dialog); - BOOL is_busy = gAgent.getBusy(); + BOOL is_do_not_disturb = gAgent.isDoNotDisturb(); BOOL is_muted = LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat) // object IMs contain sender object id in session_id (STORM-1209) || dialog == IM_FROM_TASK && LLMuteList::getInstance()->isMuted(session_id); @@ -2402,15 +2395,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // do nothing -- don't distract newbies in // Prelude with global IMs } - else if (offline == IM_ONLINE && is_busy && name != SYSTEM_FROM) + else if (offline == IM_ONLINE && is_do_not_disturb && name != SYSTEM_FROM) { - // return a standard "busy" message, but only do it to online IM + // return a standard "do not disturb" message, but only do it to online IM // (i.e. not other auto responses and not store-and-forward IM) if (!gIMMgr->hasSession(session_id)) { // if there is not a panel for this conversation (i.e. it is a new IM conversation // initiated by the other party) then... - busy_message(msg, from_id, session_id); + send_do_not_disturb_message(msg, from_id, session_id); } // now store incoming IM in chat history @@ -2645,9 +2638,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) break; case IM_GROUP_INVITATION: { - if (is_busy || is_muted) + if (is_do_not_disturb || is_muted) { - busy_message(msg, from_id); + send_do_not_disturb_message(msg, from_id); } else { @@ -2730,7 +2723,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) info->mFromName = name; info->mDesc = message; info->mHost = msg->getSender(); - //if (((is_busy && !is_owned_by_me) || is_muted)) + //if (((is_do_not_disturb && !is_owned_by_me) || is_muted)) if (is_muted) { // Prefetch the offered item so that it can be discarded by the appropriate observer. (EXT-4331) @@ -2741,9 +2734,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // Same as closing window info->forceResponse(IOR_DECLINE); } - else if (is_busy && dialog != IM_TASK_INVENTORY_OFFERED) // busy mode must not affect interaction with objects (STORM-565) + else if (is_do_not_disturb && dialog != IM_TASK_INVENTORY_OFFERED) // busy mode must not affect interaction with objects (STORM-565) { - // Until throttling is implemented, busy mode should reject inventory instead of silently + // Until throttling is implemented, do not disturb mode should reject inventory instead of silently // accepting it. SEE SL-39554 info->forceResponse(IOR_DECLINE); } @@ -2788,7 +2781,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_SESSION_SEND: { - if (is_busy) + if (is_do_not_disturb) { return; } @@ -2829,7 +2822,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_FROM_TASK: { - if (is_busy && !is_owned_by_me) + if (is_do_not_disturb && !is_owned_by_me) { return; } @@ -2926,7 +2919,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } break; case IM_FROM_TASK_AS_ALERT: - if (is_busy && !is_owned_by_me) + if (is_do_not_disturb && !is_owned_by_me) { return; } @@ -2937,10 +2930,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLNotificationsUtil::add("ObjectMessage", args); } break; - case IM_BUSY_AUTO_RESPONSE: + case IM_DO_NOT_DISTURB_AUTO_RESPONSE: if (is_muted) { - LL_DEBUGS("Messaging") << "Ignoring busy response from " << from_id << LL_ENDL; + LL_DEBUGS("Messaging") << "Ignoring do-not-disturb response from " << from_id << LL_ENDL; return; } else @@ -2957,9 +2950,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { return; } - else if (is_busy) + else if (is_do_not_disturb) { - busy_message(msg, from_id); + send_do_not_disturb_message(msg, from_id); } else { @@ -3180,9 +3173,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) payload["online"] = (offline == IM_ONLINE); payload["sender"] = msg->getSender().getIPandPort(); - if (is_busy) + if (is_do_not_disturb) { - busy_message(msg, from_id); + send_do_not_disturb_message(msg, from_id); LLNotifications::instance().forceResponse(LLNotification::Params("OfferFriendship").payload(payload), 1); } else if (is_muted) @@ -3246,13 +3239,13 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } } -static void busy_message (LLMessageSystem* msg, const LLUUID& from_id, const LLUUID& session_id) +static void send_do_not_disturb_message (LLMessageSystem* msg, const LLUUID& from_id, const LLUUID& session_id) { - if (gAgent.getBusy()) + if (gAgent.isDoNotDisturb()) { std::string my_name; LLAgentUI::buildFullname(my_name); - std::string response = gSavedPerAccountSettings.getString("BusyModeResponse"); + std::string response = gSavedPerAccountSettings.getString("DoNotDisturbModeResponse"); pack_instant_message( msg, gAgent.getID(), @@ -3262,7 +3255,7 @@ static void busy_message (LLMessageSystem* msg, const LLUUID& from_id, const LLU my_name, response, IM_ONLINE, - IM_BUSY_AUTO_RESPONSE, + IM_DO_NOT_DISTURB_AUTO_RESPONSE, session_id); gAgent.sendReliableMessage(); } @@ -3298,7 +3291,7 @@ bool callingcard_offer_callback(const LLSD& notification, const LLSD& response) msg->nextBlockFast(_PREHASH_TransactionBlock); msg->addUUIDFast(_PREHASH_TransactionID, notification["payload"]["transaction_id"].asUUID()); msg->sendReliable(LLHost(notification["payload"]["sender"].asString())); - busy_message(msg, notification["payload"]["source_id"].asUUID()); + send_do_not_disturb_message(msg, notification["payload"]["source_id"].asUUID()); break; default: // close button probably, possibly timed out @@ -3340,7 +3333,7 @@ void process_offer_callingcard(LLMessageSystem* msg, void**) if(!source_name.empty()) { - if (gAgent.getBusy() + if (gAgent.isDoNotDisturb() || LLMuteList::getInstance()->isMuted(source_id, source_name, LLMute::flagTextChat)) { // automatically decline offer @@ -3469,7 +3462,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) chat.mFromName = from_name; } - BOOL is_busy = gAgent.getBusy(); + BOOL is_do_not_disturb = gAgent.isDoNotDisturb(); BOOL is_muted = FALSE; BOOL is_linden = FALSE; @@ -3503,7 +3496,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) // record last audible utterance if (is_audible - && (is_linden || (!is_muted && !is_busy))) + && (is_linden || (!is_muted && !is_do_not_disturb))) { if (chat.mChatType != CHAT_TYPE_START && chat.mChatType != CHAT_TYPE_STOP) @@ -3598,7 +3591,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) LLLocalSpeakerMgr::getInstance()->setSpeakerTyping(from_id, FALSE); ((LLVOAvatar*)chatter)->stopTyping(); - if (!is_muted && !is_busy) + if (!is_muted && !is_do_not_disturb) { visible_in_chat_bubble = gSavedSettings.getBOOL("UseChatBubbles"); std::string formated_msg = ""; @@ -4136,14 +4129,14 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) gAgent.setFlying(gAgent.canFly()); } - // force simulator to recognize busy state - if (gAgent.getBusy()) + // force simulator to recognize do not disturb state + if (gAgent.isDoNotDisturb()) { - gAgent.setBusy(); + gAgent.setDoNotDisturb(true); } else { - gAgent.clearBusy(); + gAgent.setDoNotDisturb(false); } if (isAgentAvatarValid()) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 3b2292c04d..ee838b19b7 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1824,8 +1824,8 @@ void LLViewerWindow::initBase() gDebugView->init(); gToolTipView = getRootView()->getChild("tooltip view"); - // Initialize busy response message when logged in - LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLFloaterPreference::initBusyResponse)); + // Initialize do not disturb response message when logged in + LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLFloaterPreference::initDoNotDisturbResponse)); // Add the progress bar view (startup view), which overrides everything mProgressView = getRootView()->findChild("progress_view"); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7b08744598..4cdba0fba9 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -680,7 +680,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mNameString(), mTitle(), mNameAway(false), - mNameBusy(false), + mNameDoNotDisturb(false), mNameMute(false), mNameAppearance(false), mNameFriend(false), @@ -1366,7 +1366,7 @@ void LLVOAvatar::initInstance(void) if (LLCharacter::sInstances.size() == 1) { LLKeyframeMotion::setVFS(gStaticVFS); - registerMotion( ANIM_AGENT_BUSY, LLNullMotion::create ); + registerMotion( ANIM_AGENT_DO_NOT_DISTURB, LLNullMotion::create ); registerMotion( ANIM_AGENT_CROUCH, LLKeyframeStandMotion::create ); registerMotion( ANIM_AGENT_CROUCHWALK, LLKeyframeWalkMotion::create ); registerMotion( ANIM_AGENT_EXPRESS_AFRAID, LLEmote::create ); @@ -3100,7 +3100,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) if (!firstname || !lastname) return; bool is_away = mSignaledAnimations.find(ANIM_AGENT_AWAY) != mSignaledAnimations.end(); - bool is_busy = mSignaledAnimations.find(ANIM_AGENT_BUSY) != mSignaledAnimations.end(); + bool is_do_not_disturb = mSignaledAnimations.find(ANIM_AGENT_DO_NOT_DISTURB) != mSignaledAnimations.end(); bool is_appearance = mSignaledAnimations.find(ANIM_AGENT_CUSTOMIZE) != mSignaledAnimations.end(); bool is_muted; if (isSelf()) @@ -3132,7 +3132,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) || (!title && !mTitle.empty()) || (title && mTitle != title->getString()) || is_away != mNameAway - || is_busy != mNameBusy + || is_do_not_disturb != mNameDoNotDisturb || is_muted != mNameMute || is_appearance != mNameAppearance || is_friend != mNameFriend @@ -3142,7 +3142,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) clearNameTag(); - if (is_away || is_muted || is_busy || is_appearance) + if (is_away || is_muted || is_do_not_disturb || is_appearance) { std::string line; if (is_away) @@ -3150,9 +3150,9 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) line += LLTrans::getString("AvatarAway"); line += ", "; } - if (is_busy) + if (is_do_not_disturb) { - line += LLTrans::getString("AvatarBusy"); + line += LLTrans::getString("AvatarDoNotDisturb"); line += ", "; } if (is_muted) @@ -3222,7 +3222,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) } mNameAway = is_away; - mNameBusy = is_busy; + mNameDoNotDisturb = is_do_not_disturb; mNameMute = is_muted; mNameAppearance = is_appearance; mNameFriend = is_friend; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index e45069dbfe..c59a3a150c 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -942,7 +942,7 @@ private: std::string mNameString; // UTF-8 title + name + status std::string mTitle; bool mNameAway; - bool mNameBusy; + bool mNameDoNotDisturb; bool mNameMute; bool mNameAppearance; bool mNameFriend; diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index f1bf4a6d75..71006d38d2 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -3939,7 +3939,7 @@ void LLVivoxVoiceClient::messageEvent( sessionState *session = findSession(sessionHandle); if(session) { - bool is_busy = gAgent.getBusy(); + bool is_do_not_disturb = gAgent.isDoNotDisturb(); bool is_muted = LLMuteList::getInstance()->isMuted(session->mCallerID, session->mName, LLMute::flagTextChat); bool is_linden = LLMuteList::getInstance()->isLinden(session->mName); bool quiet_chat = false; @@ -3953,10 +3953,10 @@ void LLVivoxVoiceClient::messageEvent( chat.mFromName = session->mName; chat.mSourceType = CHAT_SOURCE_AGENT; - if(is_busy && !is_linden) + if(is_do_not_disturb && !is_linden) { quiet_chat = true; - // TODO: Question: Return busy mode response here? Or maybe when session is started instead? + // TODO: Question: Return do not disturb mode response here? Or maybe when session is started instead? } LL_DEBUGS("Voice") << "adding message, name " << session->mName << " session " << session->mIMSessionID << ", target " << session->mCallerID << LL_ENDL; diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index c805b6db42..f6a307d9d0 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -138,9 +138,9 @@ + name="set_do_not_disturb"> + function="World.SetDoNotDisturb"/> diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 4410f41e29..1c1642abac 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3691,12 +3691,12 @@ Cannot offer friendship at this time. Please try again in a moment. Busy mode is set. Chat and instant messages will be hidden. Instant messages will get your Busy mode response. All teleportation offers will be declined. All inventory offers will go to your Trash. @@ -5167,8 +5167,8 @@ Do you want to replace it with the selected object? You are in Busy Mode, which means you will not receive any items offered in exchange for this payment. @@ -5177,15 +5177,15 @@ Would you like to leave Busy Mode before completing this transaction?
+ text="I am about to pay a person or object while I am in Do Not Disturb mode"/>