Ejemplo n.º 1
0
	void dns_requester::incoming_message(connection& aConnection, const message& aMessage)
	{
		if (aMessage.command() != message::NICK)
			return;
		user oldUser(aMessage.origin(), aConnection);
		user newUser(oldUser);
		if (!aMessage.parameters().empty())
			newUser.nick_name() = aMessage.parameters()[0];
		nick_change(oldUser.nick_name(), newUser.nick_name());
	}
Ejemplo n.º 2
0
	void dns_requester::whois_result(const message& aMessage)
	{
		if (aMessage.parameters().empty())
			return;

		switch(aMessage.command())
		{
		case message::RPL_WHOISUSER:
		case message::ERR_NOSUCHNICK:
			for (request_list::iterator i = iRequests.begin(); i != iRequests.end();)
			{
				if (irc::make_string(iConnection, i->first.nick_name()) == aMessage.parameters()[0])
				{
					if (aMessage.command() == message::RPL_WHOISUSER)
					{
						if (aMessage.parameters().size() >= 3)
						{
							i->first.user_name() = aMessage.parameters()[1];
							i->first.host_name() = aMessage.parameters()[2];
							iResolver.resolve(*this, i->first.host_name());
						}
						++i;
					}
					else
					{
						i->second->new_message(aMessage);
						iRequests.erase(i++);
					}
				}
				else
					++i;
			}
			break;
		default:
			break;
		}
	}