summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
authorSteve Bennetts <steve@lindenlab.com>2009-11-06 18:13:38 -0800
committerSteve Bennetts <steve@lindenlab.com>2009-11-06 18:13:38 -0800
commit86314438477815eeac17de17799a5e0c0b7d874e (patch)
tree139f80ec0c6f12538b115677be890a816b60c98e /indra/newview/llimview.cpp
parent5e85642650d4ffa822b749c5a4a211531545d660 (diff)
parent9c55ff93903d19b22dec63a6db26e9ec3436fbf5 (diff)
merge changes from product-engine
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp65
1 files changed, 40 insertions, 25 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 7e8701bf21..fdf119fbee 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -134,7 +134,6 @@ void LLIMModel::setActiveSessionID(const LLUUID& session_id)
LLIMModel::LLIMModel()
{
addNewMsgCallback(LLIMFloater::newIMCallback);
- addNoUnreadMsgsCallback(LLIMFloater::newIMCallback);
addNewMsgCallback(toast_callback);
}
@@ -440,7 +439,8 @@ bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, co
addToHistory(session_id, from, from_id, utf8_text);
if (log2file) logToFile(session_id, from, from_id, utf8_text);
- session->mNumUnread++;
+ //we do not count system messages
+ if (from_id.notNull()) session->mNumUnread++;
// notify listeners
LLSD arg;
@@ -1192,10 +1192,14 @@ void LLIncomingCallDialog::processCallResponse(S32 response)
}
else
{
- gIMMgr->addSession(
+ LLUUID session_id = gIMMgr->addSession(
mPayload["session_name"].asString(),
type,
session_id);
+ if (session_id != LLUUID::null)
+ {
+ LLIMFloater::show(session_id);
+ }
std::string url = gAgent.getRegion()->getCapability(
"ChatSessionRequest");
@@ -1279,10 +1283,14 @@ bool inviteUserResponse(const LLSD& notification, const LLSD& response)
}
else
{
- gIMMgr->addSession(
+ LLUUID session_id = gIMMgr->addSession(
payload["session_name"].asString(),
type,
session_id);
+ if (session_id != LLUUID::null)
+ {
+ LLIMFloater::show(session_id);
+ }
std::string url = gAgent.getRegion()->getCapability(
"ChatSessionRequest");
@@ -1350,13 +1358,6 @@ bool inviteUserResponse(const LLSD& notification, const LLSD& response)
LLIMMgr::LLIMMgr() :
mIMReceived(FALSE)
{
- static bool registered_dialog = false;
- if (!registered_dialog)
- {
- LLFloaterReg::add("incoming_call", "floater_incoming_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIncomingCallDialog>);
- registered_dialog = true;
- }
-
mPendingInvitations = LLSD::emptyMap();
mPendingAgentListUpdates = LLSD::emptyMap();
}
@@ -1555,6 +1556,10 @@ LLUUID LLIMMgr::addP2PSession(const std::string& name,
const std::string& caller_uri)
{
LLUUID session_id = addSession(name, IM_NOTHING_SPECIAL, other_participant_id);
+ if (session_id != LLUUID::null)
+ {
+ LLIMFloater::show(session_id);
+ }
LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(session_id);
if (speaker_mgr)
@@ -1848,6 +1853,29 @@ void LLIMMgr::clearPendingInvitation(const LLUUID& session_id)
}
}
+void LLIMMgr::processAgentListUpdates(const LLUUID& session_id, const LLSD& body)
+{
+ LLIMFloater* im_floater = LLIMFloater::findInstance(session_id);
+ if ( im_floater )
+ {
+ im_floater->processAgentListUpdates(body);
+ }
+ LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(session_id);
+ if (speaker_mgr)
+ {
+ speaker_mgr->updateSpeakers(body);
+ }
+ else
+ {
+ //we don't have a speaker manager yet..something went wrong
+ //we are probably receiving an update here before
+ //a start or an acceptance of an invitation. Race condition.
+ gIMMgr->addPendingAgentListUpdates(
+ session_id,
+ body);
+ }
+}
+
LLSD LLIMMgr::getPendingAgentListUpdates(const LLUUID& session_id)
{
if ( mPendingAgentListUpdates.has(session_id.asString()) )
@@ -2232,20 +2260,7 @@ public:
const LLSD& input) const
{
const LLUUID& session_id = input["body"]["session_id"].asUUID();
- LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(session_id);
- if (speaker_mgr)
- {
- speaker_mgr->updateSpeakers(input["body"]);
- }
- else
- {
- //we don't have a speaker manager yet..something went wrong
- //we are probably receiving an update here before
- //a start or an acceptance of an invitation. Race condition.
- gIMMgr->addPendingAgentListUpdates(
- input["body"]["session_id"].asUUID(),
- input["body"]);
- }
+ gIMMgr->processAgentListUpdates(session_id, input["body"]);
}
};