summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llimview.cpp8
-rw-r--r--indra/newview/llimview.h10
-rw-r--r--indra/newview/llnotificationhandlerutil.cpp32
3 files changed, 25 insertions, 25 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 827234be6e..21a3ddfd78 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -455,7 +455,13 @@ bool LLIMModel::logToFile(const LLUUID& session_id, const std::string& from, con
{
if (gSavedPerAccountSettings.getBOOL("LogInstantMessages"))
{
- LLLogChat::saveHistory(LLIMModel::getInstance()->getName(session_id), from, from_id, utf8_text);
+ std::string name = LLIMModel::getInstance()->getName(session_id);
+ if (name == LLStringUtil::null)
+ {
+ name = from;
+ }
+
+ LLLogChat::saveHistory(name, from, from_id, utf8_text);
return true;
}
else
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index 79b0acad69..5cc0b033a2 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -200,17 +200,17 @@ public:
void testMessages();
+ /**
+ * Save an IM message into a file
+ */
+ bool logToFile(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text);
+
private:
/**
* Add message to a list of message associated with session specified by session_id
*/
bool addToHistory(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text);
-
- /**
- * Save an IM message into a file
- */
- bool logToFile(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text);
};
class LLIMSessionObserver
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp
index 112d829563..a30f896fa2 100644
--- a/indra/newview/llnotificationhandlerutil.cpp
+++ b/indra/newview/llnotificationhandlerutil.cpp
@@ -71,29 +71,23 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification)
LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id);
if (session == NULL)
{
- session_id = LLIMMgr::instance().addSession(name,
- IM_NOTHING_SPECIAL, from_id);
- session = LLIMModel::instance().findIMSession(session_id);
+ LLIMModel::instance().logToFile(session_id, name, from_id,
+ notification->getMessage());
}
-
- if (session == NULL)
+ else
{
- llerrs << "session " << session_id << "does not exist " << llendl;
- return;
- }
+ // store active session id
+ const LLUUID & active_session_id =
+ LLIMModel::instance().getActiveSessionID();
+ // set searched session as active to avoid IM toast popup
+ LLIMModel::instance().setActiveSessionID(session->mSessionID);
- // store active session id
- const LLUUID & active_session_id =
- LLIMModel::instance().getActiveSessionID();
+ LLIMModel::instance().addMessage(session->mSessionID, name, from_id,
+ notification->getMessage());
- // set created session as active to avoid IM toast popup
- LLIMModel::instance().setActiveSessionID(session->mSessionID);
-
- LLIMModel::instance().addMessage(session->mSessionID, name, from_id,
- notification->getMessage());
-
- // restore active session id
- LLIMModel::instance().setActiveSessionID(active_session_id);
+ // restore active session id
+ LLIMModel::instance().setActiveSessionID(active_session_id);
+ }
}
}