diff options
author | Lynx Linden <lynx@lindenlab.com> | 2009-12-10 14:05:17 +0000 |
---|---|---|
committer | Lynx Linden <lynx@lindenlab.com> | 2009-12-10 14:05:17 +0000 |
commit | 9b4d09471cca6922257a27ba9cb70498ab81fd94 (patch) | |
tree | b04547e53d051a0e4f082f9d89e1f1043ff081fe /indra/newview/llimview.cpp | |
parent | 3497f64b12f0527f9922e3f09d380559b4e97d11 (diff) |
DEV-41317 DEV-42311: Improved auto-call implementation.
Improved the implementation for auto-connecting an adhoc call. This
involved having the controller (LLIMMgr) set a flag in the model
(LLIMModel) to autoconnect on initialize. Now all of the view code
(LLPanelChatControlPanel) and the signal/callback infrastructure that
I added earlier can be removed as it violated MVP separation. Ah!
Much nicer. Thanks to PE folk for the suggestion.
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r-- | indra/newview/llimview.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 6c4af0522f..4780b51c55 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -158,7 +158,8 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& mSessionInitialized(false), mCallBackEnabled(true), mTextIMPossible(true), - mOtherParticipantIsAvatar(true) + mOtherParticipantIsAvatar(true), + mStartCallOnInitialize(false) { if (IM_NOTHING_SPECIAL == type || IM_SESSION_P2P_INVITE == type) { @@ -413,6 +414,12 @@ void LLIMModel::processSessionInitializedReply(const LLUUID& old_session_id, con { im_floater->sessionInitReplyReceived(new_session_id); } + + // auto-start the call on session initialization? + if (session->mStartCallOnInitialize) + { + gIMMgr->startCall(new_session_id); + } } //*TODO remove this "floater" stuff when Communicate Floater is gone @@ -995,18 +1002,6 @@ bool LLIMModel::sendStartSession( return false; } -// static -void LLIMModel::sendSessionInitialized(const LLUUID &session_id) -{ - LLIMSession* session = getInstance()->findIMSession(session_id); - if (session) - { - LLSD arg; - arg["session_id"] = session_id; - getInstance()->mSessionInitializedSignal(arg); - } -} - // // Helper Functions // @@ -1929,6 +1924,15 @@ BOOL LLIMMgr::getIMReceived() const return mIMReceived; } +void LLIMMgr::autoStartCallOnStartup(const LLUUID& session_id) +{ + LLIMModel::LLIMSession *session = LLIMModel::getInstance()->findIMSession(session_id); + if (session) + { + session->mStartCallOnInitialize = true; + } +} + LLUUID LLIMMgr::addP2PSession(const std::string& name, const LLUUID& other_participant_id, const std::string& voice_session_handle, |