diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2009-11-13 15:37:44 +0000 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2009-11-13 15:37:44 +0000 |
commit | e60ba28953090d264f0be08b83798ca4eda1d9eb (patch) | |
tree | 024fe4d456c586dd48b91f11d178cbecd2a79bc4 | |
parent | fdf287d9b634d194fb22655155fa26f9c7233db7 (diff) |
minor code restructuring to aid more state-change dialog-jiggery.
-rw-r--r-- | indra/newview/llvoicechannel.cpp | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 03e0f99727..bb2965b9ce 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -873,26 +873,32 @@ void LLVoiceChannelP2P::setState(EState state) // *HACK: Open/close the call window if needed. toggleCallWindowIfNeeded(state); - // *HACK: open outgoing call floater if needed, might be better done elsewhere. - mCallDialogPayload["session_id"] = mSessionID; - mCallDialogPayload["session_name"] = mSessionName; - mCallDialogPayload["other_user_id"] = mOtherUserID; - if (!mReceivedCall && state == STATE_RINGING) - { - llinfos << "RINGINGGGGGGGG " << mSessionName << llendl; - if (!mSessionName.empty()) + if (mReceivedCall) // incoming call + { + // you only "answer" voice invites in p2p mode + // so provide a special purpose message here + if (mReceivedCall && state == STATE_RINGING) { - LLFloaterReg::showInstance("outgoing_call", mCallDialogPayload, TRUE); + gIMMgr->addSystemMessage(mSessionID, "answering", mNotifyArgs); + doSetState(state); + return; } } - - // you only "answer" voice invites in p2p mode - // so provide a special purpose message here - if (mReceivedCall && state == STATE_RINGING) + else // outgoing call { - gIMMgr->addSystemMessage(mSessionID, "answering", mNotifyArgs); - doSetState(state); - return; + mCallDialogPayload["session_id"] = mSessionID; + mCallDialogPayload["session_name"] = mSessionName; + mCallDialogPayload["other_user_id"] = mOtherUserID; + if (state == STATE_RINGING) + { + // *HACK: open outgoing call floater if needed, might be better done elsewhere. + llinfos << "RINGINGGGGGGGG " << mSessionName << llendl; + if (!mSessionName.empty()) + { + LLFloaterReg::showInstance("outgoing_call", mCallDialogPayload, TRUE); + } + } } + LLVoiceChannel::setState(state); } |