1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
16 /* $ModDesc: Implements extban +b j: - matching channel bans */
18 class ModuleBadChannelExtban : public Module
22 ModuleBadChannelExtban(InspIRCd* Me) : Module(Me)
24 Implementation eventlist[] = { I_OnUserPreJoin, I_On005Numeric };
25 ServerInstance->Modules->Attach(eventlist, this, 2);
28 virtual ~ModuleBadChannelExtban()
32 virtual Version GetVersion()
34 return Version("$Id$", VF_VENDOR,API_VERSION);
37 virtual int OnUserPreJoin(User *user, Channel *c, const char *cname, std::string &privs, const std::string &key)
46 for (UCListIter i = user->chans.begin(); i != user->chans.end(); i++)
48 if (c->IsExtBanned(i->first->name, 'j'))
50 user->WriteNumeric(ERR_BANNEDFROMCHAN, "%s %s :Cannot join channel (You're banned)", user->nick.c_str(), c->name.c_str());
58 virtual void On005Numeric(std::string &output)
60 ServerInstance->AddExtBanChar('j');
65 MODULE_INIT(ModuleBadChannelExtban)