diff options
Diffstat (limited to 'include')
87 files changed, 395 insertions, 395 deletions
diff --git a/include/base.h b/include/base.h index faea391a3..4f5cc2e3e 100644 --- a/include/base.h +++ b/include/base.h @@ -52,7 +52,7 @@ class CoreExport classbase virtual ~classbase() { } }; -/** class Extensible is the parent class of many classes such as userrec and chanrec. +/** class Extensible is the parent class of many classes such as User and Channel. * class Extensible implements a system which allows modules to 'extend' the class by attaching data within * a map associated with the object. In this way modules can store their own custom information within user * objects, channel objects and server objects, without breaking other modules (this is more sensible than using diff --git a/include/caller.h b/include/caller.h index b5dd38ef0..5cf08905a 100644 --- a/include/caller.h +++ b/include/caller.h @@ -21,10 +21,10 @@ * according to the number of parameters it takes, e.g. caller0, caller1, caller2. * These have been generated from zero parameters to eight. * - * If you want to declare a functor which takes two parameters, a userrec and a chanrec, + * If you want to declare a functor which takes two parameters, a User and a Channel, * and returns bool, simply create it like this: * - * caller2<bool, userrec*, chanrec*> MyFunction; + * caller2<bool, User*, Channel*> MyFunction; * * and initialize it correctly, when placed into a class you will be able to call it: * diff --git a/include/channels.h b/include/channels.h index b4fa1ca30..0f947ac22 100644 --- a/include/channels.h +++ b/include/channels.h @@ -35,8 +35,8 @@ enum ChannelModes { }; /* Forward declarations - needed */ -class userrec; -class chanrec; +class User; +class Channel; /** Holds an entry for a ban list, exemption list, or invite list. * This class contains a single element in a channel list, such as a banlist. @@ -70,7 +70,7 @@ typedef std::vector<BanItem> BanList; /** A list of users on a channel */ -typedef std::map<userrec*,std::string> CUList; +typedef std::map<User*,std::string> CUList; /** Shorthand for CUList::iterator */ @@ -106,13 +106,13 @@ typedef std::vector<prefixtype> pfxcontainer; /** A list of users with zero or more prefixes set on them */ -typedef std::map<userrec*, std::vector<prefixtype> > prefixlist; +typedef std::map<User*, std::vector<prefixtype> > prefixlist; /** Holds all relevent information for a channel. * This class represents a channel, and contains its name, modes, time created, topic, topic set time, * etc, and an instance of the BanList type. */ -class CoreExport chanrec : public Extensible +class CoreExport Channel : public Extensible { private: @@ -120,9 +120,9 @@ class CoreExport chanrec : public Extensible */ InspIRCd* ServerInstance; - /** Connect a chanrec to a userrec + /** Connect a Channel to a User */ - static chanrec* ForceChan(InspIRCd* Instance, chanrec* Ptr, userrec* user, const std::string &privs); + static Channel* ForceChan(InspIRCd* Instance, Channel* Ptr, User* user, const std::string &privs); /** Set default modes for the channel on creation */ @@ -194,7 +194,7 @@ class CoreExport chanrec : public Extensible time_t created; /** Time topic was set. - * If no topic was ever set, this will be equal to chanrec::created + * If no topic was ever set, this will be equal to Channel::created */ time_t topicset; @@ -264,67 +264,67 @@ class CoreExport chanrec : public Extensible * an arbitary pointer compared to other users by its memory address, * as this is a very fast 32 or 64 bit integer comparison. */ - void AddUser(userrec* user); + void AddUser(User* user); /** Add a user pointer to the internal reference list of opped users * @param user The user to add */ - void AddOppedUser(userrec* user); + void AddOppedUser(User* user); /** Add a user pointer to the internal reference list of halfopped users * @param user The user to add */ - void AddHalfoppedUser(userrec* user); + void AddHalfoppedUser(User* user); /** Add a user pointer to the internal reference list of voiced users * @param user The user to add */ - void AddVoicedUser(userrec* user); + void AddVoicedUser(User* user); /** Delete a user pointer to the internal reference list * @param user The user to delete * @return number of users left on the channel after deletion of the user */ - unsigned long DelUser(userrec* user); + unsigned long DelUser(User* user); /** Delete a user pointer to the internal reference list of opped users * @param user The user to delete */ - void DelOppedUser(userrec* user); + void DelOppedUser(User* user); /** Delete a user pointer to the internal reference list of halfopped users * @param user The user to delete */ - void DelHalfoppedUser(userrec* user); + void DelHalfoppedUser(User* user); /** Delete a user pointer to the internal reference list of voiced users * @param user The user to delete */ - void DelVoicedUser(userrec* user); + void DelVoicedUser(User* user); /** Obtain the internal reference list - * The internal reference list contains a list of userrec*. + * The internal reference list contains a list of User*. * These are used for rapid comparison to determine * channel membership for PRIVMSG, NOTICE, QUIT, PART etc. * The resulting pointer to the vector should be considered * readonly and only modified via AddUser and DelUser. * - * @return This function returns pointer to a map of userrec pointers (CUList*). + * @return This function returns pointer to a map of User pointers (CUList*). */ CUList* GetUsers(); /** Obtain the internal reference list of opped users - * @return This function returns pointer to a map of userrec pointers (CUList*). + * @return This function returns pointer to a map of User pointers (CUList*). */ CUList* GetOppedUsers(); /** Obtain the internal reference list of halfopped users - * @return This function returns pointer to a map of userrec pointers (CUList*). + * @return This function returns pointer to a map of User pointers (CUList*). */ CUList* GetHalfoppedUsers(); /** Obtain the internal reference list of voiced users - * @return This function returns pointer to a map of userrec pointers (CUList*). + * @return This function returns pointer to a map of User pointers (CUList*). */ CUList* GetVoicedUsers(); @@ -332,63 +332,63 @@ class CoreExport chanrec : public Extensible * @param The user to look for * @return True if the user is on this channel */ - bool HasUser(userrec* user); + bool HasUser(User* user); /** Creates a channel record and initialises it with default values * @throw Nothing at present. */ - chanrec(InspIRCd* Instance); + Channel(InspIRCd* Instance); /** Make src kick user from this channel with the given reason. * @param src The source of the kick * @param user The user being kicked (must be on this channel) * @param reason The reason for the kick * @return The number of users left on the channel. If this is zero - * when the method returns, you MUST delete the chanrec immediately! + * when the method returns, you MUST delete the Channel immediately! */ - long KickUser(userrec *src, userrec *user, const char* reason); + long KickUser(User *src, User *user, const char* reason); /** Make the server kick user from this channel with the given reason. * @param user The user being kicked (must be on this channel) * @param reason The reason for the kick * @param triggerevents True if you wish this kick to trigger module events * @return The number of users left on the channel. If this is zero - * when the method returns, you MUST delete the chanrec immediately! + * when the method returns, you MUST delete the Channel immediately! */ - long ServerKickUser(userrec* user, const char* reason, bool triggerevents); + long ServerKickUser(User* user, const char* reason, bool triggerevents); /** Part a user from this channel with the given reason. * If the reason field is NULL, no reason will be sent. * @param user The user who is parting (must be on this channel) * @param reason The (optional) part reason * @return The number of users left on the channel. If this is zero - * when the method returns, you MUST delete the chanrec immediately! + * when the method returns, you MUST delete the Channel immediately! */ - long PartUser(userrec *user, const char* reason = NULL); + long PartUser(User *user, const char* reason = NULL); /* Join a user to a channel. May be a channel that doesnt exist yet. * @param user The user to join to the channel. * @param cn The channel name to join to. Does not have to exist. * @param key The key of the channel, if given * @param override If true, override all join restrictions such as +bkil - * @return A pointer to the chanrec the user was joined to. A new chanrec may have + * @return A pointer to the Channel the user was joined to. A new Channel may have * been created if the channel did not exist before the user was joined to it. * If the user could not be joined to a channel, the return value may be NULL. */ - static chanrec* JoinUser(InspIRCd* ServerInstance, userrec *user, const char* cn, bool override, const char* key, time_t TS = 0); + static Channel* JoinUser(InspIRCd* ServerInstance, User *user, const char* cn, bool override, const char* key, time_t TS = 0); /** Write to a channel, from a user, using va_args for text * @param user User whos details to prefix the line with * @param text A printf-style format string which builds the output line without prefix * @param ... Zero or more POD types */ - void WriteChannel(userrec* user, char* text, ...); + void WriteChannel(User* user, char* text, ...); /** Write to a channel, from a user, using std::string for text * @param user User whos details to prefix the line with * @param text A std::string containing the output line without prefix */ - void WriteChannel(userrec* user, const std::string &text); + void WriteChannel(User* user, const std::string &text); /** Write to a channel, from a server, using va_args for text * @param ServName Server name to prefix the line with @@ -412,7 +412,7 @@ class CoreExport chanrec : public Extensible * @param text A printf-style format string which builds the output line without prefix * @param ... Zero or more POD type */ - void WriteAllExceptSender(userrec* user, bool serversource, char status, char* text, ...); + void WriteAllExceptSender(User* user, bool serversource, char status, char* text, ...); /** Write to all users on a channel except a list of users, using va_args for text * @param user User whos details to prefix the line with, and to omit from receipt of the message @@ -423,7 +423,7 @@ class CoreExport chanrec : public Extensible * @param text A printf-style format string which builds the output line without prefix * @param ... Zero or more POD type */ - void WriteAllExcept(userrec* user, bool serversource, char status, CUList &except_list, char* text, ...); + void WriteAllExcept(User* user, bool serversource, char status, CUList &except_list, char* text, ...); /** Write to all users on a channel except a specific user, using std::string for text. * Internally, this calls WriteAllExcept(). @@ -433,7 +433,7 @@ class CoreExport chanrec : public Extensible * @param status The status of the users to write to, e.g. '@' or '%'. Use a value of 0 to write to everyone * @param text A std::string containing the output line without prefix */ - void WriteAllExceptSender(userrec* user, bool serversource, char status, const std::string& text); + void WriteAllExceptSender(User* user, bool serversource, char status, const std::string& text); /** Write to all users on a channel except a list of users, using std::string for text * @param user User whos details to prefix the line with, and to omit from receipt of the message @@ -443,7 +443,7 @@ class CoreExport chanrec : public Extensible * @param except_list A list of users NOT to send the text to * @param text A std::string containing the output line without prefix */ - void WriteAllExcept(userrec* user, bool serversource, char status, CUList &except_list, const std::string& text); + void WriteAllExcept(User* user, bool serversource, char status, CUList &except_list, const std::string& text); /** Returns the maximum number of bans allowed to be set on this channel * @return The maximum number of bans allowed @@ -462,7 +462,7 @@ class CoreExport chanrec : public Extensible * @param ulist The user list to send, NULL to use the * channel's default names list of everyone */ - void UserList(userrec *user, CUList* ulist = NULL); + void UserList(User *user, CUList* ulist = NULL); /** Get the number of invisible users on this channel * @return Number of invisible users @@ -473,13 +473,13 @@ class CoreExport chanrec : public Extensible * @param user The user to look up * @return One of STATUS_OP, STATUS_HOP, STATUS_VOICE, or zero. */ - int GetStatus(userrec *user); + int GetStatus(User *user); /** Get a users status on this channel in a bitmask * @param user The user to look up * @return A bitmask containing zero or more of STATUS_OP, STATUS_HOP, STATUS_VOICE */ - int GetStatusFlags(userrec *user); + int GetStatusFlags(User *user); /** Get a users prefix on this channel in a string. * @param user The user to look up @@ -492,7 +492,7 @@ class CoreExport chanrec : public Extensible * character you can get, you can deal with it in a 'proprtional' manner * compared to known prefixes, using GetPrefixValue(). */ - const char* GetPrefixChar(userrec *user); + const char* GetPrefixChar(User *user); /** Return all of a users mode prefixes into a char* string. * @param user The user to look up @@ -500,7 +500,7 @@ class CoreExport chanrec : public Extensible * be in rank order, greatest first, as certain IRC clients require * this when multiple prefixes are used names lists. */ - const char* GetAllPrefixChars(userrec* user); + const char* GetAllPrefixChars(User* user); /** Get the value of a users prefix on this channel. * @param user The user to look up @@ -513,14 +513,14 @@ class CoreExport chanrec : public Extensible * is a prefix of greater 'worth' than ops, and a value less than * VOICE_VALUE is of lesser 'worth' than a voice. */ - unsigned int GetPrefixValue(userrec* user); + unsigned int GetPrefixValue(User* user); /** This method removes all prefix characters from a user. * It will not inform the user or the channel of the removal of prefixes, * and should be used when the user parts or quits. * @param user The user to remove all prefixes from */ - void RemoveAllPrefixes(userrec* user); + void RemoveAllPrefixes(User* user); /** Add a prefix character to a user. * Only the core should call this method, usually from @@ -531,21 +531,21 @@ class CoreExport chanrec : public Extensible * @param prefix_rank The rank (value) of this prefix character * @param adding True if adding the prefix, false when removing */ - void SetPrefix(userrec* user, char prefix, unsigned int prefix_rank, bool adding); + void SetPrefix(User* user, char prefix, unsigned int prefix_rank, bool adding); /** Check if a user is banned on this channel * @param user A user to check against the banlist * @returns True if the user given is banned */ - bool IsBanned(userrec* user); + bool IsBanned(User* user); /** Clears the cached max bans value */ void ResetMaxBans(); - /** Destructor for chanrec + /** Destructor for Channel */ - virtual ~chanrec() { /* stub */ } + virtual ~Channel() { /* stub */ } }; #endif diff --git a/include/command_parse.h b/include/command_parse.h index be3ea89ff..be18db4f9 100644 --- a/include/command_parse.h +++ b/include/command_parse.h @@ -54,7 +54,7 @@ class CoreExport CommandParser : public classbase * @param user The user to parse the command for * @param cmd The command string to process */ - void ProcessCommand(userrec *user, std::string &cmd); + void ProcessCommand(User *user, std::string &cmd); /** Finds the init_command symbol in a .so file * @param v A function pointer to be initialized @@ -93,7 +93,7 @@ class CoreExport CommandParser : public classbase * @return True if the command was reloaded, false if it could not be found * or another error occured */ - bool ReloadCommand(const char* cmd, userrec* user); + bool ReloadCommand(const char* cmd, User* user); /** Default constructor. * @param Instance The creator of this class @@ -111,7 +111,7 @@ class CoreExport CommandParser : public classbase * command simply did not exist at all or the wrong number of parameters were given, or the user * was not privilaged enough to execute the command. */ - CmdResult CallHandler(const std::string &commandname,const char** parameters, int pcnt, userrec *user); + CmdResult CallHandler(const std::string &commandname,const char** parameters, int pcnt, User *user); /** Get the handler function for a command. * @param commandname The command required. Always use uppercase for this parameter. @@ -127,7 +127,7 @@ class CoreExport CommandParser : public classbase * equal to or greater than the minimum number of parameters to the given command, then this * function will return true, otherwise it will return false. */ - bool IsValidCommand(const std::string &commandname, int pcnt, userrec * user); + bool IsValidCommand(const std::string &commandname, int pcnt, User * user); /** LoopCall is used to call a command classes handler repeatedly based on the contents of a comma seperated list. * There are two overriden versions of this method, one of which takes two potential lists and the other takes one. @@ -150,7 +150,7 @@ class CoreExport CommandParser : public classbase * @return This function will return 1 when there are no more parameters to process. When this occurs, its * caller should return without doing anything, otherwise it should continue into its main section of code. */ - int LoopCall(userrec* user, Command* CommandObj, const char** parameters, int pcnt, unsigned int splithere, unsigned int extra); + int LoopCall(User* user, Command* CommandObj, const char** parameters, int pcnt, unsigned int splithere, unsigned int extra); /** LoopCall is used to call a command classes handler repeatedly based on the contents of a comma seperated list. * There are two overriden versions of this method, one of which takes two potential lists and the other takes one. @@ -173,13 +173,13 @@ class CoreExport CommandParser : public classbase * @return This function will return 1 when there are no more parameters to process. When this occurs, its * caller should return without doing anything, otherwise it should continue into its main section of code. */ - int LoopCall(userrec* user, Command* CommandObj, const char** parameters, int pcnt, unsigned int splithere); + int LoopCall(User* user, Command* CommandObj, const char** parameters, int pcnt, unsigned int splithere); /** Take a raw input buffer from a recvq, and process it on behalf of a user. * @param buffer The buffer line to process * @param user The user to whom this line belongs */ - void ProcessBuffer(std::string &buffer,userrec *user); + void ProcessBuffer(std::string &buffer,User *user); /** Remove all commands relating to module 'source'. * @param source A module name which has introduced new commands @@ -201,7 +201,7 @@ class CoreExport CommandParser : public classbase * @param user User to spool errors to, or if NULL, when an error occurs spool the errors to * stdout then exit with EXIT_STATUS_HANDLER. */ - void SetupCommandTable(userrec* user); + void SetupCommandTable(User* user); /** Translate nicknames in a string into UIDs, based on the TranslationType given. * @param to The translation type to use for the process. @@ -223,7 +223,7 @@ class cmd_reload : public Command cmd_reload (InspIRCd* Instance) : Command(Instance,"RELOAD",'o',1) { syntax = "<core-command>"; } /** Handle RELOAD */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; /** A lookup table of values for multiplier characters used by diff --git a/include/commands/cmd_admin.h b/include/commands/cmd_admin.h index 049d230b0..8b85a3e95 100644 --- a/include/commands/cmd_admin.h +++ b/include/commands/cmd_admin.h @@ -34,7 +34,7 @@ class cmd_admin : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_away.h b/include/commands/cmd_away.h index 269c548aa..29255d936 100644 --- a/include/commands/cmd_away.h +++ b/include/commands/cmd_away.h @@ -36,7 +36,7 @@ class cmd_away : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_clearcache.h b/include/commands/cmd_clearcache.h index b89029a30..0af086609 100644 --- a/include/commands/cmd_clearcache.h +++ b/include/commands/cmd_clearcache.h @@ -35,7 +35,7 @@ class cmd_clearcache : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_commands.h b/include/commands/cmd_commands.h index a796d4ebd..03a6c08ba 100644 --- a/include/commands/cmd_commands.h +++ b/include/commands/cmd_commands.h @@ -36,7 +36,7 @@ class cmd_commands : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_connect.h b/include/commands/cmd_connect.h index b621cab77..97096acb6 100644 --- a/include/commands/cmd_connect.h +++ b/include/commands/cmd_connect.h @@ -36,7 +36,7 @@ class cmd_connect : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_die.h b/include/commands/cmd_die.h index cae2637e9..2eb9f7a6d 100644 --- a/include/commands/cmd_die.h +++ b/include/commands/cmd_die.h @@ -36,7 +36,7 @@ class cmd_die : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_eline.h b/include/commands/cmd_eline.h index 36b22ce79..25c403be4 100644 --- a/include/commands/cmd_eline.h +++ b/include/commands/cmd_eline.h @@ -36,7 +36,7 @@ class cmd_eline : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_gline.h b/include/commands/cmd_gline.h index caf703009..3a398995f 100644 --- a/include/commands/cmd_gline.h +++ b/include/commands/cmd_gline.h @@ -36,7 +36,7 @@ class cmd_gline : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_info.h b/include/commands/cmd_info.h index c84a03adf..578a83217 100644 --- a/include/commands/cmd_info.h +++ b/include/commands/cmd_info.h @@ -36,7 +36,7 @@ class cmd_info : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_invite.h b/include/commands/cmd_invite.h index 95391e829..ad78869b2 100644 --- a/include/commands/cmd_invite.h +++ b/include/commands/cmd_invite.h @@ -36,7 +36,7 @@ class cmd_invite : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_ison.h b/include/commands/cmd_ison.h index 3b914d62e..e0ac4cc93 100644 --- a/include/commands/cmd_ison.h +++ b/include/commands/cmd_ison.h @@ -36,7 +36,7 @@ class cmd_ison : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_join.h b/include/commands/cmd_join.h index cf678e4ea..6889b71fe 100644 --- a/include/commands/cmd_join.h +++ b/include/commands/cmd_join.h @@ -36,7 +36,7 @@ class cmd_join : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_kick.h b/include/commands/cmd_kick.h index 3a58d4203..769ab316e 100644 --- a/include/commands/cmd_kick.h +++ b/include/commands/cmd_kick.h @@ -36,7 +36,7 @@ class cmd_kick : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_kill.h b/include/commands/cmd_kill.h index 1e1835f00..1f80cded9 100644 --- a/include/commands/cmd_kill.h +++ b/include/commands/cmd_kill.h @@ -36,7 +36,7 @@ class cmd_kill : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_kline.h b/include/commands/cmd_kline.h index edaa8a8bc..897c5402f 100644 --- a/include/commands/cmd_kline.h +++ b/include/commands/cmd_kline.h @@ -36,7 +36,7 @@ class cmd_kline : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_links.h b/include/commands/cmd_links.h index 74b616401..6c5d521f1 100644 --- a/include/commands/cmd_links.h +++ b/include/commands/cmd_links.h @@ -36,7 +36,7 @@ class cmd_links : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_list.h b/include/commands/cmd_list.h index f99111fa0..fabe50fca 100644 --- a/include/commands/cmd_list.h +++ b/include/commands/cmd_list.h @@ -36,7 +36,7 @@ class cmd_list : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_loadmodule.h b/include/commands/cmd_loadmodule.h index 4288eb4c6..4e640b938 100644 --- a/include/commands/cmd_loadmodule.h +++ b/include/commands/cmd_loadmodule.h @@ -36,7 +36,7 @@ class cmd_loadmodule : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_lusers.h b/include/commands/cmd_lusers.h index 76ebf5674..d4bebca18 100644 --- a/include/commands/cmd_lusers.h +++ b/include/commands/cmd_lusers.h @@ -36,7 +36,7 @@ class cmd_lusers : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_map.h b/include/commands/cmd_map.h index 1ae324309..e3f546d7b 100644 --- a/include/commands/cmd_map.h +++ b/include/commands/cmd_map.h @@ -36,7 +36,7 @@ class cmd_map : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_mode.h b/include/commands/cmd_mode.h index 9231f2c61..ddaeb69fb 100644 --- a/include/commands/cmd_mode.h +++ b/include/commands/cmd_mode.h @@ -35,7 +35,7 @@ class cmd_mode : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_modules.h b/include/commands/cmd_modules.h index 73a6074d1..5dd3fab2b 100644 --- a/include/commands/cmd_modules.h +++ b/include/commands/cmd_modules.h @@ -36,7 +36,7 @@ class cmd_modules : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_motd.h b/include/commands/cmd_motd.h index e6f5092b2..c79d22efb 100644 --- a/include/commands/cmd_motd.h +++ b/include/commands/cmd_motd.h @@ -39,7 +39,7 @@ class cmd_motd : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_names.h b/include/commands/cmd_names.h index b65fdeda8..82c25f569 100644 --- a/include/commands/cmd_names.h +++ b/include/commands/cmd_names.h @@ -36,7 +36,7 @@ class cmd_names : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_nick.h b/include/commands/cmd_nick.h index 849b59c22..f02522e9b 100644 --- a/include/commands/cmd_nick.h +++ b/include/commands/cmd_nick.h @@ -37,7 +37,7 @@ class cmd_nick : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); /** Handle internal command * @param id Used to indicate if invalid nick changes are allowed. diff --git a/include/commands/cmd_notice.h b/include/commands/cmd_notice.h index 20c34b6bf..377aa4aba 100644 --- a/include/commands/cmd_notice.h +++ b/include/commands/cmd_notice.h @@ -36,7 +36,7 @@ class cmd_notice : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_oper.h b/include/commands/cmd_oper.h index 17d71dbe3..581cfea16 100644 --- a/include/commands/cmd_oper.h +++ b/include/commands/cmd_oper.h @@ -38,7 +38,7 @@ class cmd_oper : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_part.h b/include/commands/cmd_part.h index c419fb798..0965a5031 100644 --- a/include/commands/cmd_part.h +++ b/include/commands/cmd_part.h @@ -36,7 +36,7 @@ class cmd_part : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_pass.h b/include/commands/cmd_pass.h index 0edd17a97..26e360923 100644 --- a/include/commands/cmd_pass.h +++ b/include/commands/cmd_pass.h @@ -39,7 +39,7 @@ class cmd_pass : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_ping.h b/include/commands/cmd_ping.h index 6e856fa3a..326342e7b 100644 --- a/include/commands/cmd_ping.h +++ b/include/commands/cmd_ping.h @@ -36,7 +36,7 @@ class cmd_ping : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_pong.h b/include/commands/cmd_pong.h index f050a4ee8..91b87bfb0 100644 --- a/include/commands/cmd_pong.h +++ b/include/commands/cmd_pong.h @@ -37,7 +37,7 @@ class cmd_pong : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_privmsg.h b/include/commands/cmd_privmsg.h index 604093851..12f1c0756 100644 --- a/include/commands/cmd_privmsg.h +++ b/include/commands/cmd_privmsg.h @@ -36,7 +36,7 @@ class cmd_privmsg : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_qline.h b/include/commands/cmd_qline.h index fb9e88048..7ea7643f1 100644 --- a/include/commands/cmd_qline.h +++ b/include/commands/cmd_qline.h @@ -36,7 +36,7 @@ class cmd_qline : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_quit.h b/include/commands/cmd_quit.h index 06c564ac0..23da5481c 100644 --- a/include/commands/cmd_quit.h +++ b/include/commands/cmd_quit.h @@ -36,7 +36,7 @@ class cmd_quit : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_rehash.h b/include/commands/cmd_rehash.h index 684ffee9c..401247972 100644 --- a/include/commands/cmd_rehash.h +++ b/include/commands/cmd_rehash.h @@ -36,7 +36,7 @@ class cmd_rehash : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_reloadmodule.h b/include/commands/cmd_reloadmodule.h index 672816289..cdf053062 100644 --- a/include/commands/cmd_reloadmodule.h +++ b/include/commands/cmd_reloadmodule.h @@ -36,7 +36,7 @@ class cmd_reloadmodule : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_restart.h b/include/commands/cmd_restart.h index 0834bf61b..f85a00a82 100644 --- a/include/commands/cmd_restart.h +++ b/include/commands/cmd_restart.h @@ -39,7 +39,7 @@ class cmd_restart : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_rules.h b/include/commands/cmd_rules.h index 5313dae32..adfab7e17 100644 --- a/include/commands/cmd_rules.h +++ b/include/commands/cmd_rules.h @@ -39,7 +39,7 @@ class cmd_rules : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_server.h b/include/commands/cmd_server.h index e3383e5c7..2b25e406d 100644 --- a/include/commands/cmd_server.h +++ b/include/commands/cmd_server.h @@ -36,7 +36,7 @@ class cmd_server : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_squit.h b/include/commands/cmd_squit.h index faef49dff..f1270ef4c 100644 --- a/include/commands/cmd_squit.h +++ b/include/commands/cmd_squit.h @@ -39,7 +39,7 @@ class cmd_squit : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_stats.h b/include/commands/cmd_stats.h index 2931a27e0..69e151135 100644 --- a/include/commands/cmd_stats.h +++ b/include/commands/cmd_stats.h @@ -20,7 +20,7 @@ #include "users.h" #include "channels.h" -DllExport void DoStats(InspIRCd* Instance, char statschar, userrec* user, string_list &results); +DllExport void DoStats(InspIRCd* Instance, char statschar, User* user, string_list &results); /** Handle /STATS. These command handlers can be reloaded by the core, * and handle basic RFC1459 commands. Commands within modules work @@ -39,7 +39,7 @@ class cmd_stats : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_time.h b/include/commands/cmd_time.h index 24423c46e..b6d353c89 100644 --- a/include/commands/cmd_time.h +++ b/include/commands/cmd_time.h @@ -36,7 +36,7 @@ class cmd_time : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_topic.h b/include/commands/cmd_topic.h index 0e75df750..3375c1641 100644 --- a/include/commands/cmd_topic.h +++ b/include/commands/cmd_topic.h @@ -36,7 +36,7 @@ class cmd_topic : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_trace.h b/include/commands/cmd_trace.h index 6f5aecf00..1f551f1eb 100644 --- a/include/commands/cmd_trace.h +++ b/include/commands/cmd_trace.h @@ -36,7 +36,7 @@ class cmd_trace : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_unloadmodule.h b/include/commands/cmd_unloadmodule.h index 962c7dcb6..2afd84168 100644 --- a/include/commands/cmd_unloadmodule.h +++ b/include/commands/cmd_unloadmodule.h @@ -36,7 +36,7 @@ class cmd_unloadmodule : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_user.h b/include/commands/cmd_user.h index dc4e0e3aa..186269d9a 100644 --- a/include/commands/cmd_user.h +++ b/include/commands/cmd_user.h @@ -36,7 +36,7 @@ class cmd_user : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_userhost.h b/include/commands/cmd_userhost.h index bd19219de..65b358e47 100644 --- a/include/commands/cmd_userhost.h +++ b/include/commands/cmd_userhost.h @@ -36,7 +36,7 @@ class cmd_userhost : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_version.h b/include/commands/cmd_version.h index 2163bc1cf..a70e033df 100644 --- a/include/commands/cmd_version.h +++ b/include/commands/cmd_version.h @@ -36,7 +36,7 @@ class cmd_version : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_wallops.h b/include/commands/cmd_wallops.h index 6c09989fe..c4ab9973f 100644 --- a/include/commands/cmd_wallops.h +++ b/include/commands/cmd_wallops.h @@ -36,7 +36,7 @@ class cmd_wallops : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_who.h b/include/commands/cmd_who.h index f89137c0a..7d1bab933 100644 --- a/include/commands/cmd_who.h +++ b/include/commands/cmd_who.h @@ -26,7 +26,7 @@ */ class cmd_who : public Command { - bool CanView(chanrec* chan, userrec* user); + bool CanView(Channel* chan, User* user); bool opt_viewopersonly; bool opt_showrealhost; bool opt_unlimit; @@ -42,15 +42,15 @@ class cmd_who : public Command /** Constructor for who. */ cmd_who (InspIRCd* Instance) : Command(Instance,"WHO",0,1) { syntax = "<server>|<nickname>|<channel>|<realname>|<host>|0 [ohurmMiaplf]"; } - void SendWhoLine(userrec* user, const std::string &initial, chanrec* ch, userrec* u, std::vector<std::string> &whoresults); + void SendWhoLine(User* user, const std::string &initial, Channel* ch, User* u, std::vector<std::string> &whoresults); /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); - bool whomatch(userrec* user, const char* matchtext); + CmdResult Handle(const char** parameters, int pcnt, User *user); + bool whomatch(User* user, const char* matchtext); }; #endif diff --git a/include/commands/cmd_whois.h b/include/commands/cmd_whois.h index 6aec85e0a..b83fe8e5f 100644 --- a/include/commands/cmd_whois.h +++ b/include/commands/cmd_whois.h @@ -20,7 +20,7 @@ #include "channels.h" const char* Spacify(char* n); -DllExport void do_whois(InspIRCd* Instance, userrec* user, userrec* dest,unsigned long signon, unsigned long idle, const char* nick); +DllExport void do_whois(InspIRCd* Instance, User* user, User* dest,unsigned long signon, unsigned long idle, const char* nick); /** Handle /WHOIS. These command handlers can be reloaded by the core, * and handle basic RFC1459 commands. Commands within modules work @@ -39,7 +39,7 @@ class cmd_whois : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/commands/cmd_whowas.h b/include/commands/cmd_whowas.h index 50f5ffd0f..c8f367116 100644 --- a/include/commands/cmd_whowas.h +++ b/include/commands/cmd_whowas.h @@ -79,7 +79,7 @@ class cmd_whowas : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); /** Handle an internal request from another command, the core, or a module * @param Command ID * @param Zero or more parameters, whos form is specified by the command ID. @@ -88,7 +88,7 @@ class cmd_whowas : public Command * return CMD_LOCALONLY. */ CmdResult HandleInternal(const unsigned int id, const std::deque<classbase*> ¶meters); - void AddToWhoWas(userrec* user); + void AddToWhoWas(User* user); void GetStats(Extensible* ext); void PruneWhoWas(time_t t); void MaintainWhoWas(time_t t); @@ -121,7 +121,7 @@ class WhoWasGroup : public classbase /** Initialize this WhoQasFroup with a user */ - WhoWasGroup(userrec* user); + WhoWasGroup(User* user); /** Destructor */ ~WhoWasGroup(); diff --git a/include/commands/cmd_zline.h b/include/commands/cmd_zline.h index 114de31b1..e3ad7b727 100644 --- a/include/commands/cmd_zline.h +++ b/include/commands/cmd_zline.h @@ -36,7 +36,7 @@ class cmd_zline : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const char** parameters, int pcnt, userrec *user); + CmdResult Handle(const char** parameters, int pcnt, User *user); }; #endif diff --git a/include/configreader.h b/include/configreader.h index 8b031012d..86441d344 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -235,7 +235,7 @@ class CoreExport ServerConfig : public Extensible /** Check that there is only one of each configuration item */ - bool CheckOnce(char* tag, bool bail, userrec* user); + bool CheckOnce(char* tag, bool bail, User* user); public: @@ -628,13 +628,13 @@ class CoreExport ServerConfig : public Extensible /** Send the 005 numerics (ISUPPORT) to a user */ - void Send005(userrec* user); + void Send005(User* user); /** Read the entire configuration into memory * and initialize this class. All other methods * should be used only by the core. */ - void Read(bool bail, userrec* user); + void Read(bool bail, User* user); /** Read a file into a file_cache object */ @@ -646,7 +646,7 @@ class CoreExport ServerConfig : public Extensible * this user as SNOTICEs. * If the parameter is NULL, the messages are spooled to all users via WriteOpers as SNOTICEs. */ - void ReportConfigError(const std::string &errormessage, bool bail, userrec* user); + void ReportConfigError(const std::string &errormessage, bool bail, User* user); /** Load 'filename' into 'target', with the new config parser everything is parsed into * tag/key/value at load-time rather than at read-value time. diff --git a/include/connection.h b/include/connection.h index 65d342447..f476c39a5 100644 --- a/include/connection.h +++ b/include/connection.h @@ -19,7 +19,7 @@ #include "base.h" #include "socketengine.h" -/** connection is the base class of userrec, and holds basic user properties. +/** connection is the base class of User, and holds basic user properties. * This can be extended for holding other user-like objects in the future. */ class CoreExport connection : public EventHandler @@ -50,7 +50,7 @@ class CoreExport connection : public EventHandler */ bool haspassed; - /** Used by userrec to indicate the registration status of the connection + /** Used by User to indicate the registration status of the connection * It is a bitfield of the REG_NICK, REG_USER and REG_ALL bits to indicate * the connection state. */ diff --git a/include/ctables.h b/include/ctables.h index abfc740da..0c2802baa 100644 --- a/include/ctables.h +++ b/include/ctables.h @@ -20,7 +20,7 @@ #include "base.h" /* Forward declarations - required */ -class userrec; +class User; class InspIRCd; /** Used to indicate command success codes @@ -119,7 +119,7 @@ class CoreExport Command : public Extensible * If the command succeeds but should remain local to this server, * return CMD_LOCALONLY. */ - virtual CmdResult Handle(const char** parameters, int pcnt, userrec* user) = 0; + virtual CmdResult Handle(const char** parameters, int pcnt, User* user) = 0; /** Handle an internal request from another command, the core, or a module * @param Command ID diff --git a/include/cull_list.h b/include/cull_list.h index 129f0d43d..c5daab5dd 100644 --- a/include/cull_list.h +++ b/include/cull_list.h @@ -35,7 +35,7 @@ class CoreExport CullItem : public classbase /** Holds a pointer to the user, * must be valid and can be a local or remote user. */ - userrec* user; + User* user; /** Holds the quit reason to use for this user. */ std::string reason; @@ -53,7 +53,7 @@ class CoreExport CullItem : public classbase * @param r The quit reason of the added user * @param ro The quit reason to show to opers only */ - CullItem(userrec* u, std::string &r, const char* ro = ""); + CullItem(User* u, std::string &r, const char* ro = ""); /** Constrcutor. * Initializes the CullItem with a user pointer * and their quit reason @@ -61,7 +61,7 @@ class CoreExport CullItem : public classbase * @param r The quit reason of the added user * @param ro The quit reason to show to opers only */ - CullItem(userrec* u, const char* r, const char* ro = ""); + CullItem(User* u, const char* r, const char* ro = ""); /** Make the quit silent a module is dealing with * displaying this users quit, so we shouldn't @@ -80,7 +80,7 @@ class CoreExport CullItem : public classbase /** Returns a pointer to the user */ - userrec* GetUser(); + User* GetUser(); /** Returns the user's quit reason */ std::string& GetReason(); @@ -111,7 +111,7 @@ class CoreExport CullList : public classbase /** Holds a list of users already added for quick lookup */ - std::map<userrec*, userrec*> exempt; + std::map<User*, User*> exempt; /** Holds a list of users being quit. * See the information for CullItem for @@ -133,7 +133,7 @@ class CoreExport CullList : public classbase * @param reason The quit reason of the user being added * @param o_reason The quit reason to show only to opers */ - void AddItem(userrec* user, std::string &reason, const char* o_reason = ""); + void AddItem(User* user, std::string &reason, const char* o_reason = ""); /** Adds a user to the cull list for later * removal via QUIT. @@ -141,11 +141,11 @@ class CoreExport CullList : public classbase * @param reason The quit reason of the user being added * @param o_reason The quit reason to show only to opers */ - void AddItem(userrec* user, const char* reason, const char* o_reason = ""); + void AddItem(User* user, const char* reason, const char* o_reason = ""); /* Turn an item into a silent item (don't send out QUIT for this user) */ - void MakeSilent(userrec* user); + void MakeSilent(User* user); /** Applies the cull list, quitting all the users * on the list with their quit reasons all at once. diff --git a/include/hashcomp.h b/include/hashcomp.h index 033003f71..78792d1ab 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -438,8 +438,8 @@ namespace irc * To use this class, you must derive from it. * This is because each derived instance has its own freebits array * which can determine what bitfields are allocated on a TYPE BY TYPE - * basis, e.g. an irc::dynamicbitmask type for userrecs, and one for - * chanrecs, etc. You should inheret it in a very simple way as follows. + * basis, e.g. an irc::dynamicbitmask type for Users, and one for + * Channels, etc. You should inheret it in a very simple way as follows. * The base class will resize and maintain freebits as required, you are * just required to make the pointer static and specific to this class * type. diff --git a/include/inspircd.h b/include/inspircd.h index 7aa5a5ec3..afa4db7f4 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -231,11 +231,11 @@ typedef std::map<irc::string, unsigned int> clonemap; class InspIRCd; -DEFINE_HANDLER1(ProcessUserHandler, void, userrec*); +DEFINE_HANDLER1(ProcessUserHandler, void, User*); DEFINE_HANDLER1(IsNickHandler, bool, const char*); DEFINE_HANDLER1(IsIdentHandler, bool, const char*); -DEFINE_HANDLER1(FindDescriptorHandler, userrec*, int); -DEFINE_HANDLER1(FloodQuitUserHandler, void, userrec*); +DEFINE_HANDLER1(FindDescriptorHandler, User*, int); +DEFINE_HANDLER1(FloodQuitUserHandler, void, User*); /* Forward declaration - required */ class XLineManager; @@ -287,7 +287,7 @@ class CoreExport InspIRCd : public classbase * @param user The user to verify * @return True if all modules have finished checking this user */ - bool AllModulesReportReady(userrec* user); + bool AllModulesReportReady(User* user); /** Logfile pathname specified on the commandline, or empty string */ @@ -348,12 +348,12 @@ class CoreExport InspIRCd : public classbase /** Globally accessible fake user record. This is used to force mode changes etc across s2s, etc.. bit ugly, but.. better than how this was done in 1.1 * Reason for it: * kludge alert! - * SendMode expects a userrec* to send the numeric replies + * SendMode expects a User* to send the numeric replies * back to, so we create it a fake user that isnt in the user * hash and set its descriptor to FD_MAGIC_NUMBER so the data * falls into the abyss :p */ - userrec *FakeClient; + User *FakeClient; /** Returns the next available UID for this server. */ @@ -363,13 +363,13 @@ class CoreExport InspIRCd : public classbase * @param nick The nickname to find * @return A pointer to the user, or NULL if the user does not exist */ - userrec *FindUUID(const std::string &); + User *FindUUID(const std::string &); /** Find a user in the UUID hash * @param nick The nickname to find * @return A pointer to the user, or NULL if the user does not exist */ - userrec *FindUUID(const char *); + User *FindUUID(const char *); /** Build the ISUPPORT string by triggering all modules On005Numeric events */ @@ -427,7 +427,7 @@ class CoreExport InspIRCd : public classbase user_hash* clientlist; /** Client list stored by UUID. Contains all clients, and is updated - * automatically by the constructor and destructor of userrec. + * automatically by the constructor and destructor of User. */ user_hash* uuidlist; @@ -437,11 +437,11 @@ class CoreExport InspIRCd : public classbase /** Local client list, a vector containing only local clients */ - std::vector<userrec*> local_users; + std::vector<User*> local_users; /** Oper list, a vector containing all local and remote opered users */ - std::list<userrec*> all_opers; + std::list<User*> all_opers; /** Map of local ip addresses for clone counting */ @@ -490,12 +490,12 @@ class CoreExport InspIRCd : public classbase /** Add a user to the local clone map * @param user The user to add */ - void AddLocalClone(userrec* user); + void AddLocalClone(User* user); /** Add a user to the global clone map * @param user The user to add */ - void AddGlobalClone(userrec* user); + void AddGlobalClone(User* user); /** Number of users with a certain mode set on them */ @@ -511,7 +511,7 @@ class CoreExport InspIRCd : public classbase * @return There is no actual return value, however upon exit, the user 'cu' may have been * marked for deletion in the global CullList. */ - caller1<void, userrec*> ProcessUser; + caller1<void, User*> ProcessUser; /** Bind all ports specified in the configuration file. * @param bail True if the function should bail back to the shell on failure @@ -534,7 +534,7 @@ class CoreExport InspIRCd : public classbase void AddServerName(const std::string &servername); /** Finds a cached char* pointer of a server name, - * This is used to optimize userrec by storing only the pointer to the name + * This is used to optimize User by storing only the pointer to the name * @param The servername to find * @return A pointer to this name, gauranteed to never become invalid */ @@ -571,34 +571,34 @@ class CoreExport InspIRCd : public classbase * @param nick The nickname to find * @return A pointer to the user, or NULL if the user does not exist */ - userrec* FindNick(const std::string &nick); + User* FindNick(const std::string &nick); /** Find a user in the nick hash. * If the user cant be found in the nick hash check the uuid hash * @param nick The nickname to find * @return A pointer to the user, or NULL if the user does not exist */ - userrec* FindNick(const char* nick); + User* FindNick(const char* nick); /** Find a user in the nick hash ONLY */ - userrec* FindNickOnly(const char* nick); + User* FindNickOnly(const char* nick); /** Find a user in the nick hash ONLY */ - userrec* FindNickOnly(const std::string &nick); + User* FindNickOnly(const std::string &nick); /** Find a channel in the channels hash * @param chan The channel to find * @return A pointer to the channel, or NULL if the channel does not exist */ - chanrec* FindChan(const std::string &chan); + Channel* FindChan(const std::string &chan); /** Find a channel in the channels hash * @param chan The channel to find * @return A pointer to the channel, or NULL if the channel does not exist */ - chanrec* FindChan(const char* chan); + Channel* FindChan(const char* chan); /** Check for a 'die' tag in the config file, and abort if found * @return Depending on the configuration, this function may never return @@ -733,7 +733,7 @@ class CoreExport InspIRCd : public classbase * @param socket The file descriptor of a user * @return A pointer to the user if the user exists locally on this descriptor */ - caller1<userrec*, int> FindDescriptor; + caller1<User*, int> FindDescriptor; /** Add a new mode to this server's mode parser * @param mh The modehandler to add @@ -785,7 +785,7 @@ class CoreExport InspIRCd : public classbase * @param pcnt The number of items you have given in the first parameter * @param user The user to send error messages to */ - void SendMode(const char **parameters, int pcnt, userrec *user); + void SendMode(const char **parameters, int pcnt, User *user); /** Match two strings using pattern matching. * This operates identically to the global function match(), @@ -803,7 +803,7 @@ class CoreExport InspIRCd : public classbase * @param user The user to execute the command as * @return True if the command handler was called successfully */ - CmdResult CallCommandHandler(const std::string &commandname, const char** parameters, int pcnt, userrec* user); + CmdResult CallCommandHandler(const std::string &commandname, const char** parameters, int pcnt, User* user); /** Return true if the command is a module-implemented command and the given parameters are valid for it * @param parameters The mode parameters @@ -811,7 +811,7 @@ class CoreExport InspIRCd : public classbase * @param user The user to test-execute the command as * @return True if the command handler is a module command, and there are enough parameters and the user has permission to the command */ - bool IsValidModuleCommand(const std::string &commandname, int pcnt, userrec* user); + bool IsValidModuleCommand(const std::string &commandname, int pcnt, User* user); /** Add a gline and apply it * @param duration How long the line should last @@ -897,35 +897,35 @@ class CoreExport InspIRCd : public classbase * @param The index number of the channel to fetch * @return A channel record, or NUll if index < 0 or index >= InspIRCd::ChannelCount() */ - chanrec* GetChannelIndex(long index); + Channel* GetChannelIndex(long index); /** Dump text to a user target, splitting it appropriately to fit * @param User the user to dump the text to * @param LinePrefix text to prefix each complete line with * @param TextStream the text to send to the user */ - void DumpText(userrec* User, const std::string &LinePrefix, stringstream &TextStream); + void DumpText(User* User, const std::string &LinePrefix, stringstream &TextStream); /** Check if the given nickmask matches too many users, send errors to the given user * @param nick A nickmask to match against * @param user A user to send error text to * @return True if the nick matches too many users */ - bool NickMatchesEveryone(const std::string &nick, userrec* user); + bool NickMatchesEveryone(const std::string &nick, User* user); /** Check if the given IP mask matches too many users, send errors to the given user * @param ip An ipmask to match against * @param user A user to send error text to * @return True if the ip matches too many users */ - bool IPMatchesEveryone(const std::string &ip, userrec* user); + bool IPMatchesEveryone(const std::string &ip, User* user); /** Check if the given hostmask matches too many users, send errors to the given user * @param mask A hostmask to match against * @param user A user to send error text to * @return True if the host matches too many users */ - bool HostMatchesEveryone(const std::string &mask, userrec* user); + bool HostMatchesEveryone(const std::string &mask, User* user); /** Calculate a duration in seconds from a string in the form 1y2w3d4h6m5s * @param str A string containing a time in the form 1y2w3d4h6m5s @@ -1004,7 +1004,7 @@ class CoreExport InspIRCd : public classbase * @param numeric Numeric to send * @param text Text of the numeric */ - void SendWhoisLine(userrec* user, userrec* dest, int numeric, const std::string &text); + void SendWhoisLine(User* user, User* dest, int numeric, const std::string &text); /** Send a line of WHOIS data to a user. * @param user user to send the line to @@ -1013,13 +1013,13 @@ class CoreExport InspIRCd : public classbase * @param format Format string for the numeric * @param ... Parameters for the format string */ - void SendWhoisLine(userrec* user, userrec* dest, int numeric, const char* format, ...); + void SendWhoisLine(User* user, User* dest, int numeric, const char* format, ...); /** Quit a user for excess flood, and if they are not * fully registered yet, temporarily zline their IP. * @param current user to quit */ - caller1<void, userrec*> FloodQuitUser; + caller1<void, User*> FloodQuitUser; /** Restart the server. * This function will not return. If an error occurs, diff --git a/include/mode.h b/include/mode.h index c8a315cce..2524c11dd 100644 --- a/include/mode.h +++ b/include/mode.h @@ -58,7 +58,7 @@ enum ModeMasks /** * These fixed values can be used to proportionally compare module-defined prefixes to known values. - * For example, if your module queries a chanrec, and is told that user 'joebloggs' has the prefix + * For example, if your module queries a Channel, and is told that user 'joebloggs' has the prefix * '$', and you dont know what $ means, then you can compare it to these three values to determine * its worth against them. For example if '$' had a value of 15000, you would know it is of higher * status than voice, but lower status than halfop. @@ -186,7 +186,7 @@ class CoreExport ModeHandler : public Extensible * Get the 'value' of this modes prefix. * determines which to display when there are multiple. * The mode with the highest value is ranked first. See the - * PrefixModeValue enum and chanrec::GetPrefixValue() for + * PrefixModeValue enum and Channel::GetPrefixValue() for * more information. */ virtual unsigned int GetPrefixRank(); @@ -223,21 +223,21 @@ class CoreExport ModeHandler : public Extensible * @param adding This value is true when the mode is being set, or false when it is being unset. * @return MODEACTION_ALLOW to allow the mode, or MODEACTION_DENY to prevent the mode, also see the description of 'parameter'. */ - virtual ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); /* Can change the mode parameter as its a ref */ + virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); /* Can change the mode parameter as its a ref */ /** * If your mode is a listmode, then this method will be called for displaying an item list, e.g. on MODE #channel +modechar * without any parameter or other modes in the command. * @param user The user issuing the command * @param channel The channel they're requesting an item list of (e.g. a banlist, or an exception list etc) */ - virtual void DisplayList(userrec* user, chanrec* channel); + virtual void DisplayList(User* user, Channel* channel); /** * If your mode is a listmode, this method will be called to display an empty list (just the end of list numeric) * @param user The user issuing the command * @param channel The channel tehy're requesting an item list of (e.g. a banlist, or an exception list etc) */ - virtual void DisplayEmptyList(userrec* user, chanrec* channel); + virtual void DisplayEmptyList(User* user, Channel* channel); /** * If your mode needs special action during a server sync to determine which side wins when comparing timestamps, @@ -251,7 +251,7 @@ class CoreExport ModeHandler : public Extensible * @param channel The channel we are checking against * @return True if the other side wins the merge, false if we win the merge for this mode. */ - virtual bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, chanrec* channel); + virtual bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, Channel* channel); /** * When a remote server needs to bounce a set of modes, it will call this method for every mode @@ -266,7 +266,7 @@ class CoreExport ModeHandler : public Extensible * the current setting for this mode set locally, when the bool is true, or, the parameter given. * This allows the local server to enforce our locally set parameters back to a remote server. */ - virtual ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter); + virtual ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter); /** * When a MODETYPE_USER mode handler is being removed, the server will call this method for every user on the server. @@ -276,7 +276,7 @@ class CoreExport ModeHandler : public Extensible * your mode properly from each user. * @param user The user which the server wants to remove your mode from */ - virtual void RemoveMode(userrec* user); + virtual void RemoveMode(User* user); /** * When a MODETYPE_CHANNEL mode handler is being removed, the server will call this method for every channel on the server. @@ -286,7 +286,7 @@ class CoreExport ModeHandler : public Extensible * your mode properly from each channel. Note that in the case of listmodes, you should remove the entire list of items. * @param channel The channel which the server wants to remove your mode from */ - virtual void RemoveMode(chanrec* channel); + virtual void RemoveMode(Channel* channel); }; /** @@ -345,7 +345,7 @@ class CoreExport ModeWatcher : public Extensible * @return True to allow the mode change to go ahead, false to abort it. If you abort the * change, the mode handler (and ModeWatcher::AfterMode()) will never see the mode change. */ - virtual bool BeforeMode(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding, ModeType type); + virtual bool BeforeMode(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, ModeType type); /** * After the mode character has been processed by the ModeHandler, this method will be called. * @param source The sender of the mode @@ -356,7 +356,7 @@ class CoreExport ModeWatcher : public Extensible * @param adding True if the mode is being added and false if it is being removed * @type The mode type, either MODETYPE_USER or MODETYPE_CHANNEL */ - virtual void AfterMode(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter, bool adding, ModeType type); + virtual void AfterMode(User* source, User* dest, Channel* channel, const std::string ¶meter, bool adding, ModeType type); }; typedef std::vector<ModeWatcher*>::iterator ModeWatchIter; @@ -387,7 +387,7 @@ class CoreExport ModeParser : public classbase /** Displays the current modes of a channel or user. * Used by ModeParser::Process. */ - void DisplayCurrentModes(userrec *user, userrec* targetuser, chanrec* targetchannel, const char* text); + void DisplayCurrentModes(User *user, User* targetuser, Channel* targetchannel, const char* text); /** The string representing the last set of modes to be parsed. * Use GetLastParse() to get this value, to be used for display purposes. @@ -403,13 +403,13 @@ class CoreExport ModeParser : public classbase /** Used to check if user 'd' should be allowed to do operation 'MASK' on channel 'chan'. * for example, should 'user A' be able to 'op' on 'channel B'. */ - userrec* SanityChecks(userrec *user,const char *dest,chanrec *chan,int status); + User* SanityChecks(User *user,const char *dest,Channel *chan,int status); /** Grant a built in privilage (e.g. ops, halfops, voice) to a user on a channel */ - const char* Grant(userrec *d,chanrec *chan,int MASK); + const char* Grant(User *d,Channel *chan,int MASK); /** Revoke a built in privilage (e.g. ops, halfops, voice) to a user on a channel */ - const char* Revoke(userrec *d,chanrec *chan,int MASK); + const char* Revoke(User *d,Channel *chan,int MASK); /** Tidy a banmask. This makes a banmask 'acceptable' if fields are left out. * E.g. * @@ -466,11 +466,11 @@ class CoreExport ModeParser : public classbase * they would be from a MODE command. * @param pcnt The number of items in the parameters array * @param user The user setting or removing the modes. When the modes are set - * by a server, an 'uninitialized' userrec is used, where *user::nick == NULL + * by a server, an 'uninitialized' User is used, where *user::nick == NULL * and *user->server == NULL. * @param servermode True if a server is setting the mode. */ - void Process(const char** parameters, int pcnt, userrec *user, bool servermode); + void Process(const char** parameters, int pcnt, User *user, bool servermode); /** Find the mode handler for a given mode and type. * @param modeletter mode letter to search for @@ -520,7 +520,7 @@ class CoreExport ModeParser : public classbase * @param channel The channel name to look up the privilages of the user for * @return The mode string. */ - std::string ModeString(userrec* user, chanrec* channel); + std::string ModeString(User* user, Channel* channel); }; #endif diff --git a/include/modes/cmode_b.h b/include/modes/cmode_b.h index 417480777..c7d349541 100644 --- a/include/modes/cmode_b.h +++ b/include/modes/cmode_b.h @@ -24,13 +24,13 @@ class ModeChannelBan : public ModeHandler BanItem b; public: ModeChannelBan(InspIRCd* Instance); - ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); - std::string& AddBan(userrec *user,std::string& dest,chanrec *chan,int status); - std::string& DelBan(userrec *user,std::string& dest,chanrec *chan,int status); - void DisplayList(userrec* user, chanrec* channel); - void DisplayEmptyList(userrec* user, chanrec* channel); - ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter); - void RemoveMode(userrec* user); - void RemoveMode(chanrec* channel); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); + std::string& AddBan(User *user,std::string& dest,Channel *chan,int status); + std::string& DelBan(User *user,std::string& dest,Channel *chan,int status); + void DisplayList(User* user, Channel* channel); + void DisplayEmptyList(User* user, Channel* channel); + ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter); + void RemoveMode(User* user); + void RemoveMode(Channel* channel); }; diff --git a/include/modes/cmode_h.h b/include/modes/cmode_h.h index 77d1d57ae..cd524196e 100644 --- a/include/modes/cmode_h.h +++ b/include/modes/cmode_h.h @@ -23,12 +23,12 @@ class ModeChannelHalfOp : public ModeHandler private: public: ModeChannelHalfOp(InspIRCd* Instance); - ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); - std::string AddHalfOp(userrec *user,const char *dest,chanrec *chan,int status); - std::string DelHalfOp(userrec *user,const char *dest,chanrec *chan,int status); - ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); + std::string AddHalfOp(User *user,const char *dest,Channel *chan,int status); + std::string DelHalfOp(User *user,const char *dest,Channel *chan,int status); + ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter); unsigned int GetPrefixRank(); - void RemoveMode(chanrec* channel); - void RemoveMode(userrec* user); + void RemoveMode(Channel* channel); + void RemoveMode(User* user); }; diff --git a/include/modes/cmode_i.h b/include/modes/cmode_i.h index fb177dc0f..560c7dc14 100644 --- a/include/modes/cmode_i.h +++ b/include/modes/cmode_i.h @@ -21,5 +21,5 @@ class ModeChannelInviteOnly : public ModeHandler { public: ModeChannelInviteOnly(InspIRCd* Instance); - ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); }; diff --git a/include/modes/cmode_k.h b/include/modes/cmode_k.h index 51e8ffcaa..c8a1fc20e 100644 --- a/include/modes/cmode_k.h +++ b/include/modes/cmode_k.h @@ -21,9 +21,9 @@ class ModeChannelKey : public ModeHandler { public: ModeChannelKey(InspIRCd* Instance); - ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); - ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter); - bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, chanrec* channel); - void RemoveMode(chanrec* channel); - void RemoveMode(userrec* user); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); + ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter); + bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, Channel* channel); + void RemoveMode(Channel* channel); + void RemoveMode(User* user); }; diff --git a/include/modes/cmode_l.h b/include/modes/cmode_l.h index 63b4a1ef1..06d53069a 100644 --- a/include/modes/cmode_l.h +++ b/include/modes/cmode_l.h @@ -21,7 +21,7 @@ class ModeChannelLimit : public ModeHandler { public: ModeChannelLimit(InspIRCd* Instance); - ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); - ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter); - bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, chanrec* channel); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); + ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter); + bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, Channel* channel); }; diff --git a/include/modes/cmode_m.h b/include/modes/cmode_m.h index 52288de4c..eb3844fad 100644 --- a/include/modes/cmode_m.h +++ b/include/modes/cmode_m.h @@ -21,5 +21,5 @@ class ModeChannelModerated : public ModeHandler { public: ModeChannelModerated(InspIRCd* Instance); - ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); }; diff --git a/include/modes/cmode_n.h b/include/modes/cmode_n.h index 953e0d671..6e51cdd69 100644 --- a/include/modes/cmode_n.h +++ b/include/modes/cmode_n.h @@ -21,5 +21,5 @@ class ModeChannelNoExternal : public ModeHandler { public: ModeChannelNoExternal(InspIRCd* Instance); - ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); }; diff --git a/include/modes/cmode_o.h b/include/modes/cmode_o.h index c86fb4586..cc0b295db 100644 --- a/include/modes/cmode_o.h +++ b/include/modes/cmode_o.h @@ -23,12 +23,12 @@ class ModeChannelOp : public ModeHandler private: public: ModeChannelOp(InspIRCd* Instance); - ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); - std::string AddOp(userrec *user,const char *dest,chanrec *chan,int status); - std::string DelOp(userrec *user,const char *dest,chanrec *chan,int status); - ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); + std::string AddOp(User *user,const char *dest,Channel *chan,int status); + std::string DelOp(User *user,const char *dest,Channel *chan,int status); + ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter); unsigned int GetPrefixRank(); - void RemoveMode(chanrec* channel); - void RemoveMode(userrec* user); + void RemoveMode(Channel* channel); + void RemoveMode(User* user); }; diff --git a/include/modes/cmode_p.h b/include/modes/cmode_p.h index ad3f3ae89..d2a67f975 100644 --- a/include/modes/cmode_p.h +++ b/include/modes/cmode_p.h @@ -21,5 +21,5 @@ class ModeChannelPrivate : public ModeHandler { public: ModeChannelPrivate(InspIRCd* Instance); - ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); }; diff --git a/include/modes/cmode_s.h b/include/modes/cmode_s.h index 0bc229c37..0a9f709d6 100644 --- a/include/modes/cmode_s.h +++ b/include/modes/cmode_s.h @@ -21,5 +21,5 @@ class ModeChannelSecret : public ModeHandler { public: ModeChannelSecret(InspIRCd* Instance); - ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); }; diff --git a/include/modes/cmode_t.h b/include/modes/cmode_t.h index 8a7517ee3..049cb60d3 100644 --- a/include/modes/cmode_t.h +++ b/include/modes/cmode_t.h @@ -21,5 +21,5 @@ class ModeChannelTopicOps : public ModeHandler { public: ModeChannelTopicOps(InspIRCd* Instance); - ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); }; diff --git a/include/modes/cmode_v.h b/include/modes/cmode_v.h index 75420a6d5..e6666311d 100644 --- a/include/modes/cmode_v.h +++ b/include/modes/cmode_v.h @@ -23,12 +23,12 @@ class ModeChannelVoice : public ModeHandler private: public: ModeChannelVoice(InspIRCd* Instance); - ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); - std::string AddVoice(userrec *user,const char *dest,chanrec *chan,int status); - std::string DelVoice(userrec *user,const char *dest,chanrec *chan,int status); - ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); + std::string AddVoice(User *user,const char *dest,Channel *chan,int status); + std::string DelVoice(User *user,const char *dest,Channel *chan,int status); + ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter); unsigned int GetPrefixRank(); - void RemoveMode(userrec* user); - void RemoveMode(chanrec* channel); + void RemoveMode(User* user); + void RemoveMode(Channel* channel); }; diff --git a/include/modes/umode_i.h b/include/modes/umode_i.h index cc7d15102..e6a27d8c7 100644 --- a/include/modes/umode_i.h +++ b/include/modes/umode_i.h @@ -21,6 +21,6 @@ class ModeUserInvisible : public ModeHandler { public: ModeUserInvisible(InspIRCd* Instance); - ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); unsigned int GetCount(); }; diff --git a/include/modes/umode_n.h b/include/modes/umode_n.h index cd1275acc..d75b843c3 100644 --- a/include/modes/umode_n.h +++ b/include/modes/umode_n.h @@ -21,5 +21,5 @@ class ModeUserServerNoticeMask : public ModeHandler { public: ModeUserServerNoticeMask(InspIRCd* Instance); - ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); }; diff --git a/include/modes/umode_o.h b/include/modes/umode_o.h index 7dfdb4128..57b3e8ac8 100644 --- a/include/modes/umode_o.h +++ b/include/modes/umode_o.h @@ -21,6 +21,6 @@ class ModeUserOperator : public ModeHandler { public: ModeUserOperator(InspIRCd* Instance); - ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); unsigned int GetCount(); }; diff --git a/include/modes/umode_s.h b/include/modes/umode_s.h index cda223eee..aa788b353 100644 --- a/include/modes/umode_s.h +++ b/include/modes/umode_s.h @@ -21,6 +21,6 @@ class ModeUserServerNotice : public ModeHandler { public: ModeUserServerNotice(InspIRCd* Instance); - ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); unsigned int GetCount(); }; diff --git a/include/modes/umode_w.h b/include/modes/umode_w.h index 271e959c4..d6f2c0ca7 100644 --- a/include/modes/umode_w.h +++ b/include/modes/umode_w.h @@ -21,6 +21,6 @@ class ModeUserWallops : public ModeHandler { public: ModeUserWallops(InspIRCd* Instance); - ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); unsigned int GetCount(); }; diff --git a/include/modules.h b/include/modules.h index 0aaa06c34..025f35bf3 100644 --- a/include/modules.h +++ b/include/modules.h @@ -449,43 +449,43 @@ class CoreExport Module : public Extensible virtual Priority Prioritize(); /** Called when a user connects. - * The details of the connecting user are available to you in the parameter userrec *user + * The details of the connecting user are available to you in the parameter User *user * @param user The user who is connecting */ - virtual void OnUserConnect(userrec* user); + virtual void OnUserConnect(User* user); /** Called when a user quits. - * The details of the exiting user are available to you in the parameter userrec *user + * The details of the exiting user are available to you in the parameter User *user * This event is only called when the user is fully registered when they quit. To catch * raw disconnections, use the OnUserDisconnect method. * @param user The user who is quitting * @param message The user's quit message (as seen by non-opers) * @param oper_message The user's quit message (as seen by opers) */ - virtual void OnUserQuit(userrec* user, const std::string &message, const std::string &oper_message); + virtual void OnUserQuit(User* user, const std::string &message, const std::string &oper_message); /** Called whenever a user's socket is closed. - * The details of the exiting user are available to you in the parameter userrec *user + * The details of the exiting user are available to you in the parameter User *user * This event is called for all users, registered or not, as a cleanup method for modules * which might assign resources to user, such as dns lookups, objects and sockets. * @param user The user who is disconnecting */ - virtual void OnUserDisconnect(userrec* user); + virtual void OnUserDisconnect(User* user); /** Called whenever a channel is deleted, either by QUIT, KICK or PART. * @param chan The channel being deleted */ - virtual void OnChannelDelete(chanrec* chan); + virtual void OnChannelDelete(Channel* chan); /** Called when a user joins a channel. - * The details of the joining user are available to you in the parameter userrec *user, - * and the details of the channel they have joined is available in the variable chanrec *channel + * The details of the joining user are available to you in the parameter User *user, + * and the details of the channel they have joined is available in the variable Channel *channel * @param user The user who is joining * @param channel The channel being joined * @param silent Change this to true if you want to conceal the JOIN command from the other users * of the channel (useful for modules such as auditorium) */ - virtual void OnUserJoin(userrec* user, chanrec* channel, bool &silent); + virtual void OnUserJoin(User* user, Channel* channel, bool &silent); /** Called after a user joins a channel * Identical to OnUserJoin, but called immediately afterwards, when any linking module has @@ -493,18 +493,18 @@ class CoreExport Module : public Extensible * @param user The user who is joining * @param channel The channel being joined */ - virtual void OnPostJoin(userrec* user, chanrec* channel); + virtual void OnPostJoin(User* user, Channel* channel); /** Called when a user parts a channel. - * The details of the leaving user are available to you in the parameter userrec *user, - * and the details of the channel they have left is available in the variable chanrec *channel + * The details of the leaving user are available to you in the parameter User *user, + * and the details of the channel they have left is available in the variable Channel *channel * @param user The user who is parting * @param channel The channel being parted * @param partmessage The part message, or an empty string * @param silent Change this to true if you want to conceal the PART command from the other users * of the channel (useful for modules such as auditorium) */ - virtual void OnUserPart(userrec* user, chanrec* channel, const std::string &partmessage, bool &silent); + virtual void OnUserPart(User* user, Channel* channel, const std::string &partmessage, bool &silent); /** Called on rehash. * This method is called prior to a /REHASH or when a SIGHUP is received from the operating @@ -515,20 +515,20 @@ class CoreExport Module : public Extensible * value of this variable will be NULL. * @param parameter The (optional) parameter given to REHASH from the user. */ - virtual void OnRehash(userrec* user, const std::string ¶meter); + virtual void OnRehash(User* user, const std::string ¶meter); /** Called when a raw command is transmitted or received. * This method is the lowest level of handler available to a module. It will be called with raw * data which is passing through a connected socket. If you wish, you may munge this data by changing * the string parameter "raw". If you do this, after your function exits it will immediately be * cut down to 510 characters plus a carriage return and linefeed. For INBOUND messages only (where - * inbound is set to true) the value of user will be the userrec of the connection sending the + * inbound is set to true) the value of user will be the User of the connection sending the * data. This is not possible for outbound data because the data may be being routed to multiple targets. * @param raw The raw string in RFC1459 format * @param inbound A flag to indicate wether the data is coming into the daemon or going out to the user * @param user The user record sending the text, when inbound == true. */ - virtual void OnServerRaw(std::string &raw, bool inbound, userrec* user); + virtual void OnServerRaw(std::string &raw, bool inbound, User* user); /** Called whenever a user is about to join a channel, before any processing is done. * Returning a value of 1 from this function stops the process immediately, causing no @@ -539,7 +539,7 @@ class CoreExport Module : public Extensible * IMPORTANT NOTE! * * If the user joins a NEW channel which does not exist yet, OnUserPreJoin will be called BEFORE the channel - * record is created. This will cause chanrec* chan to be NULL. There is very little you can do in form of + * record is created. This will cause Channel* chan to be NULL. There is very little you can do in form of * processing on the actual channel record at this point, however the channel NAME will still be passed in * char* cname, so that you could for example implement a channel blacklist or whitelist, etc. * @param user The user joining the channel @@ -549,7 +549,7 @@ class CoreExport Module : public Extensible * You may alter this string to alter the user's modes on the channel. * @return 1 To prevent the join, 0 to allow it. */ - virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname, std::string &privs); + virtual int OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs); /** Called whenever a user is about to be kicked. * Returning a value of 1 from this function stops the process immediately, causing no @@ -561,7 +561,7 @@ class CoreExport Module : public Extensible * @param reason The kick reason * @return 1 to prevent the kick, 0 to continue normally, -1 to explicitly allow the kick regardless of normal operation */ - virtual int OnUserPreKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason); + virtual int OnUserPreKick(User* source, User* user, Channel* chan, const std::string &reason); /** Called whenever a user is kicked. * If this method is called, the kick is already underway and cannot be prevented, so @@ -573,15 +573,15 @@ class CoreExport Module : public Extensible * @param silent Change this to true if you want to conceal the PART command from the other users * of the channel (useful for modules such as auditorium) */ - virtual void OnUserKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason, bool &silent); + virtual void OnUserKick(User* source, User* user, Channel* chan, const std::string &reason, bool &silent); /** Called whenever a user opers locally. - * The userrec will contain the oper mode 'o' as this function is called after any modifications + * The User will contain the oper mode 'o' as this function is called after any modifications * are made to the user's structure by the core. * @param user The user who is opering up * @param opertype The opers type name */ - virtual void OnOper(userrec* user, const std::string &opertype); + virtual void OnOper(User* user, const std::string &opertype); /** Called after a user opers locally. * This is identical to Module::OnOper(), except it is called after OnOper so that other modules @@ -590,10 +590,10 @@ class CoreExport Module : public Extensible * @param user The user who is opering up * @param opertype The opers type name */ - virtual void OnPostOper(userrec* user, const std::string &opertype); + virtual void OnPostOper(User* user, const std::string &opertype); /** Called whenever a user types /INFO. - * The userrec will contain the information of the user who typed the command. Modules may use this + * The User will contain the information of the user who typed the command. Modules may use this * method to output their own credits in /INFO (which is the ircd's version of an about box). * It is purposefully not possible to modify any info that has already been output, or halt the list. * You must write a 371 numeric to the user, containing your info in the following format: @@ -602,7 +602,7 @@ class CoreExport Module : public Extensible * * @param user The user issuing /INFO */ - virtual void OnInfo(userrec* user); + virtual void OnInfo(User* user); /** Called whenever a /WHOIS is performed on a local user. * The source parameter contains the details of the user who issued the WHOIS command, and @@ -610,7 +610,7 @@ class CoreExport Module : public Extensible * @param source The user issuing the WHOIS command * @param dest The user who is being WHOISed */ - virtual void OnWhois(userrec* source, userrec* dest); + virtual void OnWhois(User* source, User* dest); /** Called whenever a user is about to invite another user into a channel, before any processing is done. * Returning 1 from this function stops the process immediately, causing no @@ -621,7 +621,7 @@ class CoreExport Module : public Extensible * @param channel The channel the user is being invited to * @return 1 to deny the invite, 0 to allow */ - virtual int OnUserPreInvite(userrec* source,userrec* dest,chanrec* channel); + virtual int OnUserPreInvite(User* source,User* dest,Channel* channel); /** Called after a user has been successfully invited to a channel. * You cannot prevent the invite from occuring using this function, to do that, @@ -630,17 +630,17 @@ class CoreExport Module : public Extensible * @param dest The user being invited * @param channel The channel the user is being invited to */ - virtual void OnUserInvite(userrec* source,userrec* dest,chanrec* channel); + virtual void OnUserInvite(User* source,User* dest,Channel* channel); /** Called whenever a user is about to PRIVMSG A user or a channel, before any processing is done. * Returning any nonzero value from this function stops the process immediately, causing no * output to be sent to the user by the core. If you do this you must produce your own numerics, * notices etc. This is useful for modules which may want to filter or redirect messages. * target_type can be one of TYPE_USER or TYPE_CHANNEL. If the target_type value is a user, - * you must cast dest to a userrec* otherwise you must cast it to a chanrec*, this is the details + * you must cast dest to a User* otherwise you must cast it to a Channel*, this is the details * of where the message is destined to be sent. * @param user The user sending the message - * @param dest The target of the message (chanrec* or userrec*) + * @param dest The target of the message (Channel* or User*) * @param target_type The type of target (TYPE_USER or TYPE_CHANNEL) * @param text Changeable text being sent by the user * @param status The status being used, e.g. PRIVMSG @#chan has status== '@', 0 to send to everyone. @@ -648,20 +648,20 @@ class CoreExport Module : public Extensible * It will be ignored for private messages. * @return 1 to deny the NOTICE, 0 to allow it */ - virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text,char status, CUList &exempt_list); + virtual int OnUserPreMessage(User* user,void* dest,int target_type, std::string &text,char status, CUList &exempt_list); /** Called whenever a user is about to NOTICE A user or a channel, before any processing is done. * Returning any nonzero value from this function stops the process immediately, causing no * output to be sent to the user by the core. If you do this you must produce your own numerics, * notices etc. This is useful for modules which may want to filter or redirect messages. * target_type can be one of TYPE_USER or TYPE_CHANNEL. If the target_type value is a user, - * you must cast dest to a userrec* otherwise you must cast it to a chanrec*, this is the details + * you must cast dest to a User* otherwise you must cast it to a Channel*, this is the details * of where the message is destined to be sent. * You may alter the message text as you wish before relinquishing control to the next module * in the chain, and if no other modules block the text this altered form of the text will be sent out * to the user and possibly to other servers. * @param user The user sending the message - * @param dest The target of the message (chanrec* or userrec*) + * @param dest The target of the message (Channel* or User*) * @param target_type The type of target (TYPE_USER or TYPE_CHANNEL) * @param text Changeable text being sent by the user * @param status The status being used, e.g. PRIVMSG @#chan has status== '@', 0 to send to everyone. @@ -669,7 +669,7 @@ class CoreExport Module : public Extensible * It will be ignored for private notices. * @return 1 to deny the NOTICE, 0 to allow it */ - virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text,char status, CUList &exempt_list); + virtual int OnUserPreNotice(User* user,void* dest,int target_type, std::string &text,char status, CUList &exempt_list); /** Called whenever the server wants to build the exemption list for a channel, but is not directly doing a PRIVMSG or NOTICE. * For example, the spanningtree protocol will call this event when passing a privmsg on (but not processing it directly). @@ -680,11 +680,11 @@ class CoreExport Module : public Extensible * @param exempt_list The exempt list to be populated * @param text The original message text causing the exempt list to be built */ - virtual void OnBuildExemptList(MessageType message_type, chanrec* chan, userrec* sender, char status, CUList &exempt_list, const std::string &text); + virtual void OnBuildExemptList(MessageType message_type, Channel* chan, User* sender, char status, CUList &exempt_list, const std::string &text); /** Called before any nickchange, local or remote. This can be used to implement Q-lines etc. * Please note that although you can see remote nickchanges through this function, you should - * NOT make any changes to the userrec if the user is a remote user as this may cause a desnyc. + * NOT make any changes to the User if the user is a remote user as this may cause a desnyc. * check user->server before taking any action (including returning nonzero from the method). * If your method returns nonzero, the nickchange is silently forbidden, and it is down to your * module to generate some meaninful output. @@ -692,10 +692,10 @@ class CoreExport Module : public Extensible * @param newnick Their new nickname * @return 1 to deny the change, 0 to allow */ - virtual int OnUserPreNick(userrec* user, const std::string &newnick); + virtual int OnUserPreNick(User* user, const std::string &newnick); /** Called after any PRIVMSG sent from a user. - * The dest variable contains a userrec* if target_type is TYPE_USER and a chanrec* + * The dest variable contains a User* if target_type is TYPE_USER and a Channel* * if target_type is TYPE_CHANNEL. * @param user The user sending the message * @param dest The target of the message @@ -703,10 +703,10 @@ class CoreExport Module : public Extensible * @param text the text being sent by the user * @param status The status being used, e.g. PRIVMSG @#chan has status== '@', 0 to send to everyone. */ - virtual void OnUserMessage(userrec* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list); + virtual void OnUserMessage(User* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list); /** Called after any NOTICE sent from a user. - * The dest variable contains a userrec* if target_type is TYPE_USER and a chanrec* + * The dest variable contains a User* if target_type is TYPE_USER and a Channel* * if target_type is TYPE_CHANNEL. * @param user The user sending the message * @param dest The target of the message @@ -714,18 +714,18 @@ class CoreExport Module : public Extensible * @param text the text being sent by the user * @param status The status being used, e.g. NOTICE @#chan has status== '@', 0 to send to everyone. */ - virtual void OnUserNotice(userrec* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list); + virtual void OnUserNotice(User* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list); /** Called after every MODE command sent from a user - * The dest variable contains a userrec* if target_type is TYPE_USER and a chanrec* + * The dest variable contains a User* if target_type is TYPE_USER and a Channel* * if target_type is TYPE_CHANNEL. The text variable contains the remainder of the * mode string after the target, e.g. "+wsi" or "+ooo nick1 nick2 nick3". * @param user The user sending the MODEs - * @param dest The target of the modes (userrec* or chanrec*) + * @param dest The target of the modes (User* or Channel*) * @param target_type The type of target (TYPE_USER or TYPE_CHANNEL) * @param text The actual modes and their parameters if any */ - virtual void OnMode(userrec* user, void* dest, int target_type, const std::string &text); + virtual void OnMode(User* user, void* dest, int target_type, const std::string &text); /** Allows modules to alter or create server descriptions * Whenever a module requires a server description, for example for display in @@ -749,7 +749,7 @@ class CoreExport Module : public Extensible * @param proto A pointer to the module handling network protocol * @param opaque An opaque pointer set by the protocol module, should not be modified! */ - virtual void OnSyncUser(userrec* user, Module* proto, void* opaque); + virtual void OnSyncUser(User* user, Module* proto, void* opaque); /** Allows modules to synchronize data which relates to channels during a netburst. * When this function is called, it will be called from the module which implements @@ -766,11 +766,11 @@ class CoreExport Module : public Extensible * @param proto A pointer to the module handling network protocol * @param opaque An opaque pointer set by the protocol module, should not be modified! */ - virtual void OnSyncChannel(chanrec* chan, Module* proto, void* opaque); + virtual void OnSyncChannel(Channel* chan, Module* proto, void* opaque); /* Allows modules to syncronize metadata related to channels over the network during a netburst. * Whenever the linking module wants to send out data, but doesnt know what the data - * represents (e.g. it is Extensible metadata, added to a userrec or chanrec by a module) then + * represents (e.g. it is Extensible metadata, added to a User or Channel by a module) then * this method is called.You should use the ProtoSendMetaData function after you've * correctly decided how the data should be represented, to send the metadata on its way if it belongs * to your module. For a good example of how to use this method, see src/modules/m_swhois.cpp. @@ -781,11 +781,11 @@ class CoreExport Module : public Extensible * @param displayable If this value is true, the data is going to be displayed to a user, * and not sent across the network. Use this to determine wether or not to show sensitive data. */ - virtual void OnSyncChannelMetaData(chanrec* chan, Module* proto,void* opaque, const std::string &extname, bool displayable = false); + virtual void OnSyncChannelMetaData(Channel* chan, Module* proto,void* opaque, const std::string &extname, bool displayable = false); /* Allows modules to syncronize metadata related to users over the network during a netburst. * Whenever the linking module wants to send out data, but doesnt know what the data - * represents (e.g. it is Extensible metadata, added to a userrec or chanrec by a module) then + * represents (e.g. it is Extensible metadata, added to a User or Channel by a module) then * this method is called. You should use the ProtoSendMetaData function after you've * correctly decided how the data should be represented, to send the metadata on its way if * if it belongs to your module. @@ -796,11 +796,11 @@ class CoreExport Module : public Extensible * @param displayable If this value is true, the data is going to be displayed to a user, * and not sent across the network. Use this to determine wether or not to show sensitive data. */ - virtual void OnSyncUserMetaData(userrec* user, Module* proto,void* opaque, const std::string &extname, bool displayable = false); + virtual void OnSyncUserMetaData(User* user, Module* proto,void* opaque, const std::string &extname, bool displayable = false); /* Allows modules to syncronize metadata not related to users or channels, over the network during a netburst. * Whenever the linking module wants to send out data, but doesnt know what the data - * represents (e.g. it is Extensible metadata, added to a userrec or chanrec by a module) then + * represents (e.g. it is Extensible metadata, added to a User or Channel by a module) then * this method is called. You should use the ProtoSendMetaData function after you've * correctly decided how the data should be represented, to send the metadata on its way if * if it belongs to your module. @@ -814,7 +814,7 @@ class CoreExport Module : public Extensible /** Allows module data, sent via ProtoSendMetaData, to be decoded again by a receiving module. * Please see src/modules/m_swhois.cpp for a working example of how to use this method call. * @param target_type The type of item to decode data for, TYPE_USER or TYPE_CHANNEL - * @param target The chanrec* or userrec* that data should be added to + * @param target The Channel* or User* that data should be added to * @param extname The extension name which is being sent * @param extdata The extension data, encoded at the other end by an identical module through OnSyncChannelMetaData or OnSyncUserMetaData */ @@ -830,7 +830,7 @@ class CoreExport Module : public Extensible * * @param opaque An opaque pointer set by the protocol module, should not be modified! * @param target_type The type of item to decode data for, TYPE_USER or TYPE_CHANNEL - * @param target The chanrec* or userrec* that modes should be sent for + * @param target The Channel* or User* that modes should be sent for * @param modeline The modes and parameters to be sent */ virtual void ProtoSendMode(void* opaque, int target_type, void* target, const std::string &modeline); @@ -845,7 +845,7 @@ class CoreExport Module : public Extensible * how to use this function. * @param opaque An opaque pointer set by the protocol module, should not be modified! * @param target_type The type of item to decode data for, TYPE_USER or TYPE_CHANNEL - * @param target The chanrec* or userrec* that metadata should be sent for + * @param target The Channel* or User* that metadata should be sent for * @param extname The extension name to send metadata for * @param extdata Encoded data for this extension name, which will be encoded at the oppsite end by an identical module using OnDecodeMetaData */ @@ -855,21 +855,21 @@ class CoreExport Module : public Extensible * @param user The user sending the WALLOPS * @param text The content of the WALLOPS message */ - virtual void OnWallops(userrec* user, const std::string &text); + virtual void OnWallops(User* user, const std::string &text); /** Called whenever a user's hostname is changed. * This event triggers after the host has been set. * @param user The user whos host is being changed * @param newhost The new hostname being set */ - virtual void OnChangeHost(userrec* user, const std::string &newhost); + virtual void OnChangeHost(User* user, const std::string &newhost); /** Called whenever a user's GECOS (realname) is changed. * This event triggers after the name has been set. * @param user The user who's GECOS is being changed * @param gecos The new GECOS being set on the user */ - virtual void OnChangeName(userrec* user, const std::string &gecos); + virtual void OnChangeName(User* user, const std::string &gecos); /** Called whenever a gline is added by a local user. * This method is triggered after the line is added. @@ -878,7 +878,7 @@ class CoreExport Module : public Extensible * @param reason The reason text to be displayed * @param hostmask The hostmask to add */ - virtual void OnAddGLine(long duration, userrec* source, const std::string &reason, const std::string &hostmask); + virtual void OnAddGLine(long duration, User* source, const std::string &reason, const std::string &hostmask); /** Called whenever a zline is added by a local user. * This method is triggered after the line is added. @@ -887,7 +887,7 @@ class CoreExport Module : public Extensible * @param reason The reason text to be displayed * @param ipmask The hostmask to add */ - virtual void OnAddZLine(long duration, userrec* source, const std::string &reason, const std::string &ipmask); + virtual void OnAddZLine(long duration, User* source, const std::string &reason, const std::string &ipmask); /** Called whenever a kline is added by a local user. * This method is triggered after the line is added. @@ -896,7 +896,7 @@ class CoreExport Module : public Extensible * @param reason The reason text to be displayed * @param hostmask The hostmask to add */ - virtual void OnAddKLine(long duration, userrec* source, const std::string &reason, const std::string &hostmask); + virtual void OnAddKLine(long duration, User* source, const std::string &reason, const std::string &hostmask); /** Called whenever a qline is added by a local user. * This method is triggered after the line is added. @@ -905,7 +905,7 @@ class CoreExport Module : public Extensible * @param reason The reason text to be displayed * @param nickmask The hostmask to add */ - virtual void OnAddQLine(long duration, userrec* source, const std::string &reason, const std::string &nickmask); + virtual void OnAddQLine(long duration, User* source, const std::string &reason, const std::string &nickmask); /** Called whenever a eline is added by a local user. * This method is triggered after the line is added. @@ -914,49 +914,49 @@ class CoreExport Module : public Extensible * @param reason The reason text to be displayed * @param hostmask The hostmask to add */ - virtual void OnAddELine(long duration, userrec* source, const std::string &reason, const std::string &hostmask); + virtual void OnAddELine(long duration, User* source, const std::string &reason, const std::string &hostmask); /** Called whenever a gline is deleted. * This method is triggered after the line is deleted. * @param source The user removing the line * @param hostmask The hostmask to delete */ - virtual void OnDelGLine(userrec* source, const std::string &hostmask); + virtual void OnDelGLine(User* source, const std::string &hostmask); /** Called whenever a zline is deleted. * This method is triggered after the line is deleted. * @param source The user removing the line * @param hostmask The hostmask to delete */ - virtual void OnDelZLine(userrec* source, const std::string &ipmask); + virtual void OnDelZLine(User* source, const std::string &ipmask); /** Called whenever a kline is deleted. * This method is triggered after the line is deleted. * @param source The user removing the line * @param hostmask The hostmask to delete */ - virtual void OnDelKLine(userrec* source, const std::string &hostmask); + virtual void OnDelKLine(User* source, const std::string &hostmask); /** Called whenever a qline is deleted. * This method is triggered after the line is deleted. * @param source The user removing the line * @param hostmask The hostmask to delete */ - virtual void OnDelQLine(userrec* source, const std::string &nickmask); + virtual void OnDelQLine(User* source, const std::string &nickmask); /** Called whenever a eline is deleted. * This method is triggered after the line is deleted. * @param source The user removing the line * @param hostmask The hostmask to delete */ - virtual void OnDelELine(userrec* source, const std::string &hostmask); + virtual void OnDelELine(User* source, const std::string &hostmask); /** Called before your module is unloaded to clean up Extensibles. * This method is called once for every user and channel on the network, * so that when your module unloads it may clear up any remaining data * in the form of Extensibles added using Extensible::Extend(). * If the target_type variable is TYPE_USER, then void* item refers to - * a userrec*, otherwise it refers to a chanrec*. + * a User*, otherwise it refers to a Channel*. * @param target_type The type of item being cleaned * @param item A pointer to the item's class */ @@ -964,14 +964,14 @@ class CoreExport Module : public Extensible /** Called after any nickchange, local or remote. This can be used to track users after nickchanges * have been applied. Please note that although you can see remote nickchanges through this function, you should - * NOT make any changes to the userrec if the user is a remote user as this may cause a desnyc. + * NOT make any changes to the User if the user is a remote user as this may cause a desnyc. * check user->server before taking any action (including returning nonzero from the method). * Because this method is called after the nickchange is taken place, no return values are possible * to indicate forbidding of the nick change. Use OnUserPreNick for this. * @param user The user changing their nick * @param oldnick The old nickname of the user before the nickchange */ - virtual void OnUserPostNick(userrec* user, const std::string &oldnick); + virtual void OnUserPostNick(User* user, const std::string &oldnick); /** Called before an action which requires a channel privilage check. * This function is called before many functions which check a users status on a channel, for example @@ -998,7 +998,7 @@ class CoreExport Module : public Extensible * @param channel The channel which is being checked * @param access_type See above */ - virtual int OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type); + virtual int OnAccessCheck(User* source,User* dest,Channel* channel,int access_type); /** Called when a 005 numeric is about to be output. * The module should modify the 005 numeric if needed to indicate its features. @@ -1019,14 +1019,14 @@ class CoreExport Module : public Extensible * @param reason The kill reason * @return 1 to prevent the kill, 0 to allow */ - virtual int OnKill(userrec* source, userrec* dest, const std::string &reason); + virtual int OnKill(User* source, User* dest, const std::string &reason); /** Called when an oper wants to disconnect a remote user via KILL * @param source The user sending the KILL * @param dest The user being killed * @param reason The kill reason */ - virtual void OnRemoteKill(userrec* source, userrec* dest, const std::string &reason, const std::string &operreason); + virtual void OnRemoteKill(User* source, User* dest, const std::string &reason, const std::string &operreason); /** Called whenever a module is loaded. * mod will contain a pointer to the module, and string will contain its name, @@ -1081,7 +1081,7 @@ class CoreExport Module : public Extensible * @param original_line The entire original line as passed to the parser from the user * @return 1 to block the command, 0 to allow */ - virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated, const std::string &original_line); + virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, User *user, bool validated, const std::string &original_line); /** Called after any command has been executed. * This event occurs for all registered commands, wether they are registered in the core, @@ -1095,7 +1095,7 @@ class CoreExport Module : public Extensible * @param result The return code given by the command handler, one of CMD_SUCCESS or CMD_FAILURE * @param original_line The entire original line as passed to the parser from the user */ - virtual void OnPostCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, CmdResult result, const std::string &original_line); + virtual void OnPostCommand(const std::string &command, const char** parameters, int pcnt, User *user, CmdResult result, const std::string &original_line); /** Called to check if a user who is connecting can now be allowed to register * If any modules return false for this function, the user is held in the waiting @@ -1107,7 +1107,7 @@ class CoreExport Module : public Extensible * @param user The user to check * @return true to indicate readiness, false if otherwise */ - virtual bool OnCheckReady(userrec* user); + virtual bool OnCheckReady(User* user); /** Called whenever a user is about to register their connection (e.g. before the user * is sent the MOTD etc). Modules can use this method if they are performing a function @@ -1118,7 +1118,7 @@ class CoreExport Module : public Extensible * @param user The user registering * @return 1 to indicate user quit, 0 to continue */ - virtual int OnUserRegister(userrec* user); + virtual int OnUserRegister(User* user); /** Called whenever a user joins a channel, to determine if invite checks should go ahead or not. * This method will always be called for each join, wether or not the channel is actually +i, and @@ -1128,7 +1128,7 @@ class CoreExport Module : public Extensible * @param chan The channel being joined * @return 1 to explicitly allow the join, 0 to proceed as normal */ - virtual int OnCheckInvite(userrec* user, chanrec* chan); + virtual int OnCheckInvite(User* user, Channel* chan); /** Called whenever a user joins a channel, to determine if key checks should go ahead or not. * This method will always be called for each join, wether or not the channel is actually +k, and @@ -1139,7 +1139,7 @@ class CoreExport Module : public Extensible * @param chan The channel being joined * @return 1 to explicitly allow the join, 0 to proceed as normal */ - virtual int OnCheckKey(userrec* user, chanrec* chan, const std::string &keygiven); + virtual int OnCheckKey(User* user, Channel* chan, const std::string &keygiven); /** Called whenever a user joins a channel, to determine if channel limit checks should go ahead or not. * This method will always be called for each join, wether or not the channel is actually +l, and @@ -1149,7 +1149,7 @@ class CoreExport Module : public Extensible * @param chan The channel being joined * @return 1 to explicitly allow the join, 0 to proceed as normal */ - virtual int OnCheckLimit(userrec* user, chanrec* chan); + virtual int OnCheckLimit(User* user, Channel* chan); /** Called whenever a user joins a channel, to determine if banlist checks should go ahead or not. * This method will always be called for each join, wether or not the user actually matches a channel ban, and @@ -1159,7 +1159,7 @@ class CoreExport Module : public Extensible * @param chan The channel being joined * @return 1 to explicitly allow the join, 0 to proceed as normal */ - virtual int OnCheckBan(userrec* user, chanrec* chan); + virtual int OnCheckBan(User* user, Channel* chan); /** Called on all /STATS commands * This method is triggered for all /STATS use, including stats symbols handled by the core. @@ -1170,7 +1170,7 @@ class CoreExport Module : public Extensible * work when remote STATS queries are received. * @return 1 to block the /STATS from being processed by the core, 0 to allow it */ - virtual int OnStats(char symbol, userrec* user, string_list &results); + virtual int OnStats(char symbol, User* user, string_list &results); /** Called whenever a change of a local users displayed host is attempted. * Return 1 to deny the host change, or 0 to allow it. @@ -1178,7 +1178,7 @@ class CoreExport Module : public Extensible * @param newhost The new hostname * @return 1 to deny the host change, 0 to allow */ - virtual int OnChangeLocalUserHost(userrec* user, const std::string &newhost); + virtual int OnChangeLocalUserHost(User* user, const std::string &newhost); /** Called whenever a change of a local users GECOS (fullname field) is attempted. * return 1 to deny the name change, or 0 to allow it. @@ -1186,7 +1186,7 @@ class CoreExport Module : public Extensible * @param newhost The new GECOS * @return 1 to deny the GECOS change, 0 to allow */ - virtual int OnChangeLocalUserGECOS(userrec* user, const std::string &newhost); + virtual int OnChangeLocalUserGECOS(User* user, const std::string &newhost); /** Called whenever a topic is changed by a local user. * Return 1 to deny the topic change, or 0 to allow it. @@ -1195,7 +1195,7 @@ class CoreExport Module : public Extensible * @param topic The actual topic text * @param 1 to block the topic change, 0 to allow */ - virtual int OnLocalTopicChange(userrec* user, chanrec* chan, const std::string &topic); + virtual int OnLocalTopicChange(User* user, Channel* chan, const std::string &topic); /** Called whenever a local topic has been changed. * To block topic changes you must use OnLocalTopicChange instead. @@ -1203,7 +1203,7 @@ class CoreExport Module : public Extensible * @param chan The channels who's topic is being changed * @param topic The actual topic text */ - virtual void OnPostLocalTopicChange(userrec* user, chanrec* chan, const std::string &topic); + virtual void OnPostLocalTopicChange(User* user, Channel* chan, const std::string &topic); /** Called whenever an Event class is sent to all module by another module. * Please see the documentation of Event::Send() for further information. The Event sent can @@ -1240,7 +1240,7 @@ class CoreExport Module : public Extensible * servermodes out to reverse mode changes. * @param user The user who is opering */ - virtual void OnGlobalOper(userrec* user); + virtual void OnGlobalOper(User* user); /** Called after a user has fully connected and all modules have executed OnUserConnect * This event is informational only. You should not change any user information in this @@ -1248,7 +1248,7 @@ class CoreExport Module : public Extensible * This is called for both local and remote users. * @param user The user who is connecting */ - virtual void OnPostConnect(userrec* user); + virtual void OnPostConnect(User* user); /** Called whenever a ban is added to a channel's list. * Return a non-zero value to 'eat' the mode change and prevent the ban from being added. @@ -1257,7 +1257,7 @@ class CoreExport Module : public Extensible * @param banmask The ban mask being added * @return 1 to block the ban, 0 to continue as normal */ - virtual int OnAddBan(userrec* source, chanrec* channel,const std::string &banmask); + virtual int OnAddBan(User* source, Channel* channel,const std::string &banmask); /** Called whenever a ban is removed from a channel's list. * Return a non-zero value to 'eat' the mode change and prevent the ban from being removed. @@ -1266,7 +1266,7 @@ class CoreExport Module : public Extensible * @param banmask The ban mask being deleted * @return 1 to block the unban, 0 to continue as normal */ - virtual int OnDelBan(userrec* source, chanrec* channel,const std::string &banmask); + virtual int OnDelBan(User* source, Channel* channel,const std::string &banmask); /** Called immediately after any connection is accepted. This is intended for raw socket * processing (e.g. modules which wrap the tcp connection within another library) and provides @@ -1322,15 +1322,15 @@ class CoreExport Module : public Extensible /** Called whenever a user sets away. * This method has no parameter for the away message, as it is available in the - * user record as userrec::awaymsg. + * user record as User::awaymsg. * @param user The user setting away */ - virtual void OnSetAway(userrec* user); + virtual void OnSetAway(User* user); /** Called when a user cancels their away state. * @param user The user returning from away */ - virtual void OnCancelAway(userrec* user); + virtual void OnCancelAway(User* user); /** Called whenever a NAMES list is requested. * You can produce the nameslist yourself, overriding the current list, @@ -1343,12 +1343,12 @@ class CoreExport Module : public Extensible * point the pointer at your copy) * @return 1 to prevent the user list being sent to the client, 0 to allow it */ - virtual int OnUserList(userrec* user, chanrec* Ptr, CUList* &userlist); + virtual int OnUserList(User* user, Channel* Ptr, CUList* &userlist); /** Called whenever a line of WHOIS output is sent to a user. * You may change the numeric and the text of the output by changing * the values numeric and text, but you cannot change the user the - * numeric is sent to. You may however change the user's userrec values. + * numeric is sent to. You may however change the user's User values. * @param user The user the numeric is being sent to * @param dest The user being WHOISed * @param numeric The numeric of the line being sent @@ -1356,7 +1356,7 @@ class CoreExport Module : public Extensible * @return nonzero to drop the line completely so that the user does not * receive it, or zero to allow the line to be sent. */ - virtual int OnWhoisLine(userrec* user, userrec* dest, int &numeric, std::string &text); + virtual int OnWhoisLine(User* user, User* dest, int &numeric, std::string &text); /** Called at intervals for modules to garbage-collect any hashes etc. * Certain data types such as hash_map 'leak' buckets, which must be @@ -1372,7 +1372,7 @@ class CoreExport Module : public Extensible * data which is being spooled in a controlled manner, e.g. LIST lines. * @param user The user who's buffer is now empty. */ - virtual void OnBufferFlushed(userrec* user); + virtual void OnBufferFlushed(User* user); }; @@ -1496,7 +1496,7 @@ class CoreExport ConfigReader : public classbase * if bool is false AND user is false, the error report will be spooled to all opers * by means of a NOTICE to all opers. */ - void DumpErrors(bool bail,userrec* user); + void DumpErrors(bool bail,User* user); /** Returns the number of items within a tag. * For example if the tag was <test tag="blah" data="foo"> then this diff --git a/include/socket.h b/include/socket.h index 861acc1f1..832523ba7 100644 --- a/include/socket.h +++ b/include/socket.h @@ -141,7 +141,7 @@ namespace irc } /** This class handles incoming connections on client ports. - * It will create a new userrec for every valid connection + * It will create a new User for every valid connection * and assign it a file descriptor. */ class CoreExport ListenSocket : public EventHandler diff --git a/include/typedefs.h b/include/typedefs.h index f101e1615..359db50f5 100644 --- a/include/typedefs.h +++ b/include/typedefs.h @@ -28,17 +28,17 @@ #ifndef WIN32 /** User hash (POSIX systems with GCC) */ -typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, irc::StrHashComp> user_hash; +typedef nspace::hash_map<std::string, User*, nspace::hash<string>, irc::StrHashComp> user_hash; /** Channel hash (POSIX systems with GCC) */ -typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, irc::StrHashComp> chan_hash; +typedef nspace::hash_map<std::string, Channel*, nspace::hash<string>, irc::StrHashComp> chan_hash; #else /** User hash (windows systems with visual studio) */ -typedef nspace::hash_map<std::string, userrec*, nspace::hash_compare<string, less<string> > > user_hash; +typedef nspace::hash_map<std::string, User*, nspace::hash_compare<string, less<string> > > user_hash; /** Channel hash (windows systems with visual studio) */ -typedef nspace::hash_map<std::string, chanrec*, nspace::hash_compare<string, less<string> > > chan_hash; +typedef nspace::hash_map<std::string, Channel*, nspace::hash_compare<string, less<string> > > chan_hash; #endif /** Server name cache diff --git a/include/u_listmode.h b/include/u_listmode.h index 6b4fba889..9d78fe64b 100644 --- a/include/u_listmode.h +++ b/include/u_listmode.h @@ -64,8 +64,8 @@ typedef std::vector<ListLimit> limitlist; class ListModeRequest : public Request { public: - userrec* user; - chanrec* chan; + User* user; + Channel* chan; /** Check if a user is on a channel's list. * The Event::Send() event returns true if the user is on the channel's list. @@ -74,7 +74,7 @@ class ListModeRequest : public Request * @param u User to check against * @param c Channel to check against */ - ListModeRequest(Module* sender, Module* target, userrec* u, chanrec* c) : Request(sender, target, "LM_CHECKLIST"), user(u), chan(c) + ListModeRequest(Module* sender, Module* target, User* u, Channel* c) : Request(sender, target, "LM_CHECKLIST"), user(u), chan(c) { } @@ -132,7 +132,7 @@ class ListModeBase : public ModeHandler /** See mode.h */ - std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter) + std::pair<bool,std::string> ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter) { modelist* el; channel->GetExt(infokey, el); @@ -153,7 +153,7 @@ class ListModeBase : public ModeHandler * @param user The user to send the list to * @param channel The channel the user is requesting the list for */ - virtual void DisplayList(userrec* user, chanrec* channel) + virtual void DisplayList(User* user, Channel* channel) { modelist* el; channel->GetExt(infokey, el); @@ -167,7 +167,7 @@ class ListModeBase : public ModeHandler user->WriteServ("%s %s %s :%s", endoflistnumeric.c_str(), user->nick, channel->name, endofliststring.c_str()); } - virtual void DisplayEmptyList(userrec* user, chanrec* channel) + virtual void DisplayEmptyList(User* user, Channel* channel) { user->WriteServ("%s %s %s :%s", endoflistnumeric.c_str(), user->nick, channel->name, endofliststring.c_str()); } @@ -176,7 +176,7 @@ class ListModeBase : public ModeHandler * See mode.h * @param channel The channel to remove all instances of the mode from */ - virtual void RemoveMode(chanrec* channel) + virtual void RemoveMode(Channel* channel) { modelist* el; channel->GetExt(infokey, el); @@ -206,7 +206,7 @@ class ListModeBase : public ModeHandler /** See mode.h */ - virtual void RemoveMode(userrec* user) + virtual void RemoveMode(User* user) { /* Listmodes dont get set on users */ } @@ -248,7 +248,7 @@ class ListModeBase : public ModeHandler /** Handle the list mode. * See mode.h */ - virtual ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) + virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding) { // Try and grab the list modelist* el; @@ -375,7 +375,7 @@ class ListModeBase : public ModeHandler * See modules.h. * @param chan Channel being deleted */ - virtual void DoChannelDelete(chanrec* chan) + virtual void DoChannelDelete(Channel* chan) { modelist* list; chan->GetExt(infokey, list); @@ -393,7 +393,7 @@ class ListModeBase : public ModeHandler * @param proto Protocol module pointer * @param opaque Opaque connection handle */ - virtual void DoSyncChannel(chanrec* chan, Module* proto, void* opaque) + virtual void DoSyncChannel(Channel* chan, Module* proto, void* opaque) { modelist* list; chan->GetExt(infokey, list); @@ -429,7 +429,7 @@ class ListModeBase : public ModeHandler * @param parameter The actual parameter being added * @return true if the parameter is valid */ - virtual bool ValidateParam(userrec* source, chanrec* channel, std::string ¶meter) + virtual bool ValidateParam(User* source, Channel* channel, std::string ¶meter) { return true; } @@ -441,7 +441,7 @@ class ListModeBase : public ModeHandler * @param parameter The actual parameter being added * @return Ignored */ - virtual bool TellListTooLong(userrec* source, chanrec* channel, std::string ¶meter) + virtual bool TellListTooLong(User* source, Channel* channel, std::string ¶meter) { return false; } @@ -452,7 +452,7 @@ class ListModeBase : public ModeHandler * @param channel Channel the parameter is being added to * @param parameter The actual parameter being added */ - virtual void TellAlreadyOnList(userrec* source, chanrec* channel, std::string ¶meter) + virtual void TellAlreadyOnList(User* source, Channel* channel, std::string ¶meter) { } @@ -462,7 +462,7 @@ class ListModeBase : public ModeHandler * @param channel Channel the parameter is being removed from * @param parameter The actual parameter being removed */ - virtual void TellNotSet(userrec* source, chanrec* channel, std::string ¶meter) + virtual void TellNotSet(User* source, Channel* channel, std::string ¶meter) { } }; diff --git a/include/users.h b/include/users.h index 28bc895a5..915a23c0d 100644 --- a/include/users.h +++ b/include/users.h @@ -85,7 +85,7 @@ class CoreExport UserResolver : public Resolver private: /** User this class is 'attached' to. */ - userrec* bound_user; + User* bound_user; /** File descriptor teh lookup is bound to */ int bound_fd; @@ -100,7 +100,7 @@ class CoreExport UserResolver : public Resolver * @param qt The query type * @param cache Modified by the constructor if the result was cached */ - UserResolver(InspIRCd* Instance, userrec* user, std::string to_resolve, QueryType qt, bool &cache); + UserResolver(InspIRCd* Instance, User* user, std::string to_resolve, QueryType qt, bool &cache); /** Called on successful lookup * @param result Result string @@ -395,7 +395,7 @@ typedef std::vector<ConnectClass> ClassVector; /** Typedef for the list of user-channel records for a user */ -typedef std::map<chanrec*, char> UserChanList; +typedef std::map<Channel*, char> UserChanList; /** Shorthand for an iterator into a UserChanList */ @@ -403,10 +403,10 @@ typedef UserChanList::iterator UCListIter; /* Required forward declaration */ -class userrec; +class User; /** Visibility data for a user. - * If a user has a non-null instance of this class in their userrec, + * If a user has a non-null instance of this class in their User, * then it is used to determine if this user is visible to other users * or not. */ @@ -423,7 +423,7 @@ class CoreExport VisData * @param user The other user to compare to * @return true True if the user is visible to the other user, false if not */ - virtual bool VisibleTo(userrec* user); + virtual bool VisibleTo(User* user); }; /** Holds all information about a user @@ -433,12 +433,12 @@ class CoreExport VisData * by nickname, or the FindDescriptor method of the InspIRCd class to find a specific user by their * file descriptor value. */ -class CoreExport userrec : public connection +class CoreExport User : public connection { private: /** Pointer to creator. * This is required to make use of core functions - * from within the userrec class. + * from within the User class. */ InspIRCd* ServerInstance; @@ -485,14 +485,14 @@ class CoreExport userrec : public connection public: /** Resolvers for looking up this users IP address * This will occur if and when res_reverse completes. - * When this class completes its lookup, userrec::dns_done + * When this class completes its lookup, User::dns_done * will be set from false to true. */ UserResolver* res_forward; /** Resolvers for looking up this users hostname - * This is instantiated by userrec::StartDNSLookup(), - * and on success, instantiates userrec::res_reverse. + * This is instantiated by User::StartDNSLookup(), + * and on success, instantiates User::res_reverse. */ UserResolver* res_reverse; @@ -506,7 +506,7 @@ class CoreExport userrec : public connection /** Starts a DNS lookup of the user's IP. * This will cause two UserResolver classes to be instantiated. - * When complete, these objects set userrec::dns_done to true. + * When complete, these objects set User::dns_done to true. */ void StartDNSLookup(); @@ -529,7 +529,7 @@ class CoreExport userrec : public connection char ident[IDENTMAX+2]; /** The host displayed to non-opers (used for cloaking etc). - * This usually matches the value of userrec::host. + * This usually matches the value of User::host. */ char dhost[65]; @@ -542,7 +542,7 @@ class CoreExport userrec : public connection * this is an array of values in a similar way to channel modes. * A value of 1 in field (modeletter-65) indicates that the mode is * set, for example, to work out if mode +s is set, we check the field - * userrec::modes['s'-65] != 0. + * User::modes['s'-65] != 0. * The following RFC characters o, w, s, i have constants defined via an * enum, such as UM_SERVERNOTICE and UM_OPETATOR. */ @@ -692,7 +692,7 @@ class CoreExport userrec : public connection * @param Instance Creator instance * @param uid User UUID, or empty to allocate one automatically */ - userrec(InspIRCd* Instance, const std::string &uid = ""); + User(InspIRCd* Instance, const std::string &uid = ""); /** Returns the full displayed host of the user * This member function returns the hostname of the user as seen by other users @@ -775,7 +775,7 @@ class CoreExport userrec : public connection virtual void RemoveInvite(const irc::string &channel); /** Returns true or false for if a user can execute a privilaged oper command. - * This is done by looking up their oper type from userrec::oper, then referencing + * This is done by looking up their oper type from User::oper, then referencing * this to their oper classes and checking the commands they can execute. * @param command A command (should be all CAPS) * @return True if this user can execute the command @@ -885,7 +885,7 @@ class CoreExport userrec : public connection * @param oreason The quit reason to show to opers * @return Although this function has no return type, on exit the user provided will no longer exist. */ - static void QuitUser(InspIRCd* Instance, userrec *user, const std::string &r, const char* oreason = ""); + static void QuitUser(InspIRCd* Instance, User *user, const std::string &r, const char* oreason = ""); /** Add the user to WHOWAS system */ @@ -910,9 +910,9 @@ class CoreExport userrec : public connection * You should not call this function directly. It is used by the core * to update the users hash entry on a nickchange. * @param New new user_hash key - * @return Pointer to userrec in hash (usually 'this') + * @return Pointer to User in hash (usually 'this') */ - userrec* UpdateNickHash(const char* New); + User* UpdateNickHash(const char* New); /** Force a nickname change. * If the nickname change fails (for example, because the nick in question @@ -924,7 +924,7 @@ class CoreExport userrec : public connection bool ForceNickChange(const char* newnick); /** Add a client to the system. - * This will create a new userrec, insert it into the user_hash, + * This will create a new User, insert it into the user_hash, * initialize it as not yet registered, and add it to the socket engine. * @param Instance a pointer to the server instance * @param socket The socket id (file descriptor) this user is on @@ -952,7 +952,7 @@ class CoreExport userrec : public connection /** Remove all clone counts from the user, you should * use this if you change the user's IP address in - * userrec::ip after they have registered. + * User::ip after they have registered. */ void RemoveCloneCounts(); @@ -982,27 +982,27 @@ class CoreExport userrec : public connection * @param user The user to prepend the :nick!user@host of * @param text A std::string to send to the user */ - void WriteFrom(userrec *user, const std::string &text); + void WriteFrom(User *user, const std::string &text); /** Write text to this user, appending CR/LF and prepending :nick!user@host of the user provided in the first parameter. * @param user The user to prepend the :nick!user@host of * @param text The format string for text to send to the user * @param ... POD-type format arguments */ - void WriteFrom(userrec *user, const char* text, ...); + void WriteFrom(User *user, const char* text, ...); /** Write text to the user provided in the first parameter, appending CR/LF, and prepending THIS user's :nick!user@host. * @param dest The user to route the message to * @param text A std::string to send to the user */ - void WriteTo(userrec *dest, const std::string &data); + void WriteTo(User *dest, const std::string &data); /** Write text to the user provided in the first parameter, appending CR/LF, and prepending THIS user's :nick!user@host. * @param dest The user to route the message to * @param text The format string for text to send to the user * @param ... POD-type format arguments */ - void WriteTo(userrec *dest, const char *data, ...); + void WriteTo(User *dest, const char *data, ...); /** Write to all users that can see this user (including this user in the list), appending CR/LF * @param text A std::string to send to the users @@ -1026,7 +1026,7 @@ class CoreExport userrec : public connection */ void WriteCommonExcept(const std::string &text); - /** Write a quit message to all common users, as in userrec::WriteCommonExcept but with a specific + /** Write a quit message to all common users, as in User::WriteCommonExcept but with a specific * quit message for opers only. * @param normal_text Normal user quit message * @param oper_text Oper only quit message @@ -1050,10 +1050,10 @@ class CoreExport userrec : public connection * @param other The other user to compare the channel list against * @return True if the given user shares at least one channel with this user */ - bool SharesChannelWith(userrec *other); + bool SharesChannelWith(User *other); /** Change the displayed host of a user. - * ALWAYS use this function, rather than writing userrec::dhost directly, + * ALWAYS use this function, rather than writing User::dhost directly, * as this triggers module events allowing the change to be syncronized to * remote servers. This will also emulate a QUIT and rejoin (where configured) * before setting their host field. @@ -1063,7 +1063,7 @@ class CoreExport userrec : public connection bool ChangeDisplayedHost(const char* host); /** Change the ident (username) of a user. - * ALWAYS use this function, rather than writing userrec::ident directly, + * ALWAYS use this function, rather than writing User::ident directly, * as this correctly causes the user to seem to quit (where configured) * before setting their ident field. * @param host The new ident to set @@ -1072,7 +1072,7 @@ class CoreExport userrec : public connection bool ChangeIdent(const char* newident); /** Change a users realname field. - * ALWAYS use this function, rather than writing userrec::fullname directly, + * ALWAYS use this function, rather than writing User::fullname directly, * as this triggers module events allowing the change to be syncronized to * remote servers. * @param gecos The user's new realname @@ -1095,14 +1095,14 @@ class CoreExport userrec : public connection * @param The user to send the channel list to if it is not too long * @return This user's channel list */ - std::string ChannelList(userrec* source); + std::string ChannelList(User* source); /** Split the channel list in cl which came from dest, and spool it to this user * Used internally by WHOIS * @param dest The user the original channel list came from - * @param cl The channel list as a string obtained from userrec::ChannelList() + * @param cl The channel list as a string obtained from User::ChannelList() */ - void SplitChanList(userrec* dest, const std::string &cl); + void SplitChanList(User* dest, const std::string &cl); /** Remove this user from all channels they are on, and delete any that are now empty. * This is used by QUIT, and will not send part messages! @@ -1142,7 +1142,7 @@ class CoreExport userrec : public connection /** Default destructor */ - virtual ~userrec(); + virtual ~User(); }; /* Configuration callbacks */ diff --git a/include/xline.h b/include/xline.h index bb59a9735..5853e13c4 100644 --- a/include/xline.h +++ b/include/xline.h @@ -440,7 +440,7 @@ class CoreExport XLineManager * @param user The user to check against * @return The reason for the line if there is a match, or NULL if there is no match */ - GLine* matches_gline(userrec* user, bool permonly = false); + GLine* matches_gline(User* user, bool permonly = false); /** Check if a IP matches a ZLine * @param ipaddr The IP to check against @@ -452,13 +452,13 @@ class CoreExport XLineManager * @param user The user to check against * @return The reason for the line if there is a match, or NULL if there is no match */ - KLine* matches_kline(userrec* user, bool permonly = false); + KLine* matches_kline(User* user, bool permonly = false); /** Check if a hostname matches a ELine * @param user The user to check against * @return The reason for the line if there is a match, or NULL if there is no match */ - ELine* matches_exception(userrec* user, bool permonly = false); + ELine* matches_exception(User* user, bool permonly = false); /** Expire any pending non-permenant lines */ @@ -475,31 +475,31 @@ class CoreExport XLineManager * @param user The username making the query * @param results The string_list to receive the results */ - void stats_k(userrec* user, string_list &results); + void stats_k(User* user, string_list &results); /** Handle /STATS G * @param user The username making the query * @param results The string_list to receive the results */ - void stats_g(userrec* user, string_list &results); + void stats_g(User* user, string_list &results); /** Handle /STATS Q * @param user The username making the query * @param results The string_list to receive the results */ - void stats_q(userrec* user, string_list &results); + void stats_q(User* user, string_list &results); /** Handle /STATS Z * @param user The username making the query * @param results The string_list to receive the results */ - void stats_z(userrec* user, string_list &results); + void stats_z(User* user, string_list &results); /** Handle /STATS E * @param user The username making the query * @param results The string_list to receive the results */ - void stats_e(userrec* user, string_list &results); + void stats_e(User* user, string_list &results); /** Change creation time of a GLine * @param host The hostname to change |