diff options
author | maksymsproductengine <maksymsproductengine@lindenlab.com> | 2013-03-13 23:01:10 +0200 |
---|---|---|
committer | maksymsproductengine <maksymsproductengine@lindenlab.com> | 2013-03-13 23:01:10 +0200 |
commit | 8904f32ba48b49ec216a3ca3b1508d5f3f633e78 (patch) | |
tree | 5a8944368ac94266d13624d4f77d9ff5e502d6f9 | |
parent | f92021cc090fbc4bffd68cf0536f7a801b769c79 (diff) |
CHUI-796 FIXED User doesn't get all messages in 'do not disturb' mode
-rwxr-xr-x | indra/newview/llviewermessage.cpp | 113 |
1 files changed, 71 insertions, 42 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 2340436a01..a13c793899 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2382,7 +2382,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLPostponedNotification::add<LLPostponedIMSystemTipNotification>(params, from_id, false); break; - case IM_NOTHING_SPECIAL: + case IM_NOTHING_SPECIAL: // p2p IM // Don't show dialog, just do IM if (!gAgent.isGodlike() && gAgent.getRegion()->isPrelude() @@ -2783,47 +2783,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } break; - case IM_SESSION_SEND: - { - if (is_do_not_disturb) - { - return; - } - - // Only show messages if we have a session open (which - // should happen after you get an "invitation" - if ( !gIMMgr->hasSession(session_id) ) - { - return; - } - - // standard message, not from system - std::string saved; - if(offline == IM_OFFLINE) - { - saved = llformat("(Saved %s) ", formatted_time(timestamp).c_str()); - } - buffer = saved + message; - BOOL is_this_agent = FALSE; - if(from_id == gAgentID) - { - is_this_agent = TRUE; - } - gIMMgr->addMessage( - session_id, - from_id, - name, - buffer, - IM_OFFLINE == offline, - ll_safe_string((char*)binary_bucket), - IM_SESSION_INVITE, - parent_estate_id, - region_id, - position, - true); - } - break; - case IM_FROM_TASK: { if (is_do_not_disturb && !is_owned_by_me) @@ -2922,6 +2881,76 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLPostponedNotification::add<LLPostponedServerObjectNotification>(params, from_id, from_group); } break; + + case IM_SESSION_SEND: // ad-hoc or group IMs + + // Only show messages if we have a session open (which + // should happen after you get an "invitation" + if ( !gIMMgr->hasSession(session_id) ) + { + return; + } + + else if (offline == IM_ONLINE && is_do_not_disturb) + { + + // 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... + send_do_not_disturb_message(msg, from_id, session_id); + } + + // now store incoming IM in chat history + + buffer = message; + + LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; + + // add to IM panel, but do not bother the user + gIMMgr->addMessage( + session_id, + from_id, + name, + buffer, + IM_OFFLINE == offline, + ll_safe_string((char*)binary_bucket), + IM_SESSION_INVITE, + parent_estate_id, + region_id, + position, + true); + } + else + { + // standard message, not from system + std::string saved; + if(offline == IM_OFFLINE) + { + saved = llformat("(Saved %s) ", formatted_time(timestamp).c_str()); + } + + buffer = saved + message; + + LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; + + gIMMgr->addMessage( + session_id, + from_id, + name, + buffer, + IM_OFFLINE == offline, + ll_safe_string((char*)binary_bucket), + IM_SESSION_INVITE, + parent_estate_id, + region_id, + position, + true); + } + break; + case IM_FROM_TASK_AS_ALERT: if (is_do_not_disturb && !is_owned_by_me) { |