summaryrefslogtreecommitdiff
path: root/src/mode.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix std::sort stuff for w00tGravatar brain2007-05-191-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7050 e03df62e-2008-0410-955e-edbf42e46eb7
* We've had an IS_OPER macro for a long time. About time we started using it, ↵Gravatar w00t2007-05-121-3/+3
| | | | | | maybe? :p git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6990 e03df62e-2008-0410-955e-edbf42e46eb7
* foolish human! you can't /mode query a user that isnt there!Gravatar brain2007-05-041-0/+6
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6871 e03df62e-2008-0410-955e-edbf42e46eb7
* Where others charge, we give for free. Have fun and use wisely. With great ↵Gravatar brain2007-05-041-1/+18
| | | | | | power comes great responsbility. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6867 e03df62e-2008-0410-955e-edbf42e46eb7
* Move new listmode check deeper into the mode parser so that it doesnt ↵Gravatar brain2007-05-011-8/+10
| | | | | | generate spurious craq (thanks HiroP_) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6853 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix one issue, add another feature: When sending MODE +beI, weed out ↵Gravatar brain2007-04-301-1/+17
| | | | | | | | | | 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
* Add support for hiding listmode lists such as +beI from unprivileged users.Gravatar brain2007-04-271-0/+6
| | | | | | | See bug #258 git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6849 e03df62e-2008-0410-955e-edbf42e46eb7
* Change the constructor of ModeParser, make it just a tiny bit prettier.Gravatar brain2007-02-091-25/+29
| | | | | | | 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
* Better way even than suggested.Gravatar brain2007-01-201-0/+7
| | | | | | | | 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
* Crusade to remove debug from stable and tested parts of the core and base ↵Gravatar brain2007-01-151-22/+0
| | | | | | | | | | 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
* Make this use true and false, not MODEACTION_DENYGravatar brain2007-01-151-2/+2
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6349 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix the code that nobody tested :pGravatar brain2007-01-141-4/+6
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6331 e03df62e-2008-0410-955e-edbf42e46eb7
* And take the return out again to stop w00t throwing a tantrumGravatar om2007-01-141-2/+0
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6330 e03df62e-2008-0410-955e-edbf42e46eb7
* Add return statement at the end of the special-case block for listing listmodes.Gravatar om2007-01-141-1/+18
| | | | | | Make ModeWatchers get called (with an empty parameter and adding = true) if their mode is a listmode and it gets listed git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6329 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix this so that if the beforemode clears the parameter, and it was supposed ↵Gravatar brain2007-01-141-0/+7
| | | | | | to have one, we abort git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6327 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix BeforeMode to have the parameter available, if there are enough ↵Gravatar brain2007-01-141-6/+13
| | | | | | parameters for the mode and the mode parameter is valid git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6326 e03df62e-2008-0410-955e-edbf42e46eb7
* Tweaks to mode parserGravatar brain2007-01-081-2/+4
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6265 e03df62e-2008-0410-955e-edbf42e46eb7
* Extra check so that we dont get -O-s when doing:Gravatar brain2007-01-061-1/+8
| | | | | | | | | | MODE #chan +Osnt MODE #chan -O+n-s (the +n would get dropped, but the - and the s get put in the mode sequence) To fix, we store the last *successful* state change, as well as the last attempted state change. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6235 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix desync with halfop and voice when opped (this happens because we were ↵Gravatar brain2007-01-061-0/+5
| | | | | | ORing the wrong value in chanrec::ForceChan) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6232 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix lusers breakage introduced by latest set of optimizationsGravatar brain2007-01-031-0/+5
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6219 e03df62e-2008-0410-955e-edbf42e46eb7
* Add counter system for umodes to get rid of some O(n)Gravatar brain2006-12-291-1/+6
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6163 e03df62e-2008-0410-955e-edbf42e46eb7
* Hash rehashing changeGravatar brain2006-12-231-2/+2
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6080 e03df62e-2008-0410-955e-edbf42e46eb7
* Reduce logging caused by mode changesGravatar brain2006-12-221-4/+0
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6060 e03df62e-2008-0410-955e-edbf42e46eb7
* Avoid no such nick on non oper attempting to view modes of a user.Gravatar w00t2006-12-181-0/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6047 e03df62e-2008-0410-955e-edbf42e46eb7
* Jesus, look who's the commit whore today. More header updates, and removal ↵Gravatar w00t2006-12-151-9/+4
| | | | | | of namespacing. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5996 e03df62e-2008-0410-955e-edbf42e46eb7
* Refactor userrec::chans.Gravatar brain2006-12-141-44/+38
| | | | | | | | | Old way: A vector of ucrec, MAXCHANS in size by default populated by NULLS, so you have to scan the vector to find an empty slot when joining a user, parting a user etc New way: std::map<chanrec*, char> (the char holds their basic core permissions on the channel [voice, halfop, op]) This increases speed a ton, and removes some wtf-age. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5986 e03df62e-2008-0410-955e-edbf42e46eb7
* LOL INFINITE LOOPS IN IRCD ARE ROXGravatar w00t2006-12-031-0/+3
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5834 e03df62e-2008-0410-955e-edbf42e46eb7
* That patch (TM) of controversy, plus a minor cleanupGravatar w00t2006-12-021-7/+13
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5830 e03df62e-2008-0410-955e-edbf42e46eb7
* Disallow mode prefix # since it will mess up /whois and /privmsgGravatar peavey2006-11-221-1/+2
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5786 e03df62e-2008-0410-955e-edbf42e46eb7
* Don't allow a non-oper to view another users modes. This slightly tweaks the ↵Gravatar brain2006-11-151-5/+17
| | | | | | | | | rfc, because the rfc says even opers shouldnt be able to view modes but thats just a backwards pain in the neck. Also, remove the system from 1.0 whereby an oper CAN change a non-opers modes (except +o) because all this did was confuse services packages. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5748 e03df62e-2008-0410-955e-edbf42e46eb7
* Show chanrec::age in MODE #chan, not the deprecated chanrec::createdGravatar brain2006-11-121-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5717 e03df62e-2008-0410-955e-edbf42e46eb7
* * Fix removal of user modes when unloading the mode letter (this actually ↵Gravatar brain2006-10-281-7/+1
| | | | | | | | | works now) * Fix m_stripcolor channel mode +S (was unsettable as it had some user mode checks in it) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5577 e03df62e-2008-0410-955e-edbf42e46eb7
* /me thwaps special for not reading comments :pGravatar brain2006-10-061-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5445 e03df62e-2008-0410-955e-edbf42e46eb7
* Extra safety checking in ModeSet just to ensure we cant be passed a null pointerGravatar brain2006-10-041-0/+3
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5411 e03df62e-2008-0410-955e-edbf42e46eb7
* Add an extra debug message and change two calls of GetModeType to ↵Gravatar om2006-10-011-2/+4
| | | | | | GetModeChar as I'm 99.9% sure they should be git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5376 e03df62e-2008-0410-955e-edbf42e46eb7
* It all came down to a >1 where we needed a >0. Things should be stable now jamieGravatar brain2006-10-011-1/+4
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5375 e03df62e-2008-0410-955e-edbf42e46eb7
* Take some debug crap out of ModeParser::ModeString()Gravatar brain2006-09-101-1/+0
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5209 e03df62e-2008-0410-955e-edbf42e46eb7
* * Fix ChanModes::ModeString to not try and set a key as a user mode ;)Gravatar brain2006-09-101-1/+2
| | | | | | | * Tweak the way cyclehosts works, so that mode change is not echoed back to user who changes their host/ident git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5208 e03df62e-2008-0410-955e-edbf42e46eb7
* Reset LastParse string when we try to parse new modesGravatar brain2006-09-091-0/+2
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5188 e03df62e-2008-0410-955e-edbf42e46eb7
* Tidier string buildingGravatar brain2006-09-091-12/+4
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5185 e03df62e-2008-0410-955e-edbf42e46eb7
* Make SAMODE oper output tidierGravatar brain2006-09-091-0/+24
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5184 e03df62e-2008-0410-955e-edbf42e46eb7
* And fix it so it doesnt go into an infinite loop when meeting the end ↵Gravatar brain2006-09-091-1/+1
| | | | | | condition (oops) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5183 e03df62e-2008-0410-955e-edbf42e46eb7
* Add sane limiting to mode output, so we cant have more than 100 mode chars ↵Gravatar brain2006-09-091-0/+10
| | | | | | in the sequence string, or MAXMODES parameters for the modes, or a total length of params+sequence beyond 450. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5182 e03df62e-2008-0410-955e-edbf42e46eb7
* m_override is now fixed, replaced AC_GENERAL_MODE OnAccessCheck eventGravatar brain2006-09-091-8/+16
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5180 e03df62e-2008-0410-955e-edbf42e46eb7
* Add /RELOAD and move cmd_mode into its own command.Gravatar brain2006-09-031-11/+0
| | | | | | | /RELOAD is the only thing you cant reload (ahem) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5119 e03df62e-2008-0410-955e-edbf42e46eb7
* Allow unloading of modules which implement modes!Gravatar brain2006-09-021-0/+76
| | | | | | | The default implementation of the new system will remove simplemodes so any mode handler which is just a simple mode (no params and not a list mode) does not need to add much more than one line of code and remove its VF_STATIC flag. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5100 e03df62e-2008-0410-955e-edbf42e46eb7
* In this instance find is faster than rfindGravatar brain2006-08-301-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5086 e03df62e-2008-0410-955e-edbf42e46eb7
* And make it work hereGravatar brain2006-08-301-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5085 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix for parameters which contain a colon (which is not the first char in ↵Gravatar brain2006-08-301-1/+1
| | | | | | the string) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5084 e03df62e-2008-0410-955e-edbf42e46eb7
* Wahhhhhhhhhhhh bwahahaha. Mass commit to tidy up tons of messy include listsGravatar brain2006-08-301-8/+0
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5080 e03df62e-2008-0410-955e-edbf42e46eb7