예제 #1
0
BOOL LLMuteList::autoRemove(const LLUUID& agent_id, const EAutoReason reason, const std::string& first_name, const std::string& last_name)
{
	BOOL removed = FALSE;

	if (isMuted(agent_id))
	{
		LLMute automute(agent_id, LLStringUtil::null, LLMute::AGENT);
		removed = TRUE;
		remove(automute);

		if (first_name.empty() && last_name.empty())
		{
			std::string cache_first, cache_last;
			if (gCacheName->getName(agent_id, cache_first, cache_last))
			{
				// name in cache, call callback directly
				notify_automute_callback(agent_id, cache_first, cache_last, FALSE, (void *)reason);
			}
			else
			{
				// not in cache, lookup name from cache
				gCacheName->get(agent_id, FALSE, notify_automute_callback, (void *)reason);
			}
		}
		else
		{
			// call callback directly
			notify_automute_callback(agent_id, first_name, last_name, FALSE, (void *)reason);
		}
	}

	return removed;
}
BOOL LLMuteList::autoRemove(const LLUUID& agent_id, const EAutoReason reason)
{
	BOOL removed = FALSE;

	if (isMuted(agent_id))
	{
		LLMute automute(agent_id, LLStringUtil::null, LLMute::AGENT);
		removed = TRUE;
		remove(automute);

		std::string full_name;
		if (gCacheName->getFullName(agent_id, full_name))
			{
				// name in cache, call callback directly
			notify_automute_callback(agent_id, full_name, false, reason);
			}
			else
			{
				// not in cache, lookup name from cache
			gCacheName->get(agent_id, false,
				boost::bind(&notify_automute_callback, _1, _2, _3, reason));
		}
	}

	return removed;
}