diff options
Diffstat (limited to 'indra/newview/llvoicechannel.cpp')
-rw-r--r-- | indra/newview/llvoicechannel.cpp | 57 |
1 files changed, 18 insertions, 39 deletions
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 8f63df8c29..608060174a 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -37,6 +37,7 @@ #include "llfloaterreg.h" #include "llimview.h" #include "llnotifications.h" +#include "llnotificationsutil.h" #include "llpanel.h" #include "llrecentpeople.h" #include "llviewercontrol.h" @@ -81,13 +82,13 @@ void LLVoiceCallCapResponder::error(U32 status, const std::string& reason) if ( 403 == status ) { //403 == no ability - LLNotifications::instance().add( + LLNotificationsUtil::add( "VoiceNotAllowed", channelp->getNotifyArgs()); } else { - LLNotifications::instance().add( + LLNotificationsUtil::add( "VoiceCallGenericError", channelp->getNotifyArgs()); } @@ -159,13 +160,13 @@ void LLVoiceChannel::setChannelInfo( { if (mURI.empty()) { - LLNotifications::instance().add("VoiceChannelJoinFailed", mNotifyArgs); + LLNotificationsUtil::add("VoiceChannelJoinFailed", mNotifyArgs); llwarns << "Received empty URI for channel " << mSessionName << llendl; deactivate(); } else if (mCredentials.empty()) { - LLNotifications::instance().add("VoiceChannelJoinFailed", mNotifyArgs); + LLNotificationsUtil::add("VoiceChannelJoinFailed", mNotifyArgs); llwarns << "Received empty credentials for channel " << mSessionName << llendl; deactivate(); } @@ -209,7 +210,7 @@ void LLVoiceChannel::handleStatusChange(EStatusType type) { case STATUS_LOGIN_RETRY: //mLoginNotificationHandle = LLNotifyBox::showXml("VoiceLoginRetry")->getHandle(); - LLNotifications::instance().add("VoiceLoginRetry"); + LLNotificationsUtil::add("VoiceLoginRetry"); break; case STATUS_LOGGED_IN: //if (!mLoginNotificationHandle.isDead()) @@ -227,7 +228,7 @@ void LLVoiceChannel::handleStatusChange(EStatusType type) { // if forceably removed from channel // update the UI and revert to default channel - LLNotifications::instance().add("VoiceChannelDisconnected", mNotifyArgs); + LLNotificationsUtil::add("VoiceChannelDisconnected", mNotifyArgs); deactivate(); } mIgnoreNextSessionLeave = FALSE; @@ -407,28 +408,6 @@ void LLVoiceChannel::doSetState(const EState& new_state) mStateChangedCallback(old_state, mState); } -void LLVoiceChannel::toggleCallWindowIfNeeded(EState state) -{ - LLFloaterCall* floater = dynamic_cast<LLFloaterCall*>(LLFloaterReg::getInstance("voice_call", mSessionID)); - if (!floater) - return; - - if (state == STATE_CONNECTED) - { - floater->init(mSessionID); - floater->openFloater(mSessionID); - } - // By checking that current state is CONNECTED we make sure that the call window - // has been shown, hence there's something to hide. This helps when user presses - // the "End call" button right after initiating the call. - // *TODO: move this check to LLFloaterCall? - else if (state == STATE_HUNG_UP && mState == STATE_CONNECTED) - { - floater->reset(); - floater->closeFloater(); - } -} - //static void LLVoiceChannel::initClass() { @@ -619,7 +598,7 @@ void LLVoiceChannelGroup::handleError(EStatusType status) // notification if (!notify.empty()) { - LLNotificationPtr notification = LLNotifications::instance().add(notify, mNotifyArgs); + LLNotificationPtr notification = LLNotificationsUtil::add(notify, mNotifyArgs); // echo to im window gIMMgr->addMessage(mSessionID, LLUUID::null, SYSTEM_FROM, notification->getMessage()); } @@ -629,9 +608,6 @@ void LLVoiceChannelGroup::handleError(EStatusType status) void LLVoiceChannelGroup::setState(EState state) { - // HACK: Open/close the call window if needed. - toggleCallWindowIfNeeded(state); - switch(state) { case STATE_RINGING: @@ -725,7 +701,7 @@ void LLVoiceChannelProximal::handleError(EStatusType status) // notification if (!notify.empty()) { - LLNotifications::instance().add(notify, mNotifyArgs); + LLNotificationsUtil::add(notify, mNotifyArgs); } LLVoiceChannel::handleError(status); @@ -749,6 +725,8 @@ LLVoiceChannelP2P::LLVoiceChannelP2P(const LLUUID& session_id, const std::string mReceivedCall(FALSE) { // make sure URI reflects encoded version of other user's agent id + // *NOTE: in case of Avaline call generated SIP URL will be incorrect. + // But it will be overridden in LLVoiceChannelP2P::setSessionHandle() called when agent accepts call setURI(LLVoiceClient::getInstance()->sipURIFromID(other_user_id)); } @@ -765,12 +743,12 @@ void LLVoiceChannelP2P::handleStatusChange(EStatusType type) if (mState == STATE_RINGING) { // other user declined call - LLNotifications::instance().add("P2PCallDeclined", mNotifyArgs); + LLNotificationsUtil::add("P2PCallDeclined", mNotifyArgs); } else { // other user hung up - LLNotifications::instance().add("VoiceChannelDisconnectedP2P", mNotifyArgs); + LLNotificationsUtil::add("VoiceChannelDisconnectedP2P", mNotifyArgs); } deactivate(); } @@ -788,7 +766,7 @@ void LLVoiceChannelP2P::handleError(EStatusType type) switch(type) { case ERROR_NOT_AVAILABLE: - LLNotifications::instance().add("P2PCallNoAnswer", mNotifyArgs); + LLNotificationsUtil::add("P2PCallNoAnswer", mNotifyArgs); break; default: break; @@ -866,6 +844,10 @@ void LLVoiceChannelP2P::setSessionHandle(const std::string& handle, const std::s } else { + LL_WARNS("Voice") << "incoming SIP URL is not provided. Channel may not work properly." << LL_ENDL; + // In case of incoming AvaLine call generated URI will be differ from original one. + // This is because Avatar-2-Avatar URI is based on avatar UUID but Avaline is not. + // See LLVoiceClient::sessionAddedEvent() -> setUUIDFromStringHash() setURI(LLVoiceClient::getInstance()->sipURIFromID(mOtherUserID)); } @@ -879,9 +861,6 @@ void LLVoiceChannelP2P::setSessionHandle(const std::string& handle, const std::s void LLVoiceChannelP2P::setState(EState state) { - // *HACK: Open/close the call window if needed. - toggleCallWindowIfNeeded(state); - llinfos << "P2P CALL STATE CHANGE: incoming=" << int(mReceivedCall) << " oldstate=" << mState << " newstate=" << state << llendl; if (mReceivedCall) // incoming call |