class BanException : public ListModeBase
{
public:
- BanException(InspIRCd* Instance) : ListModeBase(Instance, 'e', "End of Channel Exception List", "348", "349", true) { }
+ BanException(InspIRCd* Instance) : ListModeBase(Instance, 'e', "End of Channel Exception List", 348, 349, true) { }
};
ModuleBanException(InspIRCd* Me) : Module(Me)
{
be = new BanException(ServerInstance);
- if (!ServerInstance->AddMode(be))
+ if (!ServerInstance->Modes->AddMode(be))
throw ModuleException("Could not add new modes!");
ServerInstance->Modules->PublishInterface("ChannelBanList", this);
modelist* list;
chan->GetExt(be->GetInfoKey(), list);
- if (list)
+ if (!list)
{
- char mask[MAXBUF];
- snprintf(mask, MAXBUF, "%s!%s@%s", user->nick, user->ident, user->GetIPString());
- for (modelist::iterator it = list->begin(); it != list->end(); it++)
+ // No list, proceed normally
+ return 0;
+ }
+
+ char mask[MAXBUF];
+ snprintf(mask, MAXBUF, "%s!%s@%s", user->nick, user->ident, user->GetIPString());
+
+ for (modelist::iterator it = list->begin(); it != list->end(); it++)
+ {
+ if (match(user->GetFullRealHost(), it->mask.c_str()) || match(user->GetFullHost(), it->mask.c_str()) || (match(mask, it->mask.c_str(), true)))
{
- if (match(user->GetFullRealHost(), it->mask.c_str()) || match(user->GetFullHost(), it->mask.c_str()) || (match(mask, it->mask.c_str(), true)))
- {
- // They match an entry on the list, so let them in.
- return 1;
- }
+ // They match an entry on the list, so let them in.
+ return 1;
}
- return 0;
}
- // or if there wasn't a list, there can't be anyone on it, so we don't need to do anything.
}
return 0;
}
be->DoRehash();
}
- virtual char* OnRequest(Request* request)
+ virtual const char* OnRequest(Request* request)
{
ListModeRequest* LM = (ListModeRequest*)request;
if (strcmp("LM_CHECKLIST", request->GetId()) == 0)
virtual Version GetVersion()
{
- return Version(1, 1, 0, 3, VF_COMMON | VF_VENDOR, API_VERSION);
+ return Version(1, 2, 0, 3, VF_COMMON | VF_VENDOR, API_VERSION);
}
virtual ~ModuleBanException()