[LLIMMgr/LLIMPanel] Fix race condition between name lookup and title setting

This commit is contained in:
Inusaito Sayori
2013-10-11 00:45:23 -04:00
parent 80bb529220
commit aa86730df2

View File

@@ -342,8 +342,6 @@ LLFloaterIMPanel::LLFloaterIMPanel(
mCallBackEnabled = LLVoiceClient::getInstance()->isSessionCallBackPossible(mSessionUUID);
// fallthrough
case IM_SESSION_P2P_INVITE:
if (LLVoiceClient::getInstance()->isParticipantAvatar(mSessionUUID))
LLAvatarNameCache::get(mOtherParticipantUUID, boost::bind(&LLFloaterIMPanel::onAvatarNameLookup, this, _2));
mVoiceChannel = new LLVoiceChannelP2P(mSessionUUID, mLogLabel, mOtherParticipantUUID);
LLAvatarTracker::instance().addParticularFriendObserver(mOtherParticipantUUID, this);
break;
@@ -359,8 +357,6 @@ LLFloaterIMPanel::LLFloaterIMPanel(
&getFactoryMap(),
FALSE);
setTitle(mLogLabel);
// enable line history support for instant message bar
mInputEditor->setEnableLineHistory(TRUE);
@@ -461,6 +457,10 @@ BOOL LLFloaterIMPanel::postBuild()
if (checkRequirements())
{
setTitle(mLogLabel);
if (mSessionType == P2P_SESSION && LLVoiceClient::getInstance()->isParticipantAvatar(mSessionUUID))
LLAvatarNameCache::get(mOtherParticipantUUID, boost::bind(&LLFloaterIMPanel::onAvatarNameLookup, this, _2));
mInputEditor = getChild<LLLineEditor>("chat_editor");
mInputEditor->setFocusReceivedCallback( boost::bind(&LLFloaterIMPanel::onInputEditorFocusReceived, this) );
mFocusLostSignal = mInputEditor->setFocusLostCallback(boost::bind(&LLFloaterIMPanel::setTyping, this, false));