diff options
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/llbottomtray.h | 10 | ||||
| -rw-r--r-- | indra/newview/llimfloater.cpp | 24 | ||||
| -rw-r--r-- | indra/newview/llsyswellwindow.cpp | 34 | ||||
| -rw-r--r-- | indra/newview/llsyswellwindow.h | 5 | 
4 files changed, 68 insertions, 5 deletions
| diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index 1adea24ee4..209fa7cca1 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -92,6 +92,11 @@ public:  	void showMoveButton(BOOL visible);  	void showCameraButton(BOOL visible);  	void showSnapshotButton(BOOL visible); +	 +	/** +	 * Creates IM Chiclet based on session type (IM chat or Group chat) +	 */ +	LLIMChiclet* createIMChiclet(const LLUUID& session_id);  private:  	typedef enum e_resize_status_type @@ -184,11 +189,6 @@ protected:  	void onContextMenuItemClicked(const LLSD& userdata);  	bool onContextMenuItemEnabled(const LLSD& userdata); -	/** -	 * Creates IM Chiclet based on session type (IM chat or Group chat) -	 */ -	LLIMChiclet* createIMChiclet(const LLUUID& session_id); -  	LLChicletPanel* 	mChicletPanel;  	LLPanel*			mSpeakPanel;  	LLSpeakButton* 		mSpeakBtn; diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 7dc21e6e23..ca43833530 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -49,6 +49,7 @@  #include "lllogchat.h"  #include "llpanelimcontrolpanel.h"  #include "llscreenchannel.h" +#include "llsyswellwindow.h"  #include "lltrans.h"  #include "llchathistory.h"  #include "llviewerwindow.h" @@ -339,6 +340,29 @@ void LLIMFloater::onSlide()  //static  LLIMFloater* LLIMFloater::show(const LLUUID& session_id)  { +	if (!gIMMgr->hasSession(session_id)) return NULL; + +	// we should make sure all related chiclets are in place when the session is a voice call +	// chiclets come firts, then comes IM window +	if (gIMMgr->isVoiceCall(session_id)) +	{ +		LLIMModel* im_model = LLIMModel::getInstance(); +		LLBottomTray* b_tray = LLBottomTray::getInstance(); +		 +		//*TODO hide that into Bottom tray +		if (!b_tray->getChicletPanel()->findChiclet<LLChiclet>(session_id)) +		{ +			LLIMChiclet* chiclet = b_tray->createIMChiclet(session_id); +			if(chiclet) +			{ +				chiclet->setIMSessionName(im_model->getName(session_id)); +				chiclet->setOtherParticipantId(im_model->getOtherParticipantID(session_id)); +			} +		} + +		LLIMWellWindow::getInstance()->addIMRow(session_id); +	} +		  	bool not_existed = true;  	if(isChatMultiTab()) diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index feaa22e7f0..3769ddb1cc 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -32,6 +32,8 @@  #include "llviewerprecompiledheaders.h" // must be first include +#include "llagent.h" +  #include "llflatlistview.h"  #include "llfloaterreg.h"  #include "llnotifications.h" @@ -857,4 +859,36 @@ void LLIMWellWindow::removeObjectRow(const LLUUID& object_id)  	}  } + +void LLIMWellWindow::addIMRow(const LLUUID& session_id) +{ +	if (hasIMRow(session_id)) return; + +	LLIMModel* im_model = LLIMModel::getInstance(); +	addIMRow(session_id, 0, im_model->getName(session_id), im_model->getOtherParticipantID(session_id)); +	reshapeWindow(); +} + +bool LLIMWellWindow::hasIMRow(const LLUUID& session_id) +{ +	return mMessageList->getItemByValue(session_id); +} + +void LLIMWellWindow::onNewIM(const LLSD& data) +{ +	LLUUID from_id = data["from_id"]; +	if (from_id.isNull() || gAgentID == from_id) return; + +	LLUUID session_id = data["session_id"]; +	if (session_id.isNull()) return; + +	if (!gIMMgr->isVoiceCall(session_id)) return; + +	if (hasIMRow(session_id)) return; + +	//first real message, time to create chiclet +	addIMRow(session_id); +} + +  // EOF diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index fea145a17e..736b1b9fb4 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -188,9 +188,14 @@ public:  	/*virtual*/ void sessionRemoved(const LLUUID& session_id);  	/*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id); +	void onNewIM(const LLSD& data); +  	void addObjectRow(const LLUUID& object_id, bool new_message = false);  	void removeObjectRow(const LLUUID& object_id); +	void addIMRow(const LLUUID& session_id); +	bool hasIMRow(const LLUUID& session_id); +  protected:  	/*virtual*/ const std::string& getAnchorViewName() { return IM_WELL_ANCHOR_NAME; } | 
