]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_delayjoin.cpp
Add the override keyword in places that it is missing.
[user/henk/code/inspircd.git] / src / modules / m_delayjoin.cpp
index 55ffd08d706d649cb03686a78383cf50a2d18524..d26a56568854e46c24c35c9ffc5fe1cf2dc9fe31 100644 (file)
@@ -28,10 +28,10 @@ class DelayJoinMode : public ModeHandler
  public:
        DelayJoinMode(Module* Parent) : ModeHandler(Parent, "delayjoin", 'D', PARAM_NONE, MODETYPE_CHANNEL)
        {
-               levelrequired = OP_VALUE;
+               ranktoset = ranktounset = OP_VALUE;
        }
 
-       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
+       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string& parameter, bool adding) CXX11_OVERRIDE;
 };
 
 class ModuleDelayJoin : public Module
@@ -39,7 +39,9 @@ class ModuleDelayJoin : public Module
        DelayJoinMode djm;
  public:
        LocalIntExt unjoined;
-       ModuleDelayJoin() : djm(this), unjoined("delayjoin", this)
+       ModuleDelayJoin()
+               : djm(this)
+               , unjoined("delayjoin", ExtensionItem::EXT_MEMBERSHIP, this)
        {
        }
 
@@ -138,10 +140,6 @@ void ModuleDelayJoin::OnBuildNeighborList(User* source, IncludeChanList& include
 
 void ModuleDelayJoin::OnText(User* user, void* dest, int target_type, const std::string &text, char status, CUList &exempt_list)
 {
-       /* Server origin */
-       if (!user)
-               return;
-
        if (target_type != TYPE_CHANNEL)
                return;
 
@@ -165,7 +163,11 @@ void ModuleDelayJoin::OnText(User* user, void* dest, int target_type, const std:
 /* make the user visible if he receives any mode change */
 ModResult ModuleDelayJoin::OnRawMode(User* user, Channel* channel, ModeHandler* mh, const std::string& param, bool adding)
 {
-       if (!user || !channel || param.empty())
+       if (!channel || param.empty())
+               return MOD_RES_PASSTHRU;
+
+       // If not a prefix mode then we got nothing to do here
+       if (!mh->IsPrefixMode())
                return MOD_RES_PASSTHRU;
 
        User* dest;