Commits

Steven Bennetts  committed d1ddf69

Merging revisions 2107-2109 of https://svn.aws.productengine.com/secondlife/pe/stable-2 into P:\svn\viewer-2.0.0, respecting ancestry
* Bugs: EXT-1557

  • Participants
  • Parent commits 00524ca

Comments (0)

Files changed (5)

File indra/newview/llimpanel.cpp

 	mSentTypingState(TRUE),
 	mNumUnreadMessages(0),
 	mShowSpeakersOnConnect(TRUE),
-	mAutoConnect(FALSE),
 	mTextIMPossible(TRUE),
 	mProfileButtonEnabled(TRUE),
 	mCallBackEnabled(TRUE),
 		mInputEditor->setLabel(getString("default_text_label"));
 	}
 
-	if (mAutoConnect && enable_connect)
-	{
-		onClickStartCall(this);
-		mAutoConnect = FALSE;
-	}
-
 	// show speakers window when voice first connects
 	if (mShowSpeakersOnConnect && voice_channel->isActive())
 	{
 {
 	LLFloaterIMPanel* self = (LLFloaterIMPanel*) userdata;
 
-	LLIMModel::getInstance()->getVoiceChannel(self->mSessionUUID)->activate();
+	gIMMgr->startCall(self->mSessionUUID);
 }
 
 // static
 {
 	LLFloaterIMPanel* self = (LLFloaterIMPanel*) userdata;
 
-	LLIMModel::getInstance()->getVoiceChannel(self->mSessionUUID)->deactivate();
+	gIMMgr->endCall(self->mSessionUUID);
 }
 
 // static
 	}
 }
 
-void LLFloaterIMPanel::requestAutoConnect()
-{
-	mAutoConnect = TRUE;
-}
-
 void LLFloaterIMPanel::setTyping(BOOL typing)
 {
 	LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionUUID);

File indra/newview/llimpanel.h

 
 	BOOL mShowSpeakersOnConnect;
 
-	BOOL mAutoConnect;
-	
 	BOOL mTextIMPossible;
 	BOOL mProfileButtonEnabled;
 	BOOL mCallBackEnabled;

File indra/newview/llimview.cpp

 				//in case of race conditions
 				speaker_mgr->updateSpeakers(gIMMgr->getPendingAgentListUpdates(mSessionID));
 			}
-			
-			LLFloaterIMPanel* floaterp =
-				gIMMgr->findFloaterBySession(mSessionID);
 
-			if (floaterp)
+			if (LLIMMgr::INVITATION_TYPE_VOICE == mInvitiationType)
 			{
-				if ( mInvitiationType == LLIMMgr::INVITATION_TYPE_VOICE )
-				{
-					floaterp->requestAutoConnect();
-					LLFloaterIMPanel::onClickStartCall(floaterp);
-					// always open IM window when connecting to voice
-					LLFloaterReg::showInstance("communicate", LLSD(), TRUE);
-				}
-				else if ( mInvitiationType == LLIMMgr::INVITATION_TYPE_IMMEDIATE )
-				{
-					LLFloaterReg::showInstance("communicate", LLSD(), TRUE);
-				}
+				gIMMgr->startCall(mSessionID);
+			}
+
+			if ((mInvitiationType == LLIMMgr::INVITATION_TYPE_VOICE 
+				|| mInvitiationType == LLIMMgr::INVITATION_TYPE_IMMEDIATE)
+				&& LLIMModel::getInstance()->findIMSession(mSessionID))
+			{
+				// always open IM window when connecting to voice
+				LLIMFloater::show(mSessionID);
 			}
 
 			gIMMgr->clearPendingAgentListUpdates(mSessionID);
 
 			if (voice)
 			{
-				LLFloaterIMPanel* im_floater =
-					gIMMgr->findFloaterBySession(
-						session_id);
-
-				if (im_floater)
+				if (gIMMgr->startCall(session_id))
 				{
-					im_floater->requestAutoConnect();
-					LLFloaterIMPanel::onClickStartCall(im_floater);		
+					// always open IM window when connecting to voice
+					LLIMFloater::show(session_id);
 				}
 			}
 
-			// always open IM window when connecting to voice
-			LLFloaterReg::showInstance("communicate", session_id);
-
 			gIMMgr->clearPendingAgentListUpdates(session_id);
 			gIMMgr->clearPendingInvitation(session_id);
 		}
 					payload["session_handle"].asString(),
 					payload["session_uri"].asString());
 
-				LLFloaterIMPanel* im_floater =
-					gIMMgr->findFloaterBySession(
-						session_id);
-				if (im_floater)
+				if (gIMMgr->startCall(session_id))
 				{
-					im_floater->requestAutoConnect();
-					LLFloaterIMPanel::onClickStartCall(im_floater);
 					// always open IM window when connecting to voice
-					LLFloaterReg::showInstance("communicate", session_id, TRUE);
+					LLIMFloater::show(session_id);
 				}
 
 				gIMMgr->clearPendingAgentListUpdates(session_id);
 	mSessionObservers.remove(observer);
 }
 
+bool LLIMMgr::startCall(const LLUUID& session_id)
+{
+	LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(session_id);
+	if (!voice_channel) return false;
+	
+	voice_channel->activate();
+	return true;
+}
+
+bool LLIMMgr::endCall(const LLUUID& session_id)
+{
+	LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(session_id);
+	if (!voice_channel) return false;
+
+	voice_channel->deactivate();
+	return true;
+}
+
 // create a floater and update internal representation for
 // consistency. Returns the pointer, caller (the class instance since
 // it is a private method) is not responsible for deleting the

File indra/newview/llimview.h

 	void addSessionObserver(LLIMSessionObserver *);
 	void removeSessionObserver(LLIMSessionObserver *);
 
+	/**
+	 * Start call in a session
+	 * @return false if voice channel doesn't exist
+	 **/
+	bool startCall(const LLUUID& session_id);
+
+	/**
+	 * End call in a session
+	 * @return false if voice channel doesn't exist
+	 **/
+	bool endCall(const LLUUID& session_id);
+
 private:
 	// create a panel and update internal representation for
 	// consistency. Returns the pointer, caller (the class instance

File indra/newview/llpanelavatar.cpp

 	childSetCommitCallback("share",(boost::bind(&LLPanelAvatarProfile::onShareButtonClick,this)),NULL);
 
 	LLTextureCtrl* pic = getChild<LLTextureCtrl>("2nd_life_pic");
-	pic->setFallbackImageName("default_land_picture.j2c");
+	pic->setFallbackImageName("default_profile_picture.j2c");
 
 	pic = getChild<LLTextureCtrl>("real_world_pic");
-	pic->setFallbackImageName("default_land_picture.j2c");
+	pic->setFallbackImageName("default_profile_picture.j2c");
 
 	resetControls();
 	resetData();