]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_nopartmsg.cpp
Fix some of the include guard names (requested by SaberUK)
[user/henk/code/inspircd.git] / src / modules / m_nopartmsg.cpp
index fab20a084913730dcc49d4635a0615c27766932c..51ee659cd6fb665faf467a5c982ca1714bb344fa 100644 (file)
@@ -2,8 +2,8 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
@@ -19,7 +19,7 @@ class ModulePartMsgBan : public Module
 {
  private:
  public:
-       ModulePartMsgBan(InspIRCd* Me) : Module(Me)
+       ModulePartMsgBan()
        {
                Implementation eventlist[] = { I_OnUserPart, I_On005Numeric };
                ServerInstance->Modules->Attach(eventlist, this, 2);
@@ -31,16 +31,16 @@ class ModulePartMsgBan : public Module
 
        virtual Version GetVersion()
        {
-               return Version("$Id$", VF_VENDOR, API_VERSION);
+               return Version("Implements extban +b p: - part message bans", VF_OPTCOMMON|VF_VENDOR);
        }
 
 
-       virtual void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent)
+       virtual void OnUserPart(Membership* memb, std::string &partmessage, CUList& excepts)
        {
-               if (!IS_LOCAL(user))
+               if (!IS_LOCAL(memb->user))
                        return;
 
-               if (channel->IsExtBanned(user, 'p'))
+               if (memb->chan->GetExtBanStatus(memb->user, 'p') == MOD_RES_DENY)
                        partmessage = "";
 
                return;
@@ -48,10 +48,7 @@ class ModulePartMsgBan : public Module
 
        virtual void On005Numeric(std::string &output)
        {
-               if (output.find(" EXTBAN=:") == std::string::npos)
-                       output.append(" EXTBAN=:p");
-               else
-                       output.insert(output.find(" EXTBAN=:") + 9, "p");
+               ServerInstance->AddExtBanChar('p');
        }
 };