summaryrefslogtreecommitdiff
path: root/src/mode.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-04-30 16:50:08 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-04-30 16:50:08 +0000
commit569114e4c2f8ef8b14d48d4a94d7226e7f87eaff (patch)
tree314b4f7b90af7297d99568aee3509f5b5eeca73e /src/mode.cpp
parent395666b7e9dbeffe9c2e570ee08529d613ece93b (diff)
Fix one issue, add another feature: When sending MODE +beI, weed out duplicates with simple O(1) check so that users dont send MODE #chan +bbbbbbbbbbbb.
Allow configuration of which listmodes you want to deny to below halfops. For example <options hidemodes="eI">. This is because blocking +b can break mirc, blocking +eI usually wont break it so severely. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6852 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/mode.cpp')
-rw-r--r--src/mode.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 5e384ad9a..0229eddb1 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -283,8 +283,11 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool
{
const char* mode = parameters[1];
int nonlistmodes_found = 0;
+ bool sent[256];
mask = MASK_CHANNEL;
+
+ memset(&sent, 0, 256);
while (mode && *mode)
{
@@ -294,7 +297,20 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool
continue;
}
- if (ServerInstance->Config->HideModeLists && (targetchannel->GetStatus(user) < STATUS_HOP))
+ /* Ensure the user doesnt request the same mode twice,
+ * so they cant flood themselves off out of idiocy.
+ */
+ if (!sent[*mode])
+ {
+ sent[*mode] = true;
+ }
+ else
+ {
+ mode++;
+ continue;
+ }
+
+ if (ServerInstance->Config->HideModeLists[*mode] && (targetchannel->GetStatus(user) < STATUS_HOP))
{
user->WriteServ("482 %s %s :Only half-operators and above may view the +%c list",user->nick, targetchannel->name, *mode++);
continue;