diff options
| -rw-r--r-- | indra/newview/app_settings/settings.xml | 2 | ||||
| -rw-r--r-- | indra/newview/llavataractions.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llimview.cpp | 167 | ||||
| -rw-r--r-- | indra/newview/llimview.h | 19 | ||||
| -rw-r--r-- | indra/newview/llpanelpeople.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llviewerfloaterreg.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llvoicechannel.cpp | 9 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_incoming_call.xml | 40 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_outgoing_call.xml | 72 | 
9 files changed, 294 insertions, 21 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 15c9499bbc..15fa057230 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5501,7 +5501,7 @@        <key>Type</key>        <string>Boolean</string>        <key>Value</key> -      <integer>0</integer> +      <integer>1</integer>      </map>      <key>QAMode</key>      <map> diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index f631978565..ee4a9df15f 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -192,7 +192,7 @@ void LLAvatarActions::startIM(const LLUUID& id)  // static  void LLAvatarActions::startCall(const LLUUID& id)  { -	if (id.isNull() || isCalling(id)) +	if (id.isNull())  	{  		return;  	} diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index be5fbdbbf8..23767d119d 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -46,6 +46,7 @@  #include "llagent.h"  #include "llavatariconctrl.h" +#include "llbottomtray.h"  #include "llcallingcard.h"  #include "llchat.h"  #include "llresmgr.h" @@ -73,6 +74,7 @@  #include "llvoicechannel.h"  #include "lltrans.h"  #include "llrecentpeople.h" +#include "llsyswellwindow.h"  #include "llfirstuse.h"  #include "llagentui.h" @@ -1091,16 +1093,155 @@ LLIMMgr::onConfirmForceCloseError(  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLOutgoingCallDialog +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LLOutgoingCallDialog::LLOutgoingCallDialog(const LLSD& payload) : +	LLDockableFloater(NULL, payload), +	mPayload(payload) +{ +} + +BOOL LLOutgoingCallDialog::postBuild() +{ +	BOOL success = LLFloater::postBuild(); + +	LLSD callee_id = mPayload["session_id"];//mPayload["caller_id"]; + +	std::string calling_str = getString("calling"); +	std::string callee_name = mPayload["session_name"].asString();//mPayload["caller_name"].asString(); +	if (callee_name == "anonymous") +	{ +		callee_name = getString("anonymous"); +	} +	 +	setTitle(callee_name); + +	LLUICtrl* callee_name_widget = getChild<LLUICtrl>("callee name"); +	// *TODO: substitute callee name properly +	callee_name_widget->setValue(calling_str + " " + callee_name); +	LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon"); +	icon->setValue(callee_id); + +	//childSetAction("Reject", onReject, this); + +	return success; +} + +void LLOutgoingCallDialog::processCallResponse(S32 response) +{ +	if (!gIMMgr) +		return; + +	LLUUID session_id = mPayload["session_id"].asUUID(); +	EInstantMessage type = (EInstantMessage)mPayload["type"].asInteger(); +	LLIMMgr::EInvitationType inv_type = (LLIMMgr::EInvitationType)mPayload["inv_type"].asInteger(); +	bool voice = true; +	switch(response) +	{ +	case 2: // start IM: just don't start the voice chat +	{ +		voice = false; +		/* FALLTHROUGH */ +	} +	case 0: // accept +	{ +		if (type == IM_SESSION_P2P_INVITE) +		{ +			// create a normal IM session +			session_id = gIMMgr->addP2PSession( +				mPayload["session_name"].asString(), +				mPayload["caller_id"].asUUID(), +				mPayload["session_handle"].asString()); + +			if (voice) +			{ +				if (gIMMgr->startCall(session_id)) +				{ +					// always open IM window when connecting to voice +					LLIMFloater::show(session_id); +				} +			} + +			gIMMgr->clearPendingAgentListUpdates(session_id); +			gIMMgr->clearPendingInvitation(session_id); +		} +		else +		{ +			LLUUID session_id = gIMMgr->addSession( +				mPayload["session_name"].asString(), +				type, +				session_id); +			if (session_id != LLUUID::null) +			{ +				LLIMFloater::show(session_id); +			} + +			std::string url = gAgent.getRegion()->getCapability( +				"ChatSessionRequest"); + +			if (voice) +			{ +				LLSD data; +				data["method"] = "accept invitation"; +				data["session-id"] = session_id; +				LLHTTPClient::post( +					url, +					data, +					new LLViewerChatterBoxInvitationAcceptResponder( +						session_id, +						inv_type)); +			} +		} +		if (voice) +		{ +			break; +		} +	} +	case 1: // decline +	{ +		if (type == IM_SESSION_P2P_INVITE) +		{ +			if(gVoiceClient) +			{ +				std::string s = mPayload["session_handle"].asString(); +				gVoiceClient->declineInvite(s); +			} +		} +		else +		{ +			std::string url = gAgent.getRegion()->getCapability( +				"ChatSessionRequest"); + +			LLSD data; +			data["method"] = "decline invitation"; +			data["session-id"] = session_id; +			LLHTTPClient::post( +				url, +				data, +				NULL); +		} +	} + +	gIMMgr->clearPendingAgentListUpdates(session_id); +	gIMMgr->clearPendingInvitation(session_id); +	} +} + + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  // Class LLIncomingCallDialog  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  LLIncomingCallDialog::LLIncomingCallDialog(const LLSD& payload) : -	LLModalDialog(payload), +	LLDockableFloater(NULL, false, payload),  	mPayload(payload)  {  }  BOOL LLIncomingCallDialog::postBuild()  { +	LLDockableFloater::postBuild(); +  	LLSD caller_id = mPayload["caller_id"];  	EInstantMessage type = (EInstantMessage)mPayload["type"].asInteger(); @@ -1132,6 +1273,30 @@ BOOL LLIncomingCallDialog::postBuild()  	return TRUE;  } +void LLIncomingCallDialog::getAllowedRect(LLRect& rect) +{ +	rect = gViewerWindow->getWorldViewRectRaw(); +} + +void LLIncomingCallDialog::onOpen(const LLSD& key) +{ +	// tell the user which voice channel they would be leaving +	LLVoiceChannel *voice = LLVoiceChannel::getCurrentVoiceChannel(); +	if (voice && !voice->getSessionName().empty()) +	{ +		childSetTextArg("question", "[CURRENT_CHAT]", voice->getSessionName()); +	} +	else +	{ +		childSetTextArg("question", "[CURRENT_CHAT]", getString("localchat")); +	} + +	// dock the dialog to the sys well, where other sys messages appear +	setDockControl(new LLDockControl(LLBottomTray::getInstance()->getSysWell(), +									 this, getDockTongue(), LLDockControl::TOP, +									 boost::bind(&LLIncomingCallDialog::getAllowedRect, this, _1))); +} +  //static  void LLIncomingCallDialog::onAccept(void* user_data)  { diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index c566b111ca..b6e0c87dcf 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -34,9 +34,11 @@  #define LL_LLIMVIEW_H  #include "lldarray.h" +#include "lldockablefloater.h"  #include "llspeakers.h" //for LLIMSpeakerMgr  #include "llimpanel.h" //for voice channels  #include "llmodaldialog.h" +#include "lldockablefloater.h"  #include "llinstantmessage.h"  #include "lluuid.h"  #include "llmultifloater.h" @@ -401,12 +403,13 @@ private:  	LLSD mPendingAgentListUpdates;  }; -class LLIncomingCallDialog : public LLModalDialog +class LLIncomingCallDialog : public LLDockableFloater  {  public:  	LLIncomingCallDialog(const LLSD& payload);  	/*virtual*/ BOOL postBuild(); +	/*virtual*/ void onOpen(const LLSD& key);  	static void onAccept(void* user_data);  	static void onReject(void* user_data); @@ -414,6 +417,20 @@ public:  private:  	void processCallResponse(S32 response); +	void getAllowedRect(LLRect& rect); + +	LLSD mPayload; +}; + +class LLOutgoingCallDialog : public LLDockableFloater +{ +public: +	LLOutgoingCallDialog(const LLSD& payload); + +	/*virtual*/ BOOL postBuild(); + +private: +	void processCallResponse(S32 response);  	LLSD mPayload;  }; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 9ba94c8ca9..2bbb2b7153 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1193,7 +1193,7 @@ void LLPanelPeople::onCallButtonClicked()  	if (selected_uuids.size() == 1)  	{  		// initiate a P2P voice chat with the selected user -		LLAvatarActions::startCall(selected_uuids[0]); +		LLAvatarActions::startCall(getCurrentItemID());  	}  	else if (selected_uuids.size() > 1)  	{ diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index edbac69e1b..7cd660110f 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -195,7 +195,7 @@ void LLViewerFloaterReg::registerFloaters()  	LLFloaterReg::add("notifications_console", "floater_notifications_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotificationConsole>);  	LLFloaterReg::add("openobject", "floater_openobject.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterOpenObject>); -	 +	LLFloaterReg::add("outgoing_call", "floater_outgoing_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLOutgoingCallDialog>);  	LLFloaterReg::add("parcel_info", "floater_preview_url.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterParcelInfo>);  	LLFloaterPayUtil::registerFloater(); diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 89649407ff..b0ea07946c 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -378,9 +378,18 @@ void LLVoiceChannel::setURI(std::string uri)  void LLVoiceChannel::setState(EState state)  { +	LLSD payload; +	payload["session_id"] = mSessionID; +	payload["session_name"] = mSessionName; +  	switch(state)  	{  	case STATE_RINGING: +		llinfos << "RINGINGGGGGGGG " << mSessionName << llendl; +		if (!mSessionName.empty()) +		{ +			LLFloaterReg::showInstance("outgoing_call", payload, TRUE); +		}		  		gIMMgr->addSystemMessage(mSessionID, "ringing", mNotifyArgs);  		break;  	case STATE_CONNECTED: diff --git a/indra/newview/skins/default/xui/en/floater_incoming_call.xml b/indra/newview/skins/default/xui/en/floater_incoming_call.xml index 16873df310..9c2898945b 100644 --- a/indra/newview/skins/default/xui/en/floater_incoming_call.xml +++ b/indra/newview/skins/default/xui/en/floater_incoming_call.xml @@ -4,13 +4,17 @@   can_close="false"   can_minimize="false"   can_tear_off="false" - height="200" + height="125"   layout="topleft"   name="incoming call"   help_topic="incoming_call"   title="UNKNOWN PERSON IS CALLING" - width="240"> -     <floater.string + width="410"> +    <floater.string +     name="localchat"> +        Local Voice Chat +    </floater.string> +    <floater.string       name="anonymous">          anonymous      </floater.string> @@ -31,18 +35,26 @@       left_delta="19"       top="35"       width="36" /> -    <text_editor -     font="SansSerif" -     height="64" -     border_visible="false" +    <text +     font="SansSerifLarge" +     height="20"       layout="topleft"       left="77" -     max_length="2147483647"       name="caller name" -     read_only="true" -     top="21" -     width="163" +     top="27" +     width="315"       word_wrap="true" /> +    <text +     font="SansSerif" +     height="50" +     layout="topleft" +     left="77" +     name="question" +     top="52" +     width="315" +     word_wrap="true"> +     Do you want to leave [CURRENT_CHAT] and join this voice chat? +    </text>      <button       height="24"       label="Accept" @@ -57,16 +69,14 @@       label="Reject"       label_selected="Reject"       layout="topleft" -     left_delta="0"       name="Reject" -     top_pad="12" +     left_pad="10"       width="100" />      <button       height="24"       label="Start IM"       layout="topleft" -     left_delta="0"       name="Start IM" -     top_pad="12" +     left_pad="10"       width="100" />  </floater> diff --git a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml new file mode 100644 index 0000000000..fd936232c9 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + legacy_header_height="18" + can_close="false" + can_minimize="false" + can_tear_off="false" + height="200" + layout="topleft" + name="outgoing call" + help_topic="outgoing_call" + title="CALLING" + width="240"> +     <floater.string +     name="anonymous"> +        anonymous +    </floater.string> +    <floater.string +     name="calling"> +        Calling [CALLEE] +    </floater.string> +    <floater.string +     name="VoiceInviteAdHoc"> +        has joined a Voice Chat call with a conference chat. +    </floater.string> +    <avatar_icon +     enabled="false" +     follows="left|top" +     height="36" +     image_name="icon_avatar_online.tga" +     layout="topleft" +     left_delta="19" +     top="35" +     width="36" /> +    <text_editor +     font="SansSerif" +     height="64" +     border_visible="false" +     layout="topleft" +     left="77" +     max_length="2147483647" +     name="callee name" +     read_only="true" +     top="21" +     width="163" +     word_wrap="true" /> +    <button +     height="24" +     label="Bar" +     label_selected="Bar" +     layout="topleft" +     left="70" +     name="Bar" +     top="92" +     width="100" /> +    <button +     height="24" +     label="Foo" +     label_selected="Foo" +     layout="topleft" +     left_delta="0" +     name="Foo" +     top_pad="12" +     width="100" /> +    <button +     height="24" +     label="Baz" +     layout="topleft" +     left_delta="0" +     name="Baz" +     top_pad="12" +     width="100" /> +</floater>  | 
