/*virtual*/ void httpSuccess(void)
	{
		if ( gIMMgr)
		{
			LLFloaterIMPanel* floater = gIMMgr->findFloaterBySession(mSessionID);
			LLIMSpeakerMgr* speaker_mgr = floater ? floater->getSpeakerManager() : NULL;
			if (speaker_mgr)
			{
				//we've accepted our invitation
				//and received a list of agents that were
				//currently in the session when the reply was sent
				//to us.  Now, it is possible that there were some agents
				//to slip in/out between when that message was sent to us
				//and now.

				//the agent list updates we've received have been
				//accurate from the time we were added to the session
				//but unfortunately, our base that we are receiving here
				//may not be the most up to date.  It was accurate at
				//some point in time though.
				speaker_mgr->setSpeakers(mContent);

				//we now have our base of users in the session
				//that was accurate at some point, but maybe not now
				//so now we apply all of the udpates we've received
				//in case of race conditions
				speaker_mgr->updateSpeakers(gIMMgr->getPendingAgentListUpdates(mSessionID));
			}

			if (LLIMMgr::INVITATION_TYPE_VOICE == mInvitiationType)
			{
				gIMMgr->startCall(mSessionID, LLVoiceChannel::INCOMING_CALL);
			}

			if ((mInvitiationType == LLIMMgr::INVITATION_TYPE_VOICE
				|| mInvitiationType == LLIMMgr::INVITATION_TYPE_IMMEDIATE)
				&& floater)
			{
				// always open IM window when connecting to voice
				if (floater->getParent() == gFloaterView)
					floater->open();
				else
					LLFloaterChatterBox::showInstance(TRUE);
			}

			gIMMgr->clearPendingAgentListUpdates(mSessionID);
			gIMMgr->clearPendingInvitation(mSessionID);
		}
	}
