diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-12-17 18:55:01 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-12-17 18:55:01 -0500 |
commit | 36634bc1ec8d185b8b1d974b8bf215d3a413e242 (patch) | |
tree | 402b4c5ba9f70c960348c07021e32e25a3f8083b /indra/newview/llsyswellwindow.cpp | |
parent | 6b065789c0f38256adb046a0231fe22d05d038da (diff) | |
parent | 74b36a4cf15593e32611f9848b3360605834d626 (diff) |
automated merge viewer2.0->avp
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llsyswellwindow.cpp')
-rw-r--r-- | indra/newview/llsyswellwindow.cpp | 52 |
1 files changed, 43 insertions, 9 deletions
diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index ea49f9c32e..3769ddb1cc 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -32,6 +32,8 @@ #include "llviewerprecompiledheaders.h" // must be first include +#include "llagent.h" + #include "llflatlistview.h" #include "llfloaterreg.h" #include "llnotifications.h" @@ -709,15 +711,15 @@ BOOL LLIMWellWindow::postBuild() void LLIMWellWindow::sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) { - if (mMessageList->getItemByValue(session_id) == NULL) - { - S32 chicletCounter = LLIMModel::getInstance()->getNumUnread(session_id); - if (chicletCounter > -1) - { - addIMRow(session_id, chicletCounter, name, other_participant_id); - reshapeWindow(); - } - } + if (mMessageList->getItemByValue(session_id)) return; + + // For im sessions started as voice call chiclet gets created on the first incoming message + if (gIMMgr->isVoiceCall(session_id)) return; + + if (!gIMMgr->hasSession(session_id)) return; + + addIMRow(session_id, 0, name, other_participant_id); + reshapeWindow(); } //virtual @@ -857,4 +859,36 @@ void LLIMWellWindow::removeObjectRow(const LLUUID& object_id) } } + +void LLIMWellWindow::addIMRow(const LLUUID& session_id) +{ + if (hasIMRow(session_id)) return; + + LLIMModel* im_model = LLIMModel::getInstance(); + addIMRow(session_id, 0, im_model->getName(session_id), im_model->getOtherParticipantID(session_id)); + reshapeWindow(); +} + +bool LLIMWellWindow::hasIMRow(const LLUUID& session_id) +{ + return mMessageList->getItemByValue(session_id); +} + +void LLIMWellWindow::onNewIM(const LLSD& data) +{ + LLUUID from_id = data["from_id"]; + if (from_id.isNull() || gAgentID == from_id) return; + + LLUUID session_id = data["session_id"]; + if (session_id.isNull()) return; + + if (!gIMMgr->isVoiceCall(session_id)) return; + + if (hasIMRow(session_id)) return; + + //first real message, time to create chiclet + addIMRow(session_id); +} + + // EOF |