Ejemplo n.º 1
0
NickServ::Account *AccountType::FindAccount(const Anope::string &acc)
{
	Serialize::ID id;
	EventReturn result = EventManager::Get()->Dispatch(&Event::SerializeEvents::OnSerializeFind, this, &this->display, acc, id);
	if (result == EVENT_ALLOW)
		return RequireID(id);

	NickServ::nickcore_map &map = NickServ::service->GetAccountMap();
	auto it = map.find(acc);
	if (it != map.end())
		return it->second;
	return nullptr;
}
Ejemplo n.º 2
0
NickServ::Nick *NickType::FindNick(const Anope::string &n)
{
	Serialize::ID id;
	EventReturn result = EventManager::Get()->Dispatch(&Event::SerializeEvents::OnSerializeFind, this, &this->nick, n, id);
	if (result == EVENT_ALLOW)
		return RequireID(id);

	NickServ::nickalias_map &map = NickServ::service->GetNickMap();
	auto it = map.find(n);
	if (it != map.end())
		return it->second;
	return nullptr;
}
Ejemplo n.º 3
0
ChanServ::Channel *ChannelType::FindChannel(const Anope::string &chan)
{
	Serialize::ID id;
	EventReturn result = EventManager::Get()->Dispatch(&Event::SerializeEvents::OnSerializeFind, this, &this->name, chan, id);
	if (result == EVENT_ALLOW)
		return RequireID(id);

	// fall back
	ChanServ::registered_channel_map& map = ChanServ::service->GetChannels();
	auto it = map.find(chan);
	if (it != map.end())
		return it->second;
	return nullptr;
}