summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorWilliam Todd Stinson <stinson@lindenlab.com>2012-11-08 12:35:15 -0800
committerWilliam Todd Stinson <stinson@lindenlab.com>2012-11-08 12:35:15 -0800
commitc4eaaa3d6a08330863119d550d365315ba7526bb (patch)
treef0bae909425bb8ddd96d6fb731e40dd2237d6a18 /indra/newview/llviewermessage.cpp
parentfa85e16d63b09326b9facb4850d50cd163f87bc7 (diff)
CHUI-484: Updating the code to rather than refer to it as Busy Mode, it now refers to it as Do Not Disturb mode.
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rwxr-xr-xindra/newview/llviewermessage.cpp83
1 files changed, 38 insertions, 45 deletions
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())