LLFloaterIMPanel* LLIMMgr::createFloater(
	const LLUUID& session_id,
	const LLUUID& other_participant_id,
	const std::string& session_label,
	const LLDynamicArray<LLUUID>& ids,
	EInstantMessage dialog,
	BOOL user_initiated)
{
	if (session_id.isNull())
	{
		llwarns << "Creating LLFloaterIMPanel with null session ID" << llendl;
	}

	llinfos << "LLIMMgr::createFloater: from " << other_participant_id 
			<< " in session " << session_id << llendl;
	LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label,
													 session_id,
													 other_participant_id,
													 ids,
													 dialog);
	LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END;
	LLFloaterChatterBox::getInstance(LLSD())->addFloater(floater, FALSE, i_pt);
	mFloaters.insert(floater->getHandle());
	return floater;
}
Esempio n. 2
0
// 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,
	EInstantMessage dialog,
	BOOL user_initiated)
{
	if (session_id.isNull())
	{
		llwarns << "Creating LLFloaterIMPanel with null session ID" << llendl;
	}
	if(glggIrcGroupHandler.trySendPrivateImToID("",other_participant_id,true))
    {
		dialog = IM_PRIVATE_IRC;
    }
	if(glggIrcGroupHandler.trySendPrivateImToID("",other_participant_id,true))
    {
		dialog = IM_PRIVATE_IRC;
    }

	llinfos << "LLIMMgr::createFloater: from " << other_participant_id 
			<< " in session " << session_id << llendl;
	LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label,
													 session_id,
													 other_participant_id,
													 dialog);
	LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END;
	LLFloaterChatterBox::getInstance(LLSD())->addFloater(floater, FALSE, i_pt);
	mFloaters.insert(floater->getHandle());
	return floater;
}
// This removes the panel referenced by the uuid, and then restores
// internal consistency. The internal pointer is not deleted.
void LLIMMgr::removeSession(const LLUUID& session_id)
{
	LLFloaterIMPanel* floater = findFloaterBySession(session_id);
	if(floater)
	{
		mFloaters.erase(floater->getHandle());
		LLFloaterChatterBox::getInstance(LLSD())->removeFloater(floater);
		//mTabContainer->removeTabPanel(floater);

		clearPendingInvitation(session_id);
		clearPendingAgentListUpdates(session_id);
	}
}
Esempio n. 4
0
// 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;
}