summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 6064415a10..b53d36a074 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -330,13 +330,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:
@@ -858,7 +858,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)
@@ -1729,7 +1729,11 @@ bool LLIncomingCallDialog::lifetimeHasExpired()
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();
@@ -1958,10 +1962,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
@@ -2049,11 +2053,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
{
@@ -3160,7 +3161,7 @@ public:
return;
}
- if(!LLVoiceClient::voiceEnabled())
+ if(!LLVoiceClient::getInstance()->voiceEnabled())
{
// Don't display voice invites unless the user has voice enabled.
return;