]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_delayjoin.cpp
Merge pull request #1337 from SaberUK/master+merge
[user/henk/code/inspircd.git] / src / modules / m_delayjoin.cpp
index 55ffd08d706d649cb03686a78383cf50a2d18524..e864a8289c75e0f8d6be6b174fc7f33f4c65524c 100644 (file)
@@ -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;