diff options
Diffstat (limited to 'kike.c')
-rw-r--r-- | kike.c | 161 |
1 files changed, 1 insertions, 160 deletions
@@ -22,6 +22,7 @@ #define PROGRAM_VERSION "alpha" #include "common.c" +#include "kike-replies.c" #include <nl_types.h> // --- Configuration (application-specific) ------------------------------------ @@ -861,166 +862,6 @@ client_set_ping_timer (struct client *c) // --- IRC command handling ---------------------------------------------------- -enum -{ - IRC_RPL_WELCOME = 1, - IRC_RPL_YOURHOST = 2, - IRC_RPL_CREATED = 3, - IRC_RPL_MYINFO = 4, - - IRC_RPL_UMODEIS = 221, - IRC_RPL_LUSERCLIENT = 251, - IRC_RPL_LUSEROP = 252, - IRC_RPL_LUSERUNKNOWN = 253, - IRC_RPL_LUSERCHANNELS = 254, - IRC_RPL_LUSERME = 255, - - IRC_RPL_AWAY = 301, - IRC_RPL_USERHOST = 302, - IRC_RPL_ISON = 303, - IRC_RPL_UNAWAY = 305, - IRC_RPL_NOWAWAY = 306, - IRC_RPL_WHOISUSER = 311, - IRC_RPL_WHOISSERVER = 312, - IRC_RPL_WHOISOPERATOR = 313, - IRC_RPL_ENDOFWHO = 315, - IRC_RPL_WHOISIDLE = 317, - IRC_RPL_ENDOFWHOIS = 318, - IRC_RPL_WHOISCHANNELS = 319, - IRC_RPL_LIST = 322, - IRC_RPL_LISTEND = 323, - IRC_RPL_CHANNELMODEIS = 324, - IRC_RPL_NOTOPIC = 331, - IRC_RPL_TOPIC = 332, - IRC_RPL_INVITELIST = 346, - IRC_RPL_ENDOFINVITELIST = 347, - IRC_RPL_EXCEPTLIST = 348, - IRC_RPL_ENDOFEXCEPTLIST = 349, - IRC_RPL_VERSION = 351, - IRC_RPL_WHOREPLY = 352, - IRC_RPL_NAMREPLY = 353, - IRC_RPL_ENDOFNAMES = 366, - IRC_RPL_BANLIST = 367, - IRC_RPL_ENDOFBANLIST = 368, - IRC_RPL_MOTD = 372, - IRC_RPL_MOTDSTART = 375, - IRC_RPL_ENDOFMOTD = 376, - IRC_RPL_TIME = 391, - - IRC_ERR_NOSUCHNICK = 401, - IRC_ERR_NOSUCHSERVER = 402, - IRC_ERR_NOSUCHCHANNEL = 403, - IRC_ERR_CANNOTSENDTOCHAN = 404, - IRC_ERR_NOORIGIN = 409, - IRC_ERR_NORECIPIENT = 411, - IRC_ERR_NOTEXTTOSEND = 412, - IRC_ERR_UNKNOWNCOMMAND = 421, - IRC_ERR_NOMOTD = 422, - IRC_ERR_NOADMININFO = 423, - IRC_ERR_NONICKNAMEGIVEN = 431, - IRC_ERR_ERRONEOUSNICKNAME = 432, - IRC_ERR_NICKNAMEINUSE = 433, - IRC_ERR_USERNOTINCHANNEL = 441, - IRC_ERR_NOTONCHANNEL = 442, - IRC_ERR_SUMMONDISABLED = 445, - IRC_ERR_USERSDISABLED = 446, - IRC_ERR_NOTREGISTERED = 451, - IRC_ERR_NEEDMOREPARAMS = 461, - IRC_ERR_ALREADYREGISTERED = 462, - IRC_ERR_KEYSET = 467, - IRC_ERR_CHANNELISFULL = 471, - IRC_ERR_UNKNOWNMODE = 472, - IRC_ERR_INVITEONLYCHAN = 473, - IRC_ERR_BANNEDFROMCHAN = 474, - IRC_ERR_BADCHANNELKEY = 475, - IRC_ERR_BADCHANMASK = 476, - IRC_ERR_NOPRIVILEGES = 481, - IRC_ERR_CHANOPRIVSNEEDED = 482, - - IRC_ERR_UMODEUNKNOWNFLAG = 501, - IRC_ERR_USERSDONTMATCH = 502 -}; - -static const char *g_default_replies[] = -{ - [IRC_RPL_WELCOME] = ":Welcome to the Internet Relay Network %s!%s@%s", - [IRC_RPL_YOURHOST] = ":Your host is %s, running version %s", - [IRC_RPL_CREATED] = ":This server was created %s", - [IRC_RPL_MYINFO] = "%s %s %s %s", - - [IRC_RPL_UMODEIS] = "+%s", - [IRC_RPL_LUSERCLIENT] = ":There are %d users and %d services on %d servers", - [IRC_RPL_LUSEROP] = "%d :operator(s) online", - [IRC_RPL_LUSERUNKNOWN] = "%d :unknown connection(s)", - [IRC_RPL_LUSERCHANNELS] = "%d :channels formed", - [IRC_RPL_LUSERME] = ":I have %d clients and %d servers", - - [IRC_RPL_AWAY] = "%s :%s", - [IRC_RPL_USERHOST] = ":%s", - [IRC_RPL_ISON] = ":%s", - [IRC_RPL_UNAWAY] = ":You are no longer marked as being away", - [IRC_RPL_NOWAWAY] = ":You have been marked as being away", - [IRC_RPL_WHOISUSER] = "%s %s %s * :%s", - [IRC_RPL_WHOISSERVER] = "%s %s :%s", - [IRC_RPL_WHOISOPERATOR] = "%s :is an IRC operator", - [IRC_RPL_ENDOFWHO] = "%s :End of WHO list", - [IRC_RPL_WHOISIDLE] = "%s %d :seconds idle", - [IRC_RPL_ENDOFWHOIS] = "%s :End of WHOIS list", - [IRC_RPL_WHOISCHANNELS] = "%s :%s", - [IRC_RPL_LIST] = "%s %d :%s", - [IRC_RPL_LISTEND] = ":End of LIST", - [IRC_RPL_CHANNELMODEIS] = "%s +%s", - [IRC_RPL_NOTOPIC] = "%s :No topic is set", - [IRC_RPL_TOPIC] = "%s :%s", - [IRC_RPL_INVITELIST] = "%s %s", - [IRC_RPL_ENDOFINVITELIST] = "%s :End of channel invite list", - [IRC_RPL_EXCEPTLIST] = "%s %s", - [IRC_RPL_ENDOFEXCEPTLIST] = "%s :End of channel exception list", - [IRC_RPL_VERSION] = "%s.%d %s :%s", - [IRC_RPL_WHOREPLY] = "%s %s %s %s %s %s :%d %s", - [IRC_RPL_NAMREPLY] = "%c %s :%s", - [IRC_RPL_ENDOFNAMES] = "%s :End of NAMES list", - [IRC_RPL_BANLIST] = "%s %s", - [IRC_RPL_ENDOFBANLIST] = "%s :End of channel ban list", - [IRC_RPL_MOTD] = ":- %s", - [IRC_RPL_MOTDSTART] = ":- %s Message of the day - ", - [IRC_RPL_ENDOFMOTD] = ":End of MOTD command", - [IRC_RPL_TIME] = "%s :%s", - - [IRC_ERR_NOSUCHNICK] = "%s :No such nick/channel", - [IRC_ERR_NOSUCHSERVER] = "%s :No such server", - [IRC_ERR_NOSUCHCHANNEL] = "%s :No such channel", - [IRC_ERR_CANNOTSENDTOCHAN] = "%s :Cannot send to channel", - [IRC_ERR_NOORIGIN] = ":No origin specified", - [IRC_ERR_NORECIPIENT] = ":No recipient given (%s)", - [IRC_ERR_NOTEXTTOSEND] = ":No text to send", - [IRC_ERR_UNKNOWNCOMMAND] = "%s: Unknown command", - [IRC_ERR_NOMOTD] = ":MOTD File is missing", - [IRC_ERR_NOADMININFO] = "%s :No administrative info available", - [IRC_ERR_NONICKNAMEGIVEN] = ":No nickname given", - [IRC_ERR_ERRONEOUSNICKNAME] = "%s :Erroneous nickname", - [IRC_ERR_NICKNAMEINUSE] = "%s :Nickname is already in use", - [IRC_ERR_USERNOTINCHANNEL] = "%s %s :They aren't on that channel", - [IRC_ERR_NOTONCHANNEL] = "%s :You're not on that channel", - [IRC_ERR_SUMMONDISABLED] = ":SUMMON has been disabled", - [IRC_ERR_USERSDISABLED] = ":USERS has been disabled", - [IRC_ERR_NOTREGISTERED] = ":You have not registered", - [IRC_ERR_NEEDMOREPARAMS] = "%s :Not enough parameters", - [IRC_ERR_ALREADYREGISTERED] = ":Unauthorized command (already registered)", - [IRC_ERR_KEYSET] = "%s :Channel key already set", - [IRC_ERR_CHANNELISFULL] = "%s :Cannot join channel (+l)", - [IRC_ERR_UNKNOWNMODE] = "%c :is unknown mode char to me for %s", - [IRC_ERR_INVITEONLYCHAN] = "%s :Cannot join channel (+i)", - [IRC_ERR_BANNEDFROMCHAN] = "%s :Cannot join channel (+b)", - [IRC_ERR_BADCHANNELKEY] = "%s :Cannot join channel (+k)", - [IRC_ERR_BADCHANMASK] = "%s :Bad Channel Mask", - [IRC_ERR_NOPRIVILEGES] = ":Permission Denied- You're not an IRC operator", - [IRC_ERR_CHANOPRIVSNEEDED] = "%s :You're not channel operator", - - [IRC_ERR_UMODEUNKNOWNFLAG] = ":Unknown MODE flag", - [IRC_ERR_USERSDONTMATCH] = ":Cannot change mode for other users", -}; - // XXX: this way we cannot typecheck the arguments, so we must be careful static void irc_send_reply (struct client *c, int id, ...) |