]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_nopartmsg.cpp
Fix double dot in half-cloaked resolved hosts
[user/henk/code/inspircd.git] / src / modules / m_nopartmsg.cpp
index f07829acc1b9b92609c66e48917c4d66338e5d8f..27015914733ad44d4a59740500081b6e6120cc55 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-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
@@ -19,8 +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 +30,16 @@ class ModulePartMsgBan : public Module
 
        virtual Version GetVersion()
        {
-               return Version(1,2,0,0,VF_VENDOR,API_VERSION);
+               return Version("Implements extban +b p: - part message bans", VF_COMMON|VF_VENDOR, API_VERSION);
        }
 
 
-    virtual void OnUserPart(User* user, Channel* channel, const 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 +47,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');
        }
 };