summaryrefslogtreecommitdiff
path: root/indra/newview/llsyswellwindow.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2009-12-18 10:50:29 -0800
committerJames Cook <james@lindenlab.com>2009-12-18 10:50:29 -0800
commiteb501f3231aacb2fd97d8428bb2d25b818b26263 (patch)
tree85a58ed7942c2b96b3e03c9e4dbd8237423e7696 /indra/newview/llsyswellwindow.cpp
parentb0fd284fbf72ef3a38ea64a61f8d5fe3e2e314b7 (diff)
parentad6d0e3bb766c737b1e9bbd9d006391cc8bcc085 (diff)
Merge, pulling in viewer-2-0
Diffstat (limited to 'indra/newview/llsyswellwindow.cpp')
-rw-r--r--indra/newview/llsyswellwindow.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp
index f49e7ef0da..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,8 +711,8 @@ BOOL LLIMWellWindow::postBuild()
void LLIMWellWindow::sessionAdded(const LLUUID& session_id,
const std::string& name, const LLUUID& other_participant_id)
{
- if (!mMessageList->getItemByValue(session_id)) return;
-
+ 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;
@@ -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