summaryrefslogtreecommitdiff
path: root/indra/newview/llnotificationhandlerutil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llnotificationhandlerutil.cpp')
-rw-r--r--indra/newview/llnotificationhandlerutil.cpp32
1 files changed, 13 insertions, 19 deletions
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);
+ }
}
}