Skip to content
Snippets Groups Projects
Commit 0c828289 authored by Alexei Arabadji's avatar Alexei Arabadji
Browse files

renamed LLHandlerUtil::logToIM to LLHandlerUtil::logToIMP2P;

avoided IM-toast popup when adding message to session;

--HG--
branch : product-engine
parent d5152b3e
No related branches found
No related tags found
No related merge requests found
...@@ -268,7 +268,7 @@ class LLHandlerUtil ...@@ -268,7 +268,7 @@ class LLHandlerUtil
/** /**
* Writes notification message to IM session. * Writes notification message to IM session.
*/ */
static void logToIM(const LLNotificationPtr& notification); static void logToIMP2P(const LLNotificationPtr& notification);
}; };
} }
......
...@@ -52,7 +52,7 @@ bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification) ...@@ -52,7 +52,7 @@ bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification)
} }
// static // static
void LLHandlerUtil::logToIM(const LLNotificationPtr& notification) void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification)
{ {
// add message to IM // add message to IM
const std::string const std::string
...@@ -82,7 +82,18 @@ void LLHandlerUtil::logToIM(const LLNotificationPtr& notification) ...@@ -82,7 +82,18 @@ void LLHandlerUtil::logToIM(const LLNotificationPtr& notification)
return; return;
} }
LLIMModel::instance().addMessageSilently(*session, name, from_id,
// store active session id
const LLUUID & active_session_id =
LLIMModel::instance().getActiveSessionID();
// 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()); notification->getMessage());
// restore active session id
LLIMModel::instance().setActiveSessionID(active_session_id);
} }
} }
...@@ -90,7 +90,7 @@ bool LLOfferHandler::processNotification(const LLSD& notify) ...@@ -90,7 +90,7 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change") if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change")
{ {
LLHandlerUtil::logToIM(notification); LLHandlerUtil::logToIMP2P(notification);
LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification); LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification);
......
...@@ -98,7 +98,7 @@ bool LLScriptHandler::processNotification(const LLSD& notify) ...@@ -98,7 +98,7 @@ bool LLScriptHandler::processNotification(const LLSD& notify)
{ {
if (LLHandlerUtil::canLogToIM(notification)) if (LLHandlerUtil::canLogToIM(notification))
{ {
LLHandlerUtil::logToIM(notification); LLHandlerUtil::logToIMP2P(notification);
} }
if(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName() || SCRIPT_LOAD_URL == notification->getName()) if(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName() || SCRIPT_LOAD_URL == notification->getName())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment