]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_dccallow.cpp
m_namesx, m_uhnames Don't convert the command name to irc::string in OnPreCommand()
[user/henk/code/inspircd.git] / src / modules / m_dccallow.cpp
index 0c1c5a18501854338c5cf717fa7ccb724dd491b6..0cea96154d4d8d5e1af49a57314d4e6d48d1c373 100644 (file)
@@ -102,7 +102,7 @@ class CommandDccallow : public Command
                        std::string nick = parameters[0].substr(1);
                        User *target = ServerInstance->FindNickOnly(nick);
 
-                       if (target)
+                       if ((target) && (!IS_SERVER(target)) && (!target->quitting) && (target->registered == REG_ALL))
                        {
 
                                if (action == '-')
@@ -257,7 +257,7 @@ class ModuleDCCAllow : public Module
                ServerInstance->Extensions.Register(ext);
                ServerInstance->AddCommand(&cmd);
                ReadFileConf();
-               Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_OnUserQuit, I_OnUserPreNick, I_OnRehash };
+               Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_OnUserQuit, I_OnUserPostNick, I_OnRehash };
                ServerInstance->Modules->Attach(eventlist, this, 5);
        }
 
@@ -284,10 +284,9 @@ class ModuleDCCAllow : public Module
                RemoveNick(user);
        }
 
-       virtual ModResult OnUserPreNick(User* user, const std::string &newnick)
+       virtual void OnUserPostNick(User* user, const std::string &oldnick)
        {
                RemoveNick(user);
-               return MOD_RES_PASSTHRU;
        }
 
        virtual ModResult OnUserPreMessage(User* user, void* dest, int target_type, std::string &text, char status, CUList &exempt_list)