X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_delayjoin.cpp;h=1a84ee694a82d802c20b8d002670029ab706b47c;hb=9336468f5bfa60318cb57db5126047147b7a21cb;hp=a7a8575b4c7a19bff41d7ccd08fe79269b6312a7;hpb=d9e3bb8d4343643504ab7ee6ab943a000065cc8a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_delayjoin.cpp b/src/modules/m_delayjoin.cpp index a7a8575b4..1a84ee694 100644 --- a/src/modules/m_delayjoin.cpp +++ b/src/modules/m_delayjoin.cpp @@ -19,7 +19,7 @@ class DelayJoinMode : public ModeHandler private: CUList empty; public: - DelayJoinMode(InspIRCd* Instance, Module* Parent) : ModeHandler(Parent, 'D', PARAM_NONE, MODETYPE_CHANNEL) + DelayJoinMode(Module* Parent) : ModeHandler(Parent, 'D', PARAM_NONE, MODETYPE_CHANNEL) { levelrequired = OP_VALUE; } @@ -32,7 +32,7 @@ class ModuleDelayJoin : public Module DelayJoinMode djm; public: LocalIntExt unjoined; - ModuleDelayJoin(InspIRCd* Me) : Module(Me), djm(Me, this), unjoined("delayjoin", this) + ModuleDelayJoin() : djm(this), unjoined("delayjoin", this) { if (!ServerInstance->Modes->AddMode(&djm)) throw ModuleException("Could not add new modes!"); @@ -75,12 +75,11 @@ ModeAction DelayJoinMode::OnModeChange(User* source, User* dest, Channel* channe ModuleDelayJoin::~ModuleDelayJoin() { - ServerInstance->Modes->DelMode(&djm); } Version ModuleDelayJoin::GetVersion() { - return Version("$Id$", VF_COMMON | VF_VENDOR); + return Version("Allows for delay-join channels (+D) where users dont appear to join until they speak", VF_COMMON | VF_VENDOR); } void ModuleDelayJoin::OnNamesListItem(User* issuer, Membership* memb, std::string &prefixes, std::string &nick) @@ -128,8 +127,17 @@ void ModuleDelayJoin::OnUserKick(User* source, Membership* memb, const std::stri ModResult ModuleDelayJoin::OnHostCycle(User* user) { - // TODO - return MOD_RES_DENY; + for (UCListIter f = user->chans.begin(); f != user->chans.end(); f++) + { + Channel* chan = *f; + Membership* memb = chan->GetUser(user); + + if (memb && unjoined.get(memb)) + { + return MOD_RES_DENY; + } + } + return MOD_RES_PASSTHRU; } void ModuleDelayJoin::OnUserQuit(User* user, const std::string &reason, const std::string &oper_message)