X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_dccallow.cpp;h=0cea96154d4d8d5e1af49a57314d4e6d48d1c373;hb=b5b17f22e98ce06bc639edede60784bb1988a9e5;hp=0c1c5a18501854338c5cf717fa7ccb724dd491b6;hpb=98a932f819e2f55dc3fafb160d55a1aa57a3d5cf;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index 0c1c5a185..0cea96154 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -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)