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

implemented EXT-2962 “Implement adding messages into IM history w/o spawning

chiclet”

--HG--
branch : product-engine
parent 1a622243
No related branches found
No related tags found
No related merge requests found
...@@ -455,7 +455,13 @@ bool LLIMModel::logToFile(const LLUUID& session_id, const std::string& from, con ...@@ -455,7 +455,13 @@ bool LLIMModel::logToFile(const LLUUID& session_id, const std::string& from, con
{ {
if (gSavedPerAccountSettings.getBOOL("LogInstantMessages")) 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; return true;
} }
else else
......
...@@ -200,17 +200,17 @@ class LLIMModel : public LLSingleton<LLIMModel> ...@@ -200,17 +200,17 @@ class LLIMModel : public LLSingleton<LLIMModel>
void testMessages(); 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: private:
/** /**
* Add message to a list of message associated with session specified by session_id * 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); 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 class LLIMSessionObserver
......
...@@ -71,23 +71,16 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification) ...@@ -71,23 +71,16 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification)
LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id); LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id);
if (session == NULL) if (session == NULL)
{ {
session_id = LLIMMgr::instance().addSession(name, LLIMModel::instance().logToFile(session_id, name, from_id,
IM_NOTHING_SPECIAL, from_id); notification->getMessage());
session = LLIMModel::instance().findIMSession(session_id);
} }
else
if (session == NULL)
{ {
llerrs << "session " << session_id << "does not exist " << llendl;
return;
}
// store active session id // store active session id
const LLUUID & active_session_id = const LLUUID & active_session_id =
LLIMModel::instance().getActiveSessionID(); LLIMModel::instance().getActiveSessionID();
// set created session as active to avoid IM toast popup // set searched session as active to avoid IM toast popup
LLIMModel::instance().setActiveSessionID(session->mSessionID); LLIMModel::instance().setActiveSessionID(session->mSessionID);
LLIMModel::instance().addMessage(session->mSessionID, name, from_id, LLIMModel::instance().addMessage(session->mSessionID, name, from_id,
...@@ -97,3 +90,4 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification) ...@@ -97,3 +90,4 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification)
LLIMModel::instance().setActiveSessionID(active_session_id); LLIMModel::instance().setActiveSessionID(active_session_id);
} }
} }
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment