summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
authormberezhnoy <mberezhnoy@productengine.com>2013-01-30 21:30:20 +0200
committermberezhnoy <mberezhnoy@productengine.com>2013-01-30 21:30:20 +0200
commit84148762d974e728dbcb33f16aa641054ab0b641 (patch)
treed8a4477ea987de4eada4aca30a4ef4639e7ae077 /indra/newview/llimview.cpp
parentb96f04a1bb0577d42059246d15c244702ff02f88 (diff)
parent6af899f19e246c7fe4faa1edcdfbcfe9f01dbd25 (diff)
merging
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp87
1 files changed, 47 insertions, 40 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 4c3d385d2d..5dd5704916 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -204,19 +204,16 @@ void on_new_message(const LLSD& msg)
bool conversation_floater_not_focused =
conversation_floater_is_closed || !im_box->hasFocus();
+ // Skip toasting and flashing if we have open window of IM with this session id
+ if (session_floater
+ && session_floater->isInVisibleChain()
+ && !session_floater->isMinimized()
+ && !(session_floater->getHost() && session_floater->getHost()->isMinimized()))
+ {
+ return;
+ }
if ("toast" == action)
{
- // Skip toasting and flashing if we have open window of IM with this session id
- if (session_floater
- && session_floater->isInVisibleChain()
- && session_floater->hasFocus()
- && !session_floater->isMinimized()
- && !(session_floater->getHost() && session_floater->getHost()->isMinimized())
- )
- {
- return;
- }
-
//User is not focused on conversation containing the message
if(session_floater_not_focused)
{
@@ -240,7 +237,7 @@ void on_new_message(const LLSD& msg)
LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg));
}
}
- }
+ }
}
else if ("flash" == action)
@@ -276,9 +273,9 @@ void on_new_message(const LLSD& msg)
if(!gAgent.isDoNotDisturb())
{
- //Surface conversations floater
- LLFloaterReg::showInstance("im_container");
- }
+ //Surface conversations floater
+ LLFloaterReg::showInstance("im_container");
+ }
//If in DND mode, allow notification to be stored so upon DND exit
//useMostItrusiveIMNotification will be called to notify user a message exists
@@ -287,8 +284,8 @@ void on_new_message(const LLSD& msg)
&& gAgent.isDoNotDisturb())
{
LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg));
- }
-}
+ }
+ }
}
}
@@ -381,15 +378,7 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string&
}
buildHistoryFileName();
-
- if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") )
- {
- std::list<LLSD> chat_history;
-
- //involves parsing of a chat history
- LLLogChat::loadChatHistory(mHistoryFileName, chat_history);
- addMessagesFromHistory(chat_history);
- }
+ loadHistory();
// Localizing name of ad-hoc session. STORM-153
// Changing name should happen here- after the history file was created, so that
@@ -582,11 +571,11 @@ void LLIMModel::LLIMSession::addMessagesFromHistory(const std::list<LLSD>& histo
{
const LLSD& msg = *it;
- std::string from = msg[IM_FROM];
+ std::string from = msg[LL_IM_FROM];
LLUUID from_id;
- if (msg[IM_FROM_ID].isDefined())
+ if (msg[LL_IM_FROM_ID].isDefined())
{
- from_id = msg[IM_FROM_ID].asUUID();
+ from_id = msg[LL_IM_FROM_ID].asUUID();
}
else
{
@@ -595,8 +584,8 @@ void LLIMModel::LLIMSession::addMessagesFromHistory(const std::list<LLSD>& histo
gCacheName->getUUID(legacy_name, from_id);
}
- std::string timestamp = msg[IM_TIME];
- std::string text = msg[IM_TEXT];
+ std::string timestamp = msg[LL_IM_TIME];
+ std::string text = msg[LL_IM_TEXT];
addMessage(from, from_id, text, timestamp, true);
@@ -620,6 +609,20 @@ void LLIMModel::LLIMSession::chatFromLogFile(LLLogChat::ELogLineType type, const
}
}
+void LLIMModel::LLIMSession::loadHistory()
+{
+ mMsgs.clear();
+
+ if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") )
+ {
+ std::list<LLSD> chat_history;
+
+ //involves parsing of a chat history
+ LLLogChat::loadChatHistory(mHistoryFileName, chat_history);
+ addMessagesFromHistory(chat_history);
+ }
+}
+
LLIMModel::LLIMSession* LLIMModel::findIMSession(const LLUUID& session_id) const
{
return get_if_there(mId2SessionMap, session_id,
@@ -924,8 +927,7 @@ bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from,
bool LLIMModel::logToFile(const std::string& file_name, const std::string& from, const LLUUID& from_id, const std::string& utf8_text)
{
- if (gSavedPerAccountSettings.getBOOL("LogInstantMessages")
- && gSavedSettings.getBOOL("KeepConversationLogTranscripts"))
+ if (gSavedSettings.getS32("KeepConversationLogTranscripts") > 1)
{
std::string from_name = from;
@@ -2615,8 +2617,15 @@ void LLIMMgr::addMessage(
}
}
- bool skip_message = (gSavedSettings.getBOOL("VoiceCallsFriendsOnly") &&
- LLAvatarTracker::instance().getBuddyInfo(other_participant_id) == NULL);
+ bool skip_message = false;
+ if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly"))
+ {
+ // Evaluate if we need to skip this message when that setting is true (default is false)
+ LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id);
+ skip_message = (LLAvatarTracker::instance().getBuddyInfo(other_participant_id) == NULL); // Skip non friends...
+ skip_message &= !session->isGroupSessionType(); // Do not skip group chats...
+ skip_message &= !(other_participant_id == gAgentID); // You are your best friend... Don't skip yourself
+ }
if (!LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat) && !skip_message)
{
@@ -3459,12 +3468,10 @@ public:
(time_t) message_params["timestamp"].asInteger();
BOOL is_do_not_disturb = gAgent.isDoNotDisturb();
- BOOL is_muted = LLMuteList::getInstance()->isMuted(
- from_id,
- name,
- LLMute::flagTextChat);
- if (is_do_not_disturb || is_muted)
+ //don't return if user is muted b/c proper way to ignore a muted user who
+ //initiated an adhoc/group conference is to create then leave the session (see STORM-1731)
+ if (is_do_not_disturb)
{
return;
}