diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/account.h | 6 | ||||
-rw-r--r-- | include/extern.h | 1 | ||||
-rw-r--r-- | include/modules.h | 22 | ||||
-rw-r--r-- | include/services.h | 15 | ||||
-rw-r--r-- | include/users.h | 14 |
5 files changed, 25 insertions, 33 deletions
diff --git a/include/account.h b/include/account.h index 3f39c3b4a..25c3ff87d 100644 --- a/include/account.h +++ b/include/account.h @@ -145,18 +145,18 @@ class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag> * @param cmdstr The string to check, e.g. botserv/set/private. * @return True if this opertype may run the specified command, false otherwise. */ - bool HasCommand(const std::string &cmdstr) const; + virtual bool HasCommand(const std::string &cmdstr) const; /** Checks whether this account is a services oper or not. * @return True if this account is a services oper, false otherwise. */ - bool IsServicesOper() const; + virtual bool IsServicesOper() const; /** Check whether this opertype has access to the given special permission. * @param privstr The priv to check for, e.g. users/auspex. * @return True if this opertype has the specified priv, false otherwise. */ - bool HasPriv(const std::string &privstr) const; + virtual bool HasPriv(const std::string &privstr) const; /** Add an entry to the nick's access list * diff --git a/include/extern.h b/include/extern.h index d20f28c59..a46314081 100644 --- a/include/extern.h +++ b/include/extern.h @@ -337,6 +337,7 @@ E void ntoa(struct in_addr addr, char *ipaddr, int len); E std::list<std::string> BuildStringList(const std::string &); E std::list<ci::string> BuildStringList(const ci::string &); +E std::vector<std::string> BuildStringVector(const std::string &); E void binary_to_hex(unsigned char *bin, char *hex, int length); diff --git a/include/modules.h b/include/modules.h index cbb3a6eb3..4a94cd830 100644 --- a/include/modules.h +++ b/include/modules.h @@ -811,25 +811,25 @@ class CoreExport Module /** Called when access is deleted from a channel * @param ci The channel * @param u The user who removed the access - * @param nick The name of the user whos access was removed + * @param nc The user who was deleted */ - virtual void OnAccessDel(ChannelInfo *ci, User *u, const char *nick) { } + virtual void OnAccessDel(ChannelInfo *ci, User *u, NickCore *nc) { } /** Called when access is changed * @param ci The channel * @param u The user who changed the access - * @param nick The nick whos access was changed + * @param na The nick whos access was changed * @param level The level of the new access */ - virtual void OnAccessChange(ChannelInfo *ci, User *u, const char *nick, int level) { } + virtual void OnAccessChange(ChannelInfo *ci, User *u, NickAlias *na, int level) { } /** Called when access is added * @param ci The channel * @param u The user who added the access - * @param nick The nick who was added to access + * @para na The nick who was added to access * @param level The level they were added at */ - virtual void OnAccessAdd(ChannelInfo *ci, User *u, const char *nick, int level) { } + virtual void OnAccessAdd(ChannelInfo *ci, User *u, NickAlias *na, int level) { } /** Called when the access list is cleared * @param ci The channel @@ -840,7 +840,7 @@ class CoreExport Module /** Called when a channel is dropped * @param chname The channel name */ - virtual void OnChanDrop(const char *chname) { } + virtual void OnChanDrop(const std::string &chname) { } /** Called when a channel is forbidden * @param ci The channel @@ -968,6 +968,12 @@ class CoreExport Module */ virtual void OnNickClearAccess(NickCore *nc) { } + /** Called when a user adds an entry to their access list + * @param nc The nick + * @param entry The entry + */ + virtual void OnNickAddAccess(NickCore *nc, const std::string &entry) { } + /** called from NickCore::EraseAccess() * @param nc pointer to the NickCore * @param entry The access mask @@ -1060,7 +1066,7 @@ enum Implementation I_OnNickServHelp, I_OnPreNickExpire, I_OnNickExpire, I_OnNickForbidden, I_OnNickGroup, I_OnNickLogout, I_OnNickIdentify, I_OnNickDrop, I_OnNickRegister, I_OnNickSuspended, I_OnNickUnsuspended, I_OnFindUser, I_OnFindNick, I_OnDelNick, I_OnFindCore, I_OnDelCore, I_OnChangeCoreDisplay, - I_OnFindRequestNick, I_OnDelNickRequest, I_OnMakeNickRequest, I_OnNickClearAccess, I_OnNickEraseAccess, + I_OnFindRequestNick, I_OnDelNickRequest, I_OnMakeNickRequest, I_OnNickClearAccess, I_OnNickAddAccess, I_OnNickEraseAccess, /* ChanServ */ I_OnChanServHelp, I_OnChanForbidden, I_OnChanSuspend, I_OnChanDrop, I_OnPreChanExpire, I_OnChanExpire, I_OnAccessAdd, I_OnAccessChange, diff --git a/include/services.h b/include/services.h index 1901e6b86..10304c757 100644 --- a/include/services.h +++ b/include/services.h @@ -422,21 +422,6 @@ struct ircdvars_ { /*************************************************************************/ -/* File version for each database. Was one version for all before but was - changed so they are now easier to maintain. =) */ - -#define BOT_VERSION 10 -#define CHAN_VERSION 16 -#define EXCEPTION_VERSION 9 -#define NEWS_VERSION 9 -#define NICK_VERSION 14 -#define PRE_NICK_VERSION 2 -#define OPER_VERSION 13 -#define HELP_VERSION 1 -#define HOST_VERSION 3 - -/*************************************************************************/ - /** Memo Flags */ enum MemoFlag diff --git a/include/users.h b/include/users.h index 525df393b..0d701f839 100644 --- a/include/users.h +++ b/include/users.h @@ -23,7 +23,7 @@ typedef std::list<ChannelContainer *> UChannelList; /* Online user and channel data. */ class CoreExport User : public Extensible { - private: + protected: std::string vident; std::string ident; std::string uid; @@ -76,7 +76,7 @@ class CoreExport User : public Extensible /** Update the nickname of a user record accordingly, should be * called from ircd protocol. */ - void SetNewNick(const std::string &newnick); + virtual void SetNewNick(const std::string &newnick); /** Update the displayed (vhost) of a user record. * This is used (if set) instead of real host. @@ -140,8 +140,8 @@ class CoreExport User : public Extensible * @param fmt Format of the Message * @param ... any number of parameters */ - void SendMessage(const std::string &source, const char *fmt, ...); - void SendMessage(const std::string &source, const std::string &msg); + virtual void SendMessage(const std::string &source, const char *fmt, ...); + virtual void SendMessage(const std::string &source, const std::string &msg); /** Check if the user should become identified because * their svid matches the one stored in their nickcore @@ -166,17 +166,17 @@ class CoreExport User : public Extensible /** Get the account the user is logged in using * @reurn The account or NULL */ - NickCore *Account() const; + virtual NickCore *Account() const; /** Check if the user is identified for their nick * @return true or false */ - const bool IsIdentified() const; + virtual const bool IsIdentified() const; /** Check if the user is recognized for their nick (on the nicks access list) * @return true or false */ - const bool IsRecognized() const; + virtual const bool IsRecognized() const; /** Update the last usermask stored for a user, and check to see if they are recognized */ |