diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-12-03 15:41:36 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-12-03 15:41:36 -0500 |
commit | 1ffd7c99afe25da37a83a2a1dd8a03c7275a5f6b (patch) | |
tree | ad40ea009c5ebea67dd5334d210d90b6dbeebbd3 /indra/newview/llimview.cpp | |
parent | 202d86b15567a783bed55849a7cdc8ad8d8f874f (diff) | |
parent | a9609ae1557a70e095088e0a9b6ef5564dfdb388 (diff) |
automated merge for avp->avp
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r-- | indra/newview/llimview.cpp | 48 |
1 files changed, 38 insertions, 10 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index be719c0a78..5481ca97cd 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -83,19 +83,16 @@ #include "llfirstuse.h" #include "llagentui.h" +const static std::string IM_TIME("time"); +const static std::string IM_TEXT("message"); +const static std::string IM_FROM("from"); +const static std::string IM_FROM_ID("from_id"); + // // Globals // LLIMMgr* gIMMgr = NULL; -// -// Statics -// -// *FIXME: make these all either UIStrings or Strings - -const static std::string IM_SEPARATOR(": "); - - void toast_callback(const LLSD& msg){ // do not show toast in busy mode or it goes from agent if (gAgent.getBusy() || gAgent.getID() == msg["from_id"]) @@ -193,7 +190,13 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& } if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) - LLLogChat::loadHistory(mName, &chatFromLogFile, (void *)this); + { + std::list<LLSD> chat_history; + + //involves parsing of a chat history + LLLogChat::loadAllHistory(mName, chat_history); + addMessagesFromHistory(chat_history); + } } void LLIMModel::LLIMSession::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state) @@ -303,6 +306,30 @@ void LLIMModel::LLIMSession::addMessage(const std::string& from, const LLUUID& f } } +void LLIMModel::LLIMSession::addMessagesFromHistory(const std::list<LLSD>& history) +{ + std::list<LLSD>::const_iterator it = history.begin(); + while (it != history.end()) + { + const LLSD& msg = *it; + + std::string from = msg[IM_FROM]; + LLUUID from_id = LLUUID::null; + if (msg[IM_FROM_ID].isUndefined()) + { + gCacheName->getUUID(from, from_id); + } + + + std::string timestamp = msg[IM_TIME]; + std::string text = msg[IM_TEXT]; + + addMessage(from, from_id, text, timestamp); + + it++; + } +} + void LLIMModel::LLIMSession::chatFromLogFile(LLLogChat::ELogLineType type, const LLSD& msg, void* userdata) { if (!userdata) return; @@ -1348,7 +1375,8 @@ void LLIncomingCallDialog::processCallResponse(S32 response) session_id = gIMMgr->addP2PSession( mPayload["session_name"].asString(), mPayload["caller_id"].asUUID(), - mPayload["session_handle"].asString()); + mPayload["session_handle"].asString(), + mPayload["session_uri"].asString()); if (voice) { |