void	LLIMFloater::onClickCloseBtn()
{

	LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(
				mSessionID);

	if (session == NULL)
	{
		llwarns << "Empty session." << llendl;
		return;
	}

	bool is_call_with_chat = session->isGroupSessionType()
			|| session->isAdHocSessionType() || session->isP2PSessionType();

	LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionID);

	if (is_call_with_chat && voice_channel != NULL && voice_channel->isActive())
	{
		LLSD payload;
		payload["session_id"] = mSessionID;
		LLNotificationsUtil::add("ConfirmLeaveCall", LLSD(), payload, confirmLeaveCallCallback);
		return;
	}

	LLFloater::onClickCloseBtn();
}
Beispiel #2
0
void GrowlManager::onInstantMessage(const LLSD& im)
{
	LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(im["session_id"]);
	if(session->isP2PSessionType())
	{
		// Don't show messages from ourselves or the system.
		LLUUID from_id = im["from_id"];
		if(from_id == LLUUID::null || from_id == gAgentID)
			return;
		std::string message = im["message"];
		std::string prefix = message.substr(0, 4);
		if(prefix == "/me " || prefix == "/me'")
		{
			message = message.substr(3);
		}
		gGrowlManager->notify(im["from"], message, GROWL_IM_MESSAGE_TYPE);
	}
}