X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_dccallow.cpp;h=e0ea4c7aeed89e7d20ab38cdc05bb0320e4e8ff5;hb=e59cb85871f75b7603c63c6cd274d57536cf6794;hp=2b8d1306cd5f544265f4106063eb895a03db2742;hpb=0ec19b7ac91eedc83b31c3da733e237bfe28fc48;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index 2b8d1306c..e0ea4c7ae 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -25,6 +25,47 @@ #include "inspircd.h" +enum +{ + // From ircd-ratbox. + RPL_HELPSTART = 704, + RPL_HELPTXT = 705, + RPL_ENDOFHELP = 706, + + // InspIRCd-specific? + RPL_DCCALLOWSTART = 990, + RPL_DCCALLOWLIST = 991, + RPL_DCCALLOWEND = 992, + RPL_DCCALLOWTIMED = 993, + RPL_DCCALLOWPERMANENT = 994, + RPL_DCCALLOWREMOVED = 995, + ERR_DCCALLOWINVALID = 996, + RPL_DCCALLOWEXPIRED = 997, + ERR_UNKNOWNDCCALLOWCMD = 998 +}; + +static const char* const helptext[] = +{ + "You may allow DCCs from specific users by specifying a", + "DCC allow for the user you want to receive DCCs from.", + "For example, to allow the user Brain to send you inspircd.exe", + "you would type:", + "/DCCALLOW +Brain", + "Brain would then be able to send you files. They would have to", + "resend the file again if the server gave them an error message", + "before you added them to your DCCALLOW list.", + "DCCALLOW entries will be temporary. If you want to add", + "them to your DCCALLOW list until you leave IRC, type:", + "/DCCALLOW +Brain 0", + "To remove the user from your DCCALLOW list, type:", + "/DCCALLOW -Brain", + "To see the users in your DCCALLOW list, type:", + "/DCCALLOW LIST", + "NOTE: If the user leaves IRC or changes their nickname", + " they will be removed from your DCCALLOW list.", + " Your DCCALLOW list will be deleted when you leave IRC." +}; + class BannedFileList { public: @@ -38,11 +79,17 @@ class DCCAllow std::string nickname; std::string hostmask; time_t set_on; - long length; + unsigned long length; DCCAllow() { } - DCCAllow(const std::string &nick, const std::string &hm, const time_t so, const long ln) : nickname(nick), hostmask(hm), set_on(so), length(ln) { } + DCCAllow(const std::string& nick, const std::string& hm, time_t so, unsigned long ln) + : nickname(nick) + , hostmask(hm) + , set_on(so) + , length(ln) + { + } }; typedef std::vector userlist; @@ -58,6 +105,8 @@ class CommandDccallow : public Command DCCAllowExt& ext; public: + unsigned int maxentries; + unsigned long defaultlength; CommandDccallow(Module* parent, DCCAllowExt& Ext) : Command(parent, "DCCALLOW", 0) , ext(Ext) @@ -66,9 +115,9 @@ class CommandDccallow : public Command /* XXX we need to fix this so it can work with translation stuff (i.e. move +- into a seperate param */ } - CmdResult Handle(const std::vector ¶meters, User *user) + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { - /* syntax: DCCALLOW [+|-] (