Esempio n. 1
0
void IRC::handleCTCP(IRCMessage& msg) {

	std::string lVerb = msg.getData().substr(1, msg.getData().length()-2);
	if(lVerb == "VERSION") {

		std::string lReply = "\001VERSION Goatsebot 2012 (rel 0001, probably f*****g your dad)\001";
		sendNotice(msg.getSource(), lReply);

	} else if (lVerb.find("PING ") == 0) {

		sendNotice(msg.getSource(), msg.getData());

	}


}
Esempio n. 2
0
void m_dccchat::onUserCTCP(std::string server, std::string nick, std::string message) {
	std::vector<std::string> messageParts = splitBySpace(message);
	if (messageParts[0] == "DCC" && messageParts[1] == "CHAT" && messageParts[2] == "chat") {
		if (activeConnections.find(server + "/" + nick) == activeConnections.end())
			dccConnect(server, nick, messageParts[3], messageParts[4]);
		else
			sendNotice(server, nick, "You already have an active DCC chat session!");
	}
}