aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar special2008-10-15 23:23:38 +0000
committerGravatar special2008-10-15 23:23:38 +0000
commit2f80da52eae980a0bea79ce4edeef80a4a9153b2 (patch)
tree9f0356013a3b89a7373069c2ae50568048d0534a /src
parentBackport leak fix on helpop config reading, thanks Macgyver. (diff)
Numerous fixes for m_dccallow - only the first banfile tag mattered, improper behavior with no banfile tags, incorrect check for adding yourself to the dccallow list, and several cosmetic issues.
git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@10647 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_dccallow.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp
index b12824cc9..f0ce46af0 100644
--- a/src/modules/m_dccallow.cpp
+++ b/src/modules/m_dccallow.cpp
@@ -84,6 +84,11 @@ class cmd_dccallow : public command_t
DisplayHelp(user);
return CMD_FAILURE;
}
+ else
+ {
+ user->WriteServ("998 %s :DCCALLOW command not understood. For help on DCCALLOW, type /DCCALLOW HELP", user->nick);
+ return CMD_FAILURE;
+ }
}
std::string nick = parameters[0] + 1;
@@ -127,6 +132,12 @@ class cmd_dccallow : public command_t
}
else if (action == '+')
{
+ if (target == user)
+ {
+ user->WriteServ("996 %s %s :You cannot add yourself to your own DCCALLOW list!", user->nick, user->nick);
+ return CMD_FAILURE;
+ }
+
if (!user->GetExt("dccallow_list", dl))
{
dl = new dccallowlist;
@@ -134,6 +145,7 @@ class cmd_dccallow : public command_t
// add this user to the userlist
ul.push_back(user);
}
+
for (dccallowlist::const_iterator k = dl->begin(); k != dl->end(); ++k)
{
if (k->nickname == target->nick)
@@ -141,11 +153,6 @@ class cmd_dccallow : public command_t
user->WriteServ("996 %s %s :%s is already on your DCCALLOW list", user->nick, user->nick, target->nick);
return CMD_FAILURE;
}
- else if (ServerInstance->MatchText(user->GetFullHost(), k->hostmask))
- {
- user->WriteServ("996 %s %s :You cannot add yourself to your own DCCALLOW list!", user->nick, user->nick);
- return CMD_FAILURE;
- }
}
std::string mask = std::string(target->nick)+"!"+std::string(target->ident)+"@"+std::string(target->dhost);
@@ -352,11 +359,13 @@ class ModuleDCCAllow : public Module
if (defaultaction == "allow")
return 0;
}
- user->WriteServ("NOTICE %s :The user %s is not accepting DCC SENDs from you. Your file %s was not sent.", user->nick, u->nick, filename.c_str());
- u->WriteServ("NOTICE %s :%s (%s@%s) attempted to send you a file named %s, which was blocked.", u->nick, user->nick, user->ident, user->dhost, filename.c_str());
- u->WriteServ("NOTICE %s :If you trust %s and were expecting this, you can type /DCCALLOW HELP for information on the DCCALLOW system.", u->nick, user->nick);
- return 1;
}
+
+ user->WriteServ("NOTICE %s :The user %s is not accepting DCC SENDs from you. Your file %s was not sent.", user->nick, u->nick, filename.c_str());
+ u->WriteServ("NOTICE %s :%s (%s@%s) attempted to send you a file named %s, which was blocked.", u->nick, user->nick, user->ident, user->dhost, filename.c_str());
+ u->WriteServ("NOTICE %s :If you trust %s and were expecting this, you can type /DCCALLOW HELP for information on the DCCALLOW system.", u->nick, user->nick);
+
+ return 1;
}
else if ((type == "CHAT") && (blockchat))
{