Added safety checks wherever getSpeakerManager() is called.
Removed a meaningless (and misleading) const qualifier to a LLPointer return value. Added a getter for LLSpeakerMgr::mVoiceChannel to replace some very incorrect code casting LLIMSpeakerMgr to LLVoiceChannelP2P Reviewed by Leylamaster
parent
81e0fb43ca
commit
f74e3d40fd
|
|
@ -1162,8 +1162,12 @@ void LLFloaterIMPanel::draw()
|
|||
childSetEnabled("start_call_btn", enable_connect);
|
||||
childSetEnabled("send_btn", !childGetValue("chat_editor").asString().empty());
|
||||
|
||||
LLPointer<LLSpeaker> self_speaker;
|
||||
LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionUUID);
|
||||
LLPointer<LLSpeaker> self_speaker = speaker_mgr->findSpeaker(gAgent.getID());
|
||||
if (speaker_mgr)
|
||||
{
|
||||
self_speaker = speaker_mgr->findSpeaker(gAgent.getID());
|
||||
}
|
||||
if(!mTextIMPossible)
|
||||
{
|
||||
mInputEditor->setEnabled(FALSE);
|
||||
|
|
@ -1751,8 +1755,9 @@ void LLFloaterIMPanel::setTyping(BOOL typing)
|
|||
// Will send typing state after a short delay.
|
||||
mSentTypingState = FALSE;
|
||||
}
|
||||
|
||||
speaker_mgr->setSpeakerTyping(gAgent.getID(), TRUE);
|
||||
|
||||
if (speaker_mgr)
|
||||
speaker_mgr->setSpeakerTyping(gAgent.getID(), TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1762,7 +1767,8 @@ void LLFloaterIMPanel::setTyping(BOOL typing)
|
|||
sendTypingState(FALSE);
|
||||
mSentTypingState = TRUE;
|
||||
}
|
||||
speaker_mgr->setSpeakerTyping(gAgent.getID(), FALSE);
|
||||
if (speaker_mgr)
|
||||
speaker_mgr->setSpeakerTyping(gAgent.getID(), FALSE);
|
||||
}
|
||||
|
||||
mTyping = typing;
|
||||
|
|
@ -1822,7 +1828,11 @@ void LLFloaterIMPanel::removeTypingIndicator(const LLIMInfo* im_info)
|
|||
mHistoryEditor->removeTextFromEnd(chars_to_remove);
|
||||
if (im_info)
|
||||
{
|
||||
LLIMModel::getInstance()->getSpeakerManager(mSessionUUID)->setSpeakerTyping(im_info->mFromID, FALSE);
|
||||
LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionUUID);
|
||||
if (speaker_mgr)
|
||||
{
|
||||
speaker_mgr->setSpeakerTyping(im_info->mFromID, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1432,12 +1432,15 @@ LLUUID LLIMMgr::addP2PSession(const std::string& name,
|
|||
{
|
||||
LLUUID session_id = addSession(name, IM_NOTHING_SPECIAL, other_participant_id);
|
||||
|
||||
LLVoiceChannelP2P* voice_channel = dynamic_cast<LLVoiceChannelP2P*>(LLIMModel::getInstance()->getSpeakerManager(session_id));
|
||||
if (voice_channel)
|
||||
LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(session_id);
|
||||
if (speaker_mgr)
|
||||
{
|
||||
voice_channel->setSessionHandle(voice_session_handle, caller_uri);
|
||||
LLVoiceChannelP2P* voice_channel = dynamic_cast<LLVoiceChannelP2P*>(speaker_mgr->getVoiceChannel());
|
||||
if (voice_channel)
|
||||
{
|
||||
voice_channel->setSessionHandle(voice_session_handle, caller_uri);
|
||||
}
|
||||
}
|
||||
|
||||
return session_id;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue