From 658ccc3e85487f9f24ff3b5926e60d6cce7f42e0 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Wed, 7 Apr 2010 11:08:04 -0700 Subject: Re-insert backed out SLE checkin so we can fix it --- indra/newview/llimview.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index e0f155a6a9..5201f92dbc 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -344,13 +344,13 @@ LLIMModel::LLIMSession::~LLIMSession() mSpeakers = NULL; // End the text IM session if necessary - if(gVoiceClient && mOtherParticipantID.notNull()) + if(LLVoiceClient::getInstance() && mOtherParticipantID.notNull()) { switch(mType) { case IM_NOTHING_SPECIAL: case IM_SESSION_P2P_INVITE: - gVoiceClient->endUserIMSession(mOtherParticipantID); + LLVoiceClient::getInstance()->endUserIMSession(mOtherParticipantID); break; default: @@ -925,7 +925,7 @@ void LLIMModel::sendMessage(const std::string& utf8_text, if((offline == IM_OFFLINE) && (LLVoiceClient::getInstance()->isOnlineSIP(other_participant_id))) { // User is online through the OOW connector, but not with a regular viewer. Try to send the message via SLVoice. - sent = gVoiceClient->sendTextMessage(other_participant_id, utf8_text); + sent = LLVoiceClient::getInstance()->sendTextMessage(other_participant_id, utf8_text); } if(!sent) @@ -1717,7 +1717,7 @@ void LLOutgoingCallDialog::show(const LLSD& key) // skipping "You will now be reconnected to nearby" in notification when call is ended by disabling voice, // so no reconnection to nearby chat happens (EXT-4397) - bool voice_works = LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking(); + bool voice_works = LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking(); std::string reconnect_nearby = voice_works ? LLTrans::getString("reconnect_nearby") : std::string(); childSetTextArg("nearby", "[RECONNECT_NEARBY]", reconnect_nearby); @@ -1843,7 +1843,11 @@ LLCallDialog(payload) void LLIncomingCallDialog::onLifetimeExpired() { // check whether a call is valid or not - if (LLVoiceClient::getInstance()->findSession(mPayload["caller_id"].asUUID())) + LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(mPayload["session_id"].asUUID()); + if(channelp && + (channelp->getState() != LLVoiceChannel::STATE_NO_CHANNEL_INFO) && + (channelp->getState() != LLVoiceChannel::STATE_ERROR) && + (channelp->getState() != LLVoiceChannel::STATE_HUNG_UP)) { // restart notification's timer if call is still valid mLifetimeTimer.start(); @@ -2077,10 +2081,10 @@ void LLIncomingCallDialog::processCallResponse(S32 response) { if (type == IM_SESSION_P2P_INVITE) { - if(gVoiceClient) + if(LLVoiceClient::getInstance()) { std::string s = mPayload["session_handle"].asString(); - gVoiceClient->declineInvite(s); + LLVoiceClient::getInstance()->declineInvite(s); } } else @@ -2168,11 +2172,8 @@ bool inviteUserResponse(const LLSD& notification, const LLSD& response) { if (type == IM_SESSION_P2P_INVITE) { - if(gVoiceClient) - { - std::string s = payload["session_handle"].asString(); - gVoiceClient->declineInvite(s); - } + std::string s = payload["session_handle"].asString(); + LLVoiceClient::getInstance()->declineInvite(s); } else { @@ -3078,7 +3079,7 @@ public: return; } - if(!LLVoiceClient::voiceEnabled()) + if(!LLVoiceClient::getInstance()->voiceEnabled()) { // Don't display voice invites unless the user has voice enabled. return; -- cgit v1.3 From d66c242fea8a846f087562d5ae2b32c50a3f5ef1 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Wed, 14 Apr 2010 17:21:44 -0700 Subject: DEV-48904 - p2p acceptance dialog vanishes too quickly DEV-48903 - malformed names in p2p dialogs for Diamondware In the merge there were some changes that didn't get propagated that resulted in some failures with respect to diamondware name processing. THe determination as to whether a p2p session was with an avatar or with an alcatel (pbx) wasn't propagated into the diamondware code. I fixed that by merging the changes to the vivox module with respect to that into the diamondware module. Also, the acceptance dialog was vanishing too quickly as the determination as to whether there was still a p2p invite pending was not updated when the calling code was updated. The calling code initially was changed to look into vivox state which isn't really valid. that was changed in the 'trunk' to another mechanism, but that still assumed visibility into the voice code. I fixed that by creating an API call to ask whether a call was pending. CR: Karina --- indra/newview/llimview.cpp | 8 ++------ indra/newview/llvoiceclient.cpp | 12 ++++++++++++ indra/newview/llvoiceclient.h | 4 +++- indra/newview/llvoicevivox.cpp | 13 ++++++++----- indra/newview/llvoicevivox.h | 1 + 5 files changed, 26 insertions(+), 12 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index cf83d02b09..247f5b879a 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1847,12 +1847,8 @@ LLCallDialog(payload) void LLIncomingCallDialog::onLifetimeExpired() { - // check whether a call is valid or not - LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(mPayload["session_id"].asUUID()); - if(channelp && - (channelp->getState() != LLVoiceChannel::STATE_NO_CHANNEL_INFO) && - (channelp->getState() != LLVoiceChannel::STATE_ERROR) && - (channelp->getState() != LLVoiceChannel::STATE_HUNG_UP)) + std::string session_handle = mPayload["session_handle"].asString(); + if (LLVoiceClient::getInstance()->invitePending(session_handle)) { // restart notification's timer if call is still valid mLifetimeTimer.start(); diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index e067754e3e..35753178f7 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -385,6 +385,18 @@ void LLVoiceClient::callUser(const LLUUID &uuid) if (mVoiceModule) mVoiceModule->callUser(uuid); } +bool LLVoiceClient::invitePending(std::string &channelHandle) +{ + if (mVoiceModule) + { + return mVoiceModule->invitePending(channelHandle); + } + else + { + return false; + } +} + bool LLVoiceClient::answerInvite(std::string &channelHandle) { if (mVoiceModule) diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index f1a7d3dbec..d4b4f07651 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -176,6 +176,7 @@ public: //@{ // start a voice channel with the specified user virtual void callUser(const LLUUID &uuid)=0; + virtual bool invitePending(std::string& channelHandle)=0; virtual bool answerInvite(std::string &channelHandle)=0; virtual void declineInvite(std::string &channelHandle)=0; //@} @@ -324,7 +325,8 @@ static const F32 OVERDRIVEN_POWER_LEVEL; // NOTE that it will return an empty string if it's in the process of joining a channel. std::string getCurrentChannel(); // start a voice channel with the specified user - void callUser(const LLUUID &uuid); + void callUser(const LLUUID &uuid); + bool invitePending(std::string& channelHandle); bool answerInvite(std::string &channelHandle); void declineInvite(std::string &channelHandle); void leaveChannel(void); // call this on logout or teleport begin diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index f65b87c55b..9d74e7c7ac 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -4582,7 +4582,11 @@ void LLVivoxVoiceClient::endUserIMSession(const LLUUID &uuid) LL_DEBUGS("Voice") << "Session not found for participant ID " << uuid << LL_ENDL; } } - +bool LLVivoxVoiceClient::invitePending(std::string &sessionHandle) +{ + return(findSession(sessionHandle) != NULL); + +} bool LLVivoxVoiceClient::answerInvite(std::string &sessionHandle) { // this is only ever used to answer incoming p2p call invites. @@ -6217,12 +6221,10 @@ void LLVivoxVoiceClient::avatarNameResolved(const LLUUID &id, const std::string { mFriendsListDirty = true; } - // Iterate over all sessions. for(sessionIterator iter = sessionsBegin(); iter != sessionsEnd(); iter++) { sessionState *session = *iter; - // Check for this user as a participant in this session participantState *participant = session->findParticipantByID(id); if(participant) @@ -6249,13 +6251,14 @@ void LLVivoxVoiceClient::avatarNameResolved(const LLUUID &id, const std::string session->mVoiceInvitePending = false; gIMMgr->inviteToSession( - LLIMMgr::computeSessionID(IM_SESSION_P2P_INVITE, session->mCallerID), + session->mIMSessionID, session->mName, session->mCallerID, session->mName, IM_SESSION_P2P_INVITE, LLIMMgr::INVITATION_TYPE_VOICE, - session->mHandle); + session->mHandle, + session->mSIPURI); } } diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 10577254e8..39759a399a 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -166,6 +166,7 @@ public: //@{ // start a voice channel with the specified user virtual void callUser(const LLUUID &uuid); + virtual bool invitePending(std::string &channelHandle); virtual bool answerInvite(std::string &channelHandle); virtual void declineInvite(std::string &channelHandle); //@} -- cgit v1.3 From 6823879c1ad2260e553bc6a641975ca478848f3b Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Mon, 19 Apr 2010 12:52:43 -0700 Subject: CR Changes from Aimee --- indra/newview/llimview.cpp | 2 +- indra/newview/llvoiceclient.cpp | 4 ++-- indra/newview/llvoiceclient.h | 4 ++-- indra/newview/llvoicevivox.cpp | 2 +- indra/newview/llvoicevivox.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 247f5b879a..109090a75a 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1848,7 +1848,7 @@ LLCallDialog(payload) void LLIncomingCallDialog::onLifetimeExpired() { std::string session_handle = mPayload["session_handle"].asString(); - if (LLVoiceClient::getInstance()->invitePending(session_handle)) + if (LLVoiceClient::getInstance()->isValidChannel(session_handle)) { // restart notification's timer if call is still valid mLifetimeTimer.start(); diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 35753178f7..9b311bbb81 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -385,11 +385,11 @@ void LLVoiceClient::callUser(const LLUUID &uuid) if (mVoiceModule) mVoiceModule->callUser(uuid); } -bool LLVoiceClient::invitePending(std::string &channelHandle) +bool LLVoiceClient::isValidChannel(std::string &session_handle) { if (mVoiceModule) { - return mVoiceModule->invitePending(channelHandle); + return mVoiceModule->isValidChannel(session_handle); } else { diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index d4b4f07651..7427ea323f 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -176,7 +176,7 @@ public: //@{ // start a voice channel with the specified user virtual void callUser(const LLUUID &uuid)=0; - virtual bool invitePending(std::string& channelHandle)=0; + virtual bool isValidChannel(std::string& channelHandle)=0; virtual bool answerInvite(std::string &channelHandle)=0; virtual void declineInvite(std::string &channelHandle)=0; //@} @@ -326,7 +326,7 @@ static const F32 OVERDRIVEN_POWER_LEVEL; std::string getCurrentChannel(); // start a voice channel with the specified user void callUser(const LLUUID &uuid); - bool invitePending(std::string& channelHandle); + bool isValidChannel(std::string& channelHandle); bool answerInvite(std::string &channelHandle); void declineInvite(std::string &channelHandle); void leaveChannel(void); // call this on logout or teleport begin diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 9d74e7c7ac..bb657841c4 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -4582,7 +4582,7 @@ void LLVivoxVoiceClient::endUserIMSession(const LLUUID &uuid) LL_DEBUGS("Voice") << "Session not found for participant ID " << uuid << LL_ENDL; } } -bool LLVivoxVoiceClient::invitePending(std::string &sessionHandle) +bool LLVivoxVoiceClient::isValidChannel(std::string &sessionHandle) { return(findSession(sessionHandle) != NULL); diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 39759a399a..9f6c6232fd 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -166,7 +166,7 @@ public: //@{ // start a voice channel with the specified user virtual void callUser(const LLUUID &uuid); - virtual bool invitePending(std::string &channelHandle); + virtual bool isValidChannel(std::string &channelHandle); virtual bool answerInvite(std::string &channelHandle); virtual void declineInvite(std::string &channelHandle); //@} -- cgit v1.3