1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 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 q: - quiet bans */
18 class ModuleQuietBan : public Module
22 ModuleQuietBan(InspIRCd* Me) : Module(Me)
24 Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_On005Numeric };
25 ServerInstance->Modules->Attach(eventlist, this, 3);
28 virtual ~ModuleQuietBan()
32 virtual Version GetVersion()
34 return Version(1,2,0,0,VF_VENDOR,API_VERSION);
37 virtual int OnUserPreMessage(User *user, void *dest, int target_type, std::string &text, char status, CUList &exempt_list)
42 if (target_type == TYPE_CHANNEL)
44 if (((Channel *)dest)->IsExtBanned(user, 'q'))
46 user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Cannot send to " + ((Channel *)dest)->name + ", as you are muted");
54 virtual int OnUserPreNotice(User *user, void *dest, int target_type, std::string &text, char status, CUList &exempt_list)
59 if (target_type == TYPE_CHANNEL)
61 if (((Channel *)dest)->IsExtBanned(user, 'q'))
63 user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Cannot send to " + ((Channel *)dest)->name + ", as you are muted");
71 virtual void On005Numeric(std::string &output)
73 if (output.find(" EXTBAN=:") == std::string::npos)
74 output.append(" EXTBAN=:q");
76 output.insert(output.find(" EXTBAN=:") + 9, "q");
81 MODULE_INIT(ModuleQuietBan)