summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2013-03-13 08:46:59 +0000
committerDon Kjer <don@lindenlab.com>2013-03-13 08:46:59 +0000
commit662d67e3b5f1cbf5e894f0e4af37a31faacd67e3 (patch)
tree93af533d9c1e9c027c5abc56a5de4ee207591b23 /indra/newview/llagent.cpp
parentf945415210f0e18c2c6d941fda6b7d45cb0f06f1 (diff)
parent0ebcdce82bffae18459ed541f05906f625ef47e2 (diff)
Merging LLCURL::Responder changes with CHUI changes. Fixed gcc 4.6 compile failures
Diffstat (limited to 'indra/newview/llagent.cpp')
-rwxr-xr-xindra/newview/llagent.cpp114
1 files changed, 32 insertions, 82 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 4b0f451036..049aea844c 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -42,6 +42,7 @@
#include "llchannelmanager.h"
#include "llchicletbar.h"
#include "llconsole.h"
+#include "lldonotdisturbnotificationstorage.h"
#include "llenvmanager.h"
#include "llfirstuse.h"
#include "llfloatercamera.h"
@@ -55,7 +56,7 @@
#include "llmorphview.h"
#include "llmoveview.h"
#include "llnavigationbar.h" // to show/hide navigation bar when changing mouse look state
-#include "llnearbychatbar.h"
+#include "llfloaterimnearbychat.h"
#include "llnotificationsutil.h"
#include "llpaneltopinfobar.h"
#include "llparcel.h"
@@ -376,7 +377,7 @@ LLAgent::LLAgent() :
mShowAvatar(TRUE),
mFrameAgent(),
- mIsBusy(FALSE),
+ mIsDoNotDisturb(false),
mControlFlags(0x00000000),
mbFlagsDirty(FALSE),
@@ -1392,12 +1393,7 @@ void LLAgent::setAFK()
{
sendAnimationRequest(ANIM_AGENT_AWAY, ANIM_REQUEST_START);
setControlFlags(AGENT_CONTROL_AWAY | AGENT_CONTROL_STOP);
- LL_INFOS("AFK") << "Setting Away" << LL_ENDL;
gAwayTimer.start();
- if (gAFKMenu)
- {
- gAFKMenu->setLabel(LLTrans::getString("AvatarSetNotAway"));
- }
}
}
@@ -1416,11 +1412,6 @@ void LLAgent::clearAFK()
{
sendAnimationRequest(ANIM_AGENT_AWAY, ANIM_REQUEST_STOP);
clearControlFlags(AGENT_CONTROL_AWAY);
- LL_INFOS("AFK") << "Clearing Away" << LL_ENDL;
- if (gAFKMenu)
- {
- gAFKMenu->setLabel(LLTrans::getString("AvatarSetAway"));
- }
}
}
@@ -1433,39 +1424,26 @@ BOOL LLAgent::getAFK() const
}
//-----------------------------------------------------------------------------
-// setBusy()
-//-----------------------------------------------------------------------------
-void LLAgent::setBusy()
-{
- sendAnimationRequest(ANIM_AGENT_BUSY, ANIM_REQUEST_START);
- mIsBusy = TRUE;
- if (gBusyMenu)
- {
- gBusyMenu->setLabel(LLTrans::getString("AvatarSetNotBusy"));
- }
- LLNotificationsUI::LLChannelManager::getInstance()->muteAllChannels(true);
-}
-
-//-----------------------------------------------------------------------------
-// clearBusy()
+// setDoNotDisturb()
//-----------------------------------------------------------------------------
-void LLAgent::clearBusy()
+void LLAgent::setDoNotDisturb(bool pIsDoNotDisturb)
{
- mIsBusy = FALSE;
- sendAnimationRequest(ANIM_AGENT_BUSY, ANIM_REQUEST_STOP);
- if (gBusyMenu)
+ bool isDoNotDisturbSwitchedOff = (mIsDoNotDisturb && !pIsDoNotDisturb);
+ mIsDoNotDisturb = pIsDoNotDisturb;
+ sendAnimationRequest(ANIM_AGENT_DO_NOT_DISTURB, (pIsDoNotDisturb ? ANIM_REQUEST_START : ANIM_REQUEST_STOP));
+ LLNotificationsUI::LLChannelManager::getInstance()->muteAllChannels(pIsDoNotDisturb);
+ if (isDoNotDisturbSwitchedOff)
{
- gBusyMenu->setLabel(LLTrans::getString("AvatarSetBusy"));
+ LLDoNotDisturbNotificationStorage::getInstance()->updateNotifications();
}
- LLNotificationsUI::LLChannelManager::getInstance()->muteAllChannels(false);
}
//-----------------------------------------------------------------------------
-// getBusy()
+// isDoNotDisturb()
//-----------------------------------------------------------------------------
-BOOL LLAgent::getBusy() const
+bool LLAgent::isDoNotDisturb() const
{
- return mIsBusy;
+ return mIsDoNotDisturb;
}
@@ -1945,7 +1923,8 @@ void LLAgent::startTyping()
{
sendAnimationRequest(ANIM_AGENT_TYPE, ANIM_REQUEST_START);
}
- LLNearbyChatBar::getInstance()->sendChatFromViewer("", CHAT_TYPE_START, FALSE);
+ (LLFloaterReg::getTypedInstance<LLFloaterIMNearbyChat>("nearby_chat"))->
+ sendChatFromViewer("", CHAT_TYPE_START, FALSE);
}
//-----------------------------------------------------------------------------
@@ -1957,7 +1936,8 @@ void LLAgent::stopTyping()
{
clearRenderState(AGENT_STATE_TYPING);
sendAnimationRequest(ANIM_AGENT_TYPE, ANIM_REQUEST_STOP);
- LLNearbyChatBar::getInstance()->sendChatFromViewer("", CHAT_TYPE_STOP, FALSE);
+ (LLFloaterReg::getTypedInstance<LLFloaterIMNearbyChat>("nearby_chat"))->
+ sendChatFromViewer("", CHAT_TYPE_STOP, FALSE);
}
}
@@ -2605,51 +2585,21 @@ void LLMaturityPreferencesResponder::httpFailure()
U8 LLMaturityPreferencesResponder::parseMaturityFromServerResponse(const LLSD &pContent) const
{
- // stinson 05/24/2012 Pathfinding regions have re-defined the response behavior. In the old server code,
- // if you attempted to change the preferred maturity to the same value, the response content would be an
- // undefined LLSD block. In the new server code with pathfinding, the response content should always be
- // defined. Thus, the check for isUndefined() can be replaced with an assert after pathfinding is merged
- // into server trunk and fully deployed.
U8 maturity = SIM_ACCESS_MIN;
- if (pContent.isUndefined() || !pContent.isMap())
- {
- maturity = mPreferredMaturity;
- }
- else
- {
- llassert(!pContent.isUndefined());
- llassert(pContent.isMap());
-
- if (!pContent.isUndefined() && pContent.isMap())
- {
- // stinson 05/24/2012 Pathfinding regions have re-defined the response syntax. The if statement catches
- // the new syntax, and the else statement catches the old syntax. After pathfinding is merged into
- // server trunk and fully deployed, we can remove the else statement.
- if (pContent.has("access_prefs"))
- {
- llassert(pContent.has("access_prefs"));
- llassert(pContent.get("access_prefs").isMap());
- llassert(pContent.get("access_prefs").has("max"));
- llassert(pContent.get("access_prefs").get("max").isString());
- if (pContent.get("access_prefs").isMap() && pContent.get("access_prefs").has("max") &&
- pContent.get("access_prefs").get("max").isString())
- {
- LLSD::String actualPreference = pContent.get("access_prefs").get("max").asString();
- LLStringUtil::trim(actualPreference);
- maturity = LLViewerRegion::shortStringToAccess(actualPreference);
- }
- }
- else if (pContent.has("max"))
- {
- llassert(pContent.get("max").isString());
- if (pContent.get("max").isString())
- {
- LLSD::String actualPreference = pContent.get("max").asString();
- LLStringUtil::trim(actualPreference);
- maturity = LLViewerRegion::shortStringToAccess(actualPreference);
- }
- }
- }
+
+ llassert(pContent.isDefined());
+ llassert(pContent.isMap());
+ llassert(pContent.has("access_prefs"));
+ llassert(pContent.get("access_prefs").isMap());
+ llassert(pContent.get("access_prefs").has("max"));
+ llassert(pContent.get("access_prefs").get("max").isString());
+ if (pContent.isDefined() && pContent.isMap() && pContent.has("access_prefs")
+ && pContent.get("access_prefs").isMap() && pContent.get("access_prefs").has("max")
+ && pContent.get("access_prefs").get("max").isString())
+ {
+ LLSD::String actualPreference = pContent.get("access_prefs").get("max").asString();
+ LLStringUtil::trim(actualPreference);
+ maturity = LLViewerRegion::shortStringToAccess(actualPreference);
}
return maturity;