// Adds a session using the given session_id.  If the session already exists 
// the dialog type is assumed correct. Returns the uuid of the session.
LLUUID LLIMMgr::addSession(
	const std::string& name,
	EInstantMessage dialog,
	const LLUUID& other_participant_id,
	const LLDynamicArray<LLUUID>& ids)
{
	if (0 == ids.getLength())
	{
		return LLUUID::null;
	}

	LLUUID session_id = computeSessionID(
		dialog,
		other_participant_id);

	LLFloaterIMPanel* floater = findFloaterBySession(session_id);
	if(!floater)
	{
		// On creation, use the first element of ids as the
		// "other_participant_id"
		floater = createFloater(
			session_id,
			other_participant_id,
			name,
			ids,
			dialog,
			TRUE);

		if ( !floater ) return LLUUID::null;

		noteOfflineUsers(floater, ids);
		LLFloaterChatterBox::showInstance(session_id);

		// Only warn for regular IMs - not group IMs
		if( dialog == IM_NOTHING_SPECIAL )
		{
			noteMutedUsers(floater, ids);
		}
	}
	else
	{
		floater->open();
	}
	//mTabContainer->selectTabPanel(panel);
	floater->setInputFocus(TRUE);
	return floater->getSessionID();
}
// This adds a session to the talk view. The name is the local name of
// the session, dialog specifies the type of session. If the session
// exists, it is brought forward.  Specifying id = NULL results in an
// im session to everyone. Returns the uuid of the session.
LLUUID LLIMMgr::addSession(
	const std::string& name,
	EInstantMessage dialog,
	const LLUUID& other_participant_id)
{
	LLUUID session_id = computeSessionID(dialog, other_participant_id);

	LLFloaterIMPanel* floater = findFloaterBySession(session_id);
	if(!floater)
	{
		std::vector<LLUUID> ids;
		ids.push_back(other_participant_id);

		floater = createFloater(session_id, other_participant_id, name, dialog, ids, true);

		noteOfflineUsers(floater, ids);
		LLFloaterChatterBox::showInstance(session_id);

		// Only warn for regular IMs - not group IMs
		if( dialog == IM_NOTHING_SPECIAL )
		{
			noteMutedUsers(floater, ids);
		}

		static LLCachedControl<bool> tear_off("OtherChatsTornOff");
		if(tear_off)
		{
			// removal sets up relationship for re-attach
			LLFloaterChatterBox::getInstance(LLSD())->removeFloater(floater);
			// reparent to floater view
			gFloaterView->addChild(floater);
			gFloaterView->bringToFront(floater);
		}
		else
			LLFloaterChatterBox::getInstance(LLSD())->showFloater(floater);
	}
	else
	{
		floater->open();
	}
	//mTabContainer->selectTabPanel(panel);
	if(gSavedSettings.getBOOL("PhoenixIMAnnounceStealFocus"))
	{	
		floater->setInputFocus(TRUE);
	}
	return floater->getSessionID();
}
// 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
// pointer.  Add the floater to this but do not select it.
LLFloaterIMPanel* LLIMMgr::createFloater(
	const LLUUID& session_id,
	const LLUUID& other_participant_id,
	const std::string& session_label,
	const EInstantMessage& dialog,
	const std::vector<LLUUID>& ids,
	bool user_initiated)
{
	if (session_id.isNull())
	{
		LL_WARNS() << "Creating LLFloaterIMPanel with null session ID" << LL_ENDL;
	}

	LL_INFOS() << "LLIMMgr::createFloater: from " << other_participant_id 
			<< " in session " << session_id << LL_ENDL;
	LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, session_id, other_participant_id, dialog, ids);
	LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END;
	LLFloaterChatterBox::getInstance(LLSD())->addFloater(floater, FALSE, i_pt);
	static LLCachedControl<bool> tear_off("OtherChatsTornOff");
	if (tear_off)
	{
		LLFloaterChatterBox::getInstance(LLSD())->removeFloater(floater); // removal sets up relationship for re-attach
		gFloaterView->addChild(floater); // reparent to floater view
		LLFloater* focused_floater = gFloaterView->getFocusedFloater(); // obtain the focused floater
		floater->open(); // make the new chat floater appear
		static LLCachedControl<bool> minimize("OtherChatsTornOffAndMinimized");
		if (focused_floater != NULL) // there was a focused floater
		{
			floater->setMinimized(minimize); // so minimize this one, for now, if desired
			focused_floater->setFocus(true); // and work around focus being removed by focusing on the last
		}
		else if (minimize)
		{
			floater->setFocus(false); // work around focus being granted to new floater
			floater->setMinimized(true);
		}
	}
	mFloaters.insert(floater->getHandle());
	return floater;
}
Beispiel #5
0
// This adds a session to the talk view. The name is the local name of
// the session, dialog specifies the type of session. If the session
// exists, it is brought forward.  Specifying id = NULL results in an
// im session to everyone. Returns the uuid of the session.
LLUUID LLIMMgr::addSession(
	const std::string& name,
	EInstantMessage dialog,
	const LLUUID& other_participant_id)
{
	//lggtodo
	LLUUID session_id = computeSessionID(dialog, other_participant_id);

	LLFloaterIMPanel* floater = findFloaterBySession(session_id);
	if(!floater)
	{
		LLDynamicArray<LLUUID> ids;
		ids.put(other_participant_id);

		floater = createFloater(
			session_id,
			other_participant_id,
			name,
			ids,
			dialog,
			TRUE);

		noteOfflineUsers(floater, ids);
		LLFloaterChatterBox::showInstance(session_id);

		// Only warn for regular IMs - not group IMs
		if( dialog == IM_NOTHING_SPECIAL )
		{
			noteMutedUsers(floater, ids);
		}
		LLFloaterChatterBox::getInstance(LLSD())->showFloater(floater);
	}
	else
	{
		floater->open();
	}
	//mTabContainer->selectTabPanel(panel);
	floater->setInputFocus(TRUE);
	return floater->getSessionID();
}