summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llimfloater.cpp17
-rw-r--r--indra/newview/llimfloater.h3
-rw-r--r--indra/newview/llimview.cpp10
3 files changed, 27 insertions, 3 deletions
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index 47a168e354..22d5b47ae4 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -947,3 +947,20 @@ void LLIMFloater::initIMFloater()
// init chat window type before user changed it in preferences
isChatMultiTab();
}
+
+//static
+void LLIMFloater::sRemoveTypingIndicator(const LLSD& data)
+{
+ LLUUID session_id = data["session_id"];
+ if (session_id.isNull()) return;
+
+ LLUUID from_id = data["from_id"];
+ if (gAgentID == from_id || LLUUID::null == from_id) return;
+
+ LLIMFloater* floater = LLIMFloater::findInstance(session_id);
+ if (!floater) return;
+
+ if (IM_NOTHING_SPECIAL != floater->mDialog) return;
+
+ floater->removeTypingIndicator();
+}
diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h
index f90bc35c34..3184fd8e35 100644
--- a/indra/newview/llimfloater.h
+++ b/indra/newview/llimfloater.h
@@ -109,6 +109,9 @@ public:
static void initIMFloater();
+ //used as a callback on receiving new IM message
+ static void sRemoveTypingIndicator(const LLSD& data);
+
private:
// process focus events to set a currently active session
/* virtual */ void onFocusLost();
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index bc35260983..b31c484529 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -1793,6 +1793,8 @@ LLIMMgr::LLIMMgr() :
{
mPendingInvitations = LLSD::emptyMap();
mPendingAgentListUpdates = LLSD::emptyMap();
+
+ LLIMModel::getInstance()->addNewMsgCallback(boost::bind(&LLIMFloater::sRemoveTypingIndicator, _1));
}
// Add a message to a session.
@@ -2041,11 +2043,12 @@ LLUUID LLIMMgr::addP2PSession(const std::string& name,
LLUUID LLIMMgr::addSession(
const std::string& name,
EInstantMessage dialog,
- const LLUUID& other_participant_id)
+ const LLUUID& other_participant_id,
+ bool voice = false)
{
LLDynamicArray<LLUUID> ids;
ids.put(other_participant_id);
- return addSession(name, dialog, other_participant_id, ids);
+ return addSession(name, dialog, other_participant_id, ids, voice = false);
}
// Adds a session using the given session_id. If the session already exists
@@ -2054,7 +2057,8 @@ LLUUID LLIMMgr::addSession(
const std::string& name,
EInstantMessage dialog,
const LLUUID& other_participant_id,
- const LLDynamicArray<LLUUID>& ids)
+ const LLDynamicArray<LLUUID>& ids,
+ bool voice = false)
{
if (0 == ids.getLength())
{