summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp91
1 files changed, 51 insertions, 40 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index ff8b8b0403..feef726630 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -269,8 +269,11 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg)
{
if(!gAgent.isDoNotDisturb())
{
- // Open conversations floater
- LLFloaterReg::showInstance("im_container");
+ if(!LLAppViewer::instance()->quitRequested() && !LLFloater::isVisible(im_box))
+ {
+ // Open conversations floater
+ LLFloaterReg::showInstance("im_container");
+ }
im_box->collapseMessagesPane(false);
if (session_floater)
{
@@ -2677,49 +2680,57 @@ void LLIMMgr::addMessage(
LLIMModel::getInstance()->newSession(new_session_id, fixed_session_name, dialog, other_participant_id, false, is_offline_msg);
LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(new_session_id);
- skip_message &= !session->isGroupSessionType(); // Do not skip group chats...
- if(skip_message)
- {
- gIMMgr->leaveSession(new_session_id);
- }
- // When we get a new IM, and if you are a god, display a bit
- // of information about the source. This is to help liaisons
- // when answering questions.
- if(gAgent.isGodlike())
+ if (session)
{
- // *TODO:translate (low priority, god ability)
- std::ostringstream bonus_info;
- bonus_info << LLTrans::getString("***")+ " "+ LLTrans::getString("IMParentEstate") + ":" + " "
- << parent_estate_id
- << ((parent_estate_id == 1) ? "," + LLTrans::getString("IMMainland") : "")
- << ((parent_estate_id == 5) ? "," + LLTrans::getString ("IMTeen") : "");
-
- // once we have web-services (or something) which returns
- // information about a region id, we can print this out
- // and even have it link to map-teleport or something.
- //<< "*** region_id: " << region_id << std::endl
- //<< "*** position: " << position << std::endl;
+ skip_message &= !session->isGroupSessionType(); // Do not skip group chats...
+ if (skip_message)
+ {
+ gIMMgr->leaveSession(new_session_id);
+ }
+ // When we get a new IM, and if you are a god, display a bit
+ // of information about the source. This is to help liaisons
+ // when answering questions.
+ if (gAgent.isGodlike())
+ {
+ // *TODO:translate (low priority, god ability)
+ std::ostringstream bonus_info;
+ bonus_info << LLTrans::getString("***") + " " + LLTrans::getString("IMParentEstate") + ":" + " "
+ << parent_estate_id
+ << ((parent_estate_id == 1) ? "," + LLTrans::getString("IMMainland") : "")
+ << ((parent_estate_id == 5) ? "," + LLTrans::getString("IMTeen") : "");
+
+ // once we have web-services (or something) which returns
+ // information about a region id, we can print this out
+ // and even have it link to map-teleport or something.
+ //<< "*** region_id: " << region_id << std::endl
+ //<< "*** position: " << position << std::endl;
+
+ LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, bonus_info.str());
+ }
- LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, bonus_info.str());
- }
+ // Logically it would make more sense to reject the session sooner, in another area of the
+ // code, but the session has to be established inside the server before it can be left.
+ if (LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat) && !from_linden)
+ {
+ LL_WARNS() << "Leaving IM session from initiating muted resident " << from << LL_ENDL;
+ if (!gIMMgr->leaveSession(new_session_id))
+ {
+ LL_INFOS() << "Session " << new_session_id << " does not exist." << LL_ENDL;
+ }
+ return;
+ }
- // Logically it would make more sense to reject the session sooner, in another area of the
- // code, but the session has to be established inside the server before it can be left.
- if (LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat) && !from_linden)
- {
- LL_WARNS() << "Leaving IM session from initiating muted resident " << from << LL_ENDL;
- if(!gIMMgr->leaveSession(new_session_id))
+ //Play sound for new conversations
+ if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNewConversation") == TRUE))
{
- LL_INFOS() << "Session " << new_session_id << " does not exist." << LL_ENDL;
+ make_ui_sound("UISndNewIncomingIMSession");
}
- return;
}
-
- //Play sound for new conversations
- if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNewConversation") == TRUE))
- {
- make_ui_sound("UISndNewIncomingIMSession");
- }
+ else
+ {
+ // Failed to create a session, most likely due to empty name (name cache failed?)
+ LL_WARNS() << "Failed to create IM session " << fixed_session_name << LL_ENDL;
+ }
}
if (!LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat) && !skip_message)
@@ -3022,7 +3033,7 @@ void LLIMMgr::inviteToSession(
LLIncomingCallDialog::processCallResponse(1, payload);
return;
}
- else if (LLMuteList::getInstance()->isMuted(caller_id, LLMute::flagAll & ~LLMute::flagVoiceChat))
+ else if (LLMuteList::getInstance()->isMuted(caller_id, LLMute::flagAll & ~LLMute::flagVoiceChat) && !voice_invite)
{
LL_INFOS() << "Rejecting session invite from initiating muted resident " << caller_name << LL_ENDL;
return;