public:
ModuleQuietBan(InspIRCd* Me) : Module(Me)
{
- Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice };
- ServerInstance->Modules->Attach(eventlist, this, 2);
+ Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_On005Numeric };
+ ServerInstance->Modules->Attach(eventlist, this, 3);
}
virtual ~ModuleQuietBan()
virtual int OnUserPreMessage(User *user, void *dest, int target_type, std::string &text, char status, CUList &exempt_list)
{
+ if (!IS_LOCAL(user))
+ return 0;
+
if (target_type == TYPE_CHANNEL)
{
if (((Channel *)dest)->IsExtBanned(user, 'q'))
virtual int OnUserPreNotice(User *user, void *dest, int target_type, std::string &text, char status, CUList &exempt_list)
{
+ if (!IS_LOCAL(user))
+ return 0;
+
if (target_type == TYPE_CHANNEL)
{
if (((Channel *)dest)->IsExtBanned(user, 'q'))
return 0;
}
+
+ virtual void On005Numeric(std::string &output)
+ {
+ if (output.find(" EXTBAN=:") == std::string::npos)
+ output.append(" EXTBAN=:q");
+ else
+ output.insert(output.find(" EXTBAN=:") + 9, "q");
+ }
};