summaryrefslogtreecommitdiff
path: root/src/mode.cpp
AgeCommit message (Collapse)Author
2008-04-04The start of extended bans infrastructure: syntax is e.g. +b n:w00tdiff@*, ↵w00t
bans of any type can be applied and checked against, but there's more to come with this. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9337 e03df62e-2008-0410-955e-edbf42e46eb7
2008-04-02Fixes for bug #493, tidyups to clearing of channel modes on losing FJOIN. ↵brain
Module unloads may also be tidied at a future date but it means reordering some loops in mode.cpp. See around the comment added. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9283 e03df62e-2008-0410-955e-edbf42e46eb7
2008-04-01Add an optional bool to ModeParser::ModeString() to not give the nickname n ↵brain
times on the end of the string. This can be used for w00ts funky stuff. :-) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9242 e03df62e-2008-0410-955e-edbf42e46eb7
2008-03-23Add ability to control what opertypes can set what operonly user/chan modes. ↵aquanight
This works the same way as commands, in that modes allowed by classes are added together, and * allows all. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9176 e03df62e-2008-0410-955e-edbf42e46eb7
2008-03-22Wheeee for HUGE commits. Convert all numerics to WriteNumeric so that ↵brain
OnNumeric can capture them. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9175 e03df62e-2008-0410-955e-edbf42e46eb7
2008-02-26Fix for bug #466 reported by Johnbrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9042 e03df62e-2008-0410-955e-edbf42e46eb7
2008-02-22Convert remaining InspIRCd::Log() calls to new logging systemaquanight
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9001 e03df62e-2008-0410-955e-edbf42e46eb7
2008-02-20Wheee, mass commit! this adds const stafety, throwing a compile error if ↵brain
anyone does: "parameters[n] = blahvar;" in a command handler etc. where they REALLY SHOULD NOT fuck with the value and should copy the pointer. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8971 e03df62e-2008-0410-955e-edbf42e46eb7
2008-02-18Someone please help me fix the warnings in modules caused by this change. ↵brain
All mode handler OnMode events, ModeWatcher::BeforeMode/AfterMode, plus OnRawMode now have a bool servermode parameter git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8964 e03df62e-2008-0410-955e-edbf42e46eb7
2008-02-14Change string for Om <3brain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8943 e03df62e-2008-0410-955e-edbf42e46eb7
2008-02-14Make AC_OTHERMODE OnAccessCheck call work again.brain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8942 e03df62e-2008-0410-955e-edbf42e46eb7
2008-02-14If the mode defined by the handler is not '\0', but the handler for itbrain
cannot be found, they probably dont have the right module loaded to implement the prefix they want to compare the mode against, e.g. '&' for m_chanprotect. Revert to checking against the minimum core prefix, '%'. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8941 e03df62e-2008-0410-955e-edbf42e46eb7
2008-02-14Reword the failure message to read a little betterbrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8940 e03df62e-2008-0410-955e-edbf42e46eb7
2008-02-14Duh, wasnt working when the user had NO prefixes at all!brain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8939 e03df62e-2008-0410-955e-edbf42e46eb7
2008-02-14That was REALLY dumb. Due to a stupid kludge i did, there was duplicate code ↵brain
and the new permissions stuff was only working against modes with params! git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8938 e03df62e-2008-0410-955e-edbf42e46eb7
2008-02-14All working now, with any luckbrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8936 e03df62e-2008-0410-955e-edbf42e46eb7
2008-02-14New mode stuff. Note, the framework is now here so that every mode handler ↵brain
can state what prefix is required to execute it. For example: You can say that mode +j needs '%' to execute it, so that then only a halfop or above can use mode +j. If you put '@' in this member value, only ops and above can use it. The OnRawMode can return ACR_ALLOW on a case by case basis to totally override this check against the prefix char. If you return ACR_DEFAULT the check goes ahead. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8935 e03df62e-2008-0410-955e-edbf42e46eb7
2008-02-14More OnRawMode fixw00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8932 e03df62e-2008-0410-955e-edbf42e46eb7
2008-02-14Hopefully fix behaviour of OnRawModew00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8931 e03df62e-2008-0410-955e-edbf42e46eb7
2008-02-10More to quiet down. This will be a really tidy looking build for most users nowbrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8880 e03df62e-2008-0410-955e-edbf42e46eb7
2008-02-02Move some stuff to usermanager, remove a little header insanity, remove ↵w00t
trace because it's still less useful than a chocolate fireman. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8790 e03df62e-2008-0410-955e-edbf42e46eb7
2008-01-10Header update: 2007 -> 2008w00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8694 e03df62e-2008-0410-955e-edbf42e46eb7
2008-01-06Hopefully correct implementation of OnRawMode.. can someone pls check this ↵w00t
for me tomorrow. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8654 e03df62e-2008-0410-955e-edbf42e46eb7
2007-11-03Partial fix for bug #441brain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8479 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-23pedantic safebrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8316 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-22Remove the need for a bunch of the hard coded arrays/hashes by scanning the ↵brain
src/ dir for tag comments, like in modules git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8307 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-15In the grand tradition of huge fucking commits:w00t
- chanrec -> Channel - userrec -> User Enjoy. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8204 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-07Support 501 numeric (its different for user modes compared to channel modes) ↵brain
- thanks anmaster git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8134 e03df62e-2008-0410-955e-edbf42e46eb7
2007-08-28Remove some fake client stuff, make it use the global recordw00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7941 e03df62e-2008-0410-955e-edbf42e46eb7
2007-08-27Remove more unnecessary header trafficw00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7887 e03df62e-2008-0410-955e-edbf42e46eb7
2007-08-26Proper fix for end-of-list numerics on restricted lists in bug #386, rather ↵brain
than a hackish nonmodular one. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7838 e03df62e-2008-0410-955e-edbf42e46eb7
2007-07-18Ive tidied up the mode count stuff, but i still cant duplicate negative ↵brain
invisible counts. :( git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7474 e03df62e-2008-0410-955e-edbf42e46eb7
2007-07-16OOPS! We try again, since I'm smoking craq. LF is 0x0a NOT CR.peavey
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7456 e03df62e-2008-0410-955e-edbf42e46eb7
2007-07-16'svn propset -R svn:eol-style CR *' Set to UNIX-style always. Binaries are ↵peavey
auto skipped by svn. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7454 e03df62e-2008-0410-955e-edbf42e46eb7
2007-07-13Explicitly disallow mode prefixes > 126, to prevent excess muppetry by 3rd ↵brain
party module devs git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7438 e03df62e-2008-0410-955e-edbf42e46eb7
2007-07-01Compile fixesbrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7417 e03df62e-2008-0410-955e-edbf42e46eb7
2007-07-01Optimizations and code tidyups. QA please check that svsnick and other ↵brain
forced nick changes still work right after this git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7416 e03df62e-2008-0410-955e-edbf42e46eb7
2007-06-12Fix advertising of +h/% in 005 and 004 numerics when halfops are not enabled ↵brain
in the conf, spotted by Smartys, fixes bug #322 git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7282 e03df62e-2008-0410-955e-edbf42e46eb7
2007-06-09Change some = "" to clear() and some == "" to .empty()brain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7263 e03df62e-2008-0410-955e-edbf42e46eb7
2007-05-30Fix bug #310 reported by Smartys, and optimize mode.cpp a bit (was using ↵brain
string comparison to identify an empty string, e.g. somestr == "", when we can use the much faster somestr.empty()) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7191 e03df62e-2008-0410-955e-edbf42e46eb7
2007-05-19Fix std::sort stuff for w00tbrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7050 e03df62e-2008-0410-955e-edbf42e46eb7
2007-05-12We've had an IS_OPER macro for a long time. About time we started using it, ↵w00t
maybe? :p git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6990 e03df62e-2008-0410-955e-edbf42e46eb7
2007-05-04foolish human! you can't /mode query a user that isnt there!brain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6871 e03df62e-2008-0410-955e-edbf42e46eb7
2007-05-04Where others charge, we give for free. Have fun and use wisely. With great ↵brain
power comes great responsbility. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6867 e03df62e-2008-0410-955e-edbf42e46eb7
2007-05-01Move new listmode check deeper into the mode parser so that it doesnt ↵brain
generate spurious craq (thanks HiroP_) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6853 e03df62e-2008-0410-955e-edbf42e46eb7
2007-04-30Fix one issue, add another feature: When sending MODE +beI, weed out ↵brain
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
2007-04-27Add support for hiding listmode lists such as +beI from unprivileged users.brain
See bug #258 git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6849 e03df62e-2008-0410-955e-edbf42e46eb7
2007-02-09Change the constructor of ModeParser, make it just a tiny bit prettier.brain
Rather than calling AddMode like 25 times, put them in a nice looking array and call it in a loop, doesnt look as craqy (although its exactly the same thing with makeup on) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6555 e03df62e-2008-0410-955e-edbf42e46eb7
2007-01-20Better way even than suggested.brain
We need one counter, nonlistmodes_found, and start with it at 0. In the while loop, if we find any modes that arent of list mode type we inc the counter, and if the counter is zero after the end of the loop, we can just return (we processed everything already and nothing is left) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6401 e03df62e-2008-0410-955e-edbf42e46eb7
2007-01-15Crusade to remove debug from stable and tested parts of the core and base ↵brain
modules. Most of the code here being de-noised hasnt had a crash or bug in it for many months, if not a year so the debug output is useless noise in the logfile when trying to trace a bug in a REAL problem area. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6356 e03df62e-2008-0410-955e-edbf42e46eb7