コード例 #1
0
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();
}
コード例 #2
0
ファイル: growlmanager.cpp プロジェクト: wish-ds/firestorm-ds
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);
	}
}