class BanRedirect : public ModeWatcher
{
- ModeReference ban;
+ ChanModeReference ban;
public:
SimpleExtItem<BanRedirectList> extItem;
BanRedirect(Module* parent)
{
BanRedirect re;
bool nofollow;
+ ChanModeReference limitmode;
+ ChanModeReference redirectmode;
public:
ModuleBanRedirect()
- : re(this)
+ : re(this)
+ , nofollow(false)
+ , limitmode(this, "limit")
+ , redirectmode(this, "redirect")
{
- nofollow = false;
}
-
void init() CXX11_OVERRIDE
{
ServerInstance->Modes->AddModeWatcher(&re);
std::string destlimit;
if (destchan)
- destlimit = destchan->GetModeParameter('l');
+ destlimit = destchan->GetModeParameter(limitmode);
- if(destchan && ServerInstance->Modules->Find("m_redirect.so") && destchan->IsModeSet('L') && !destlimit.empty() && (destchan->GetUserCounter() >= atoi(destlimit.c_str())))
+ if(destchan && destchan->IsModeSet(redirectmode) && !destlimit.empty() && (destchan->GetUserCounter() >= atoi(destlimit.c_str())))
{
user->WriteNumeric(474, "%s %s :Cannot join channel (You are banned)", user->nick.c_str(), chan->name.c_str());
return MOD_RES_DENY;
{
/* XXX is this the best place to do this? */
if (!ServerInstance->Modes->DelModeWatcher(&re))
- ServerInstance->Logs->Log("m_banredirect.so", LOG_DEBUG, "Failed to delete modewatcher!");
+ ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Failed to delete modewatcher!");
}
Version GetVersion() CXX11_OVERRIDE