]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_nopartmsg.cpp
Update copyright headers.
[user/henk/code/inspircd.git] / src / modules / m_nopartmsg.cpp
index 0c566057128c20b648b75af858d42cc703b48ba3..1bae1f80836b6df1e15c6f605a1f2f45659d6b65 100644 (file)
@@ -1,6 +1,12 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
+ *   Copyright (C) 2013, 2021 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2012 Robby <robby@chatbelgie.be>
+ *   Copyright (C) 2012 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2010 Craig Edwards <brain@inspircd.org>
+ *   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>
  *   Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
 
 #include "inspircd.h"
 
-/* $ModDesc: Implements extban +b p: - part message bans */
-
 class ModulePartMsgBan : public Module
 {
- private:
  public:
-       ModulePartMsgBan()
-       {
-               Implementation eventlist[] = { I_OnUserPart, I_On005Numeric };
-               ServerInstance->Modules->Attach(eventlist, this, 2);
-       }
-
-       virtual ~ModulePartMsgBan()
+       Version GetVersion() CXX11_OVERRIDE
        {
+               return Version("Adds extended ban p: which blocks the part message of matching users.", VF_OPTCOMMON|VF_VENDOR);
        }
 
-       virtual Version GetVersion()
-       {
-               return Version("Implements extban +b p: - part message bans", VF_OPTCOMMON|VF_VENDOR);
-       }
-
-
-       virtual void OnUserPart(Membership* memb, std::string &partmessage, CUList& excepts)
+       void OnUserPart(Membership* memb, std::string &partmessage, CUList& excepts) CXX11_OVERRIDE
        {
                if (!IS_LOCAL(memb->user))
                        return;
 
                if (memb->chan->GetExtBanStatus(memb->user, 'p') == MOD_RES_DENY)
-                       partmessage = "";
-
-               return;
+                       partmessage.clear();
        }
 
-       virtual void On005Numeric(std::string &output)
+       void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
        {
-               ServerInstance->AddExtBanChar('p');
+               tokens["EXTBAN"].push_back('p');
        }
 };
 
-
 MODULE_INIT(ModulePartMsgBan)
-