Commit Graph

122 Commits

Author SHA1 Message Date
psychon
860ccb7dec Remove/fix some dead code
All of this was found via warnings ("remarks") from icc.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1435 726aef4b-f618-498e-8847-2d620e286838
2009-03-20 10:00:31 +00:00
silverleo
28b23955b4 Added raw 432 processing for illegal and erroneous nicks and changed the condition to trigger SendAltNick() since ircds like to interpret the standards.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1425 726aef4b-f618-498e-8847-2d620e286838
2009-03-13 17:24:36 +00:00
psychon
e302611bd3 Only add WALLOPS to the buffer if no client is attached
Thanks to flakes for finding this.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1405 726aef4b-f618-498e-8847-2d620e286838
2009-03-01 13:07:11 +00:00
psychon
ba5610654b Improve the error messages we give for failed connect attempts... again
EADDRNOTAVAIL is generated for these failed vhosts instead of EDOM as it did
before. Yay for Csocket.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1367 726aef4b-f618-498e-8847-2d620e286838
2009-02-03 18:21:33 +00:00
psychon
235b10c200 Use that new define everywhere
Now there are no uses of DEBUG_ONLY() left :(


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1349 726aef4b-f618-498e-8847-2d620e286838
2009-01-25 16:51:54 +00:00
psychon
abc0cf82c5 Handle JOIN redirects due to +L
Without this, ZNC would keep trying to join the channel which is full
and which caused the redirect.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1327 726aef4b-f618-498e-8847-2d620e286838
2009-01-11 08:47:27 +00:00
psychon
9a3ff5f851 Update channel buffers for detached channels
Now ZNC produces a normal buffer playback if you re-attach a detached channel.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1325 726aef4b-f618-498e-8847-2d620e286838
2009-01-09 17:22:15 +00:00
psychon
9933ba9c3e Use CString::TrimRight() to make this code more readable
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1321 726aef4b-f618-498e-8847-2d620e286838
2009-01-05 11:45:12 +00:00
psychon
607a7f1c16 Get rid of most strtoul() and atoi() calls and use CString's features instead
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1320 726aef4b-f618-498e-8847-2d620e286838
2009-01-04 10:48:02 +00:00
psychon
08ad0291ea Happy New Year 2009 everyone!
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1317 726aef4b-f618-498e-8847-2d620e286838
2009-01-01 12:22:21 +00:00
silverleo
cc3fcc17bb Block pong replies that we requested.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1309 726aef4b-f618-498e-8847-2d620e286838
2008-12-29 18:43:47 +00:00
psychon
7ba58aba72 Make CChan smaller
This is mostly done by removing unused members, but there is also removes a
cache which saved how many opped, voiced etc users are on a channel.
This shouldn't result in a big slowdown, since this data is only ever used
for /msg *status listchans.
Also, this replaces the API to access this data with a version which should
be faster especially for big channels.

On amd64 the size of CChan was 600 bytes before and is 400 bytes now.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1301 726aef4b-f618-498e-8847-2d620e286838
2008-12-23 10:07:54 +00:00
silverleo
110485eaaf Changed ping timers and timeout settings to use more reasonable values. Also changed timeout type for irc and client sockets.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1297 726aef4b-f618-498e-8847-2d620e286838
2008-12-21 09:03:04 +00:00
silverleo
c71565103c Added OnIRCRegistration(). Patch from Freman. Thanks :)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1271 726aef4b-f618-498e-8847-2d620e286838
2008-11-24 17:56:34 +00:00
kroimon
5237a24747 Use CString::Equals() everywhere.
* (CString::CaseCmp() == 0) became CString::Equals()
* (CString::CaseCmp() != 0) became !CString::Equals()
* replaced some occurrences of strn?casecmp

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1234 726aef4b-f618-498e-8847-2d620e286838
2008-09-30 15:15:59 +00:00
psychon
18ce52e32d Limit the maximal read buffer space that is used for every socket
CSocket caches the data read from a socket and then looks for lines in there.
If there is no line end, this buffer can grow quite large. This patch now
closes sockets if they get a huge read buffer.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1233 726aef4b-f618-498e-8847-2d620e286838
2008-09-30 14:43:51 +00:00
psychon
03e34ac6e6 Remove KeepNick
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1151 726aef4b-f618-498e-8847-2d620e286838
2008-07-24 11:34:11 +00:00
psychon
30404699e3 Handle the on-connect 433 in an own function
When our primary nick is already taken, we try a couple of different nicks in
order to be able to connect to the IRC server. This code is now in an
own function.

BTW: CIRCSock::Readline() is still waaay too long.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1149 726aef4b-f618-498e-8847-2d620e286838
2008-07-24 10:34:15 +00:00
psychon
cd2fb1b1b5 Move the forwarding of raw 353 into an own function
This also contains some minor changes to the code. One of those is that we now
also handle namesx and uhnames for channels we don't know.
BTW: CIRCSock::ReadLine() is waaay too long.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1148 726aef4b-f618-498e-8847-2d620e286838
2008-07-24 10:22:17 +00:00
psychon
1a1cc4c756 We are in a channel when we received the JOIN for it, not it's "end of /names"
This moves some calls from the raw 366 handler to the JOIN handler and it might
even fix a bug (well, which no one would ever have triggered).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1140 726aef4b-f618-498e-8847-2d620e286838
2008-07-21 10:15:16 +00:00
psychon
e2cb9b41e0 Please just ignore this commit and pretend the previous commit already did this
I'm ashamed...


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1119 726aef4b-f618-498e-8847-2d620e286838
2008-07-08 10:24:48 +00:00
psychon
b141ef44b6 Fix a crash with NAMESX
If we were joining a channel on a server with NAMESX support while a client was
connected that didn't know NAMESX and we received a raw 353 with a trailing
whitespace (UnrealIRCd does this), we were calling std::string::at(0) for an
empty string, which caused some assert to fail and ZNC to die.

This patch fixes this crash bug.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1118 726aef4b-f618-498e-8847-2d620e286838
2008-07-08 10:00:42 +00:00
psychon
9e5ec2d563 CIRCSock: Only say we are reconnecting if there is a server to connect to
If you '/msg *status delserver'd your last server, you would get a message
saying ZNC will reconnect, but it didn't. Now those messages look much better.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1117 726aef4b-f618-498e-8847-2d620e286838
2008-07-08 09:38:50 +00:00
psychon
9e6d05a0bd Remove some unneeded includes from DCCBounce.h
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1106 726aef4b-f618-498e-8847-2d620e286838
2008-06-27 09:27:34 +00:00
psychon
0f3f305a87 Use ExpandString() for CTCPReply
You can now use 'wildcards' like %nick%, %user%, etc in CTCPReply


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1096 726aef4b-f618-498e-8847-2d620e286838
2008-06-17 08:22:27 +00:00
psychon
91eefcf87b Fix a bug introduced by SilverLeo :P
If a topic was unset, this wasn't forwarded to the client the way it should be.

Thanks to SilverLeo for the patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1089 726aef4b-f618-498e-8847-2d620e286838
2008-06-08 09:43:21 +00:00
psychon
d701809ac1 Allow the OnTopic module call to modify the topic
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1085 726aef4b-f618-498e-8847-2d620e286838
2008-06-06 14:26:04 +00:00
psychon
2583b7e9ff Handle channel CTCP the same way we do for private CTCPs
This patch doesn't actually change anything for private CTCPs, it's
only the indentation level that changes! (Well, and that this code gets
its own function...)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1082 726aef4b-f618-498e-8847-2d620e286838
2008-06-03 07:15:52 +00:00
psychon
ff7a6c231a Remove some unneedef #ifdef's
MODULECALL doesn't need to be wrapped in #ifdef _MODULES, since main.h
already does this.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1049 726aef4b-f618-498e-8847-2d620e286838
2008-05-10 15:09:46 +00:00
psychon
7d0314f416 *Always* forward our own nick changes to clients
Thanks to SilverLeo for finding and debugging this one.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1037 726aef4b-f618-498e-8847-2d620e286838
2008-05-04 14:55:21 +00:00
psychon
c64d7bc108 Force a space between if, for, while and (
This was done via:
   sed -ir 's/if(/if (/g; s/for(/for (/g; s/while(/while (/g' \
        *.h *.cpp modules/*.cpp



git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1030 726aef4b-f618-498e-8847-2d620e286838
2008-04-20 13:08:44 +00:00
psychon
011ddfe499 Fix some stupid bug which even GCC found and warned on
Yeah, I *really* feel stupid for letting something like this slip :(


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1024 726aef4b-f618-498e-8847-2d620e286838
2008-04-17 15:52:55 +00:00
psychon
5f293039b5 Display better error messages if we can't connect to IRC
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1023 726aef4b-f618-498e-8847-2d620e286838
2008-04-16 19:46:26 +00:00
psychon
0a5d3013d2 Add OnTopic() module call
Thanks to SilverLeo, again.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1011 726aef4b-f618-498e-8847-2d620e286838
2008-04-01 09:03:17 +00:00
psychon
54867320dc Fix sf bug #1915864 (patch from x-x)
If you do /names #chan when you are not in #chan, you never got
the reply.

Thanks to Xaquseg for reporting.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@990 726aef4b-f618-498e-8847-2d620e286838
2008-03-22 18:39:11 +00:00
psychon
7c56ddd603 Don't forward TOPIC changes for detached channels
Thanks to JamesOff (:P) for reporting.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@976 726aef4b-f618-498e-8847-2d620e286838
2008-03-04 18:12:46 +00:00
psychon
8f22dcc60d Fix all those warnings from -Wshadow
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@964 726aef4b-f618-498e-8847-2d620e286838
2008-02-19 20:25:21 +00:00
psychon
e72c445694 Clean up includes
All the headers are now self-contained (g++ Header.h -o /dev/null).

Some system headers where moved to the .cpp they are actually needed in,
some of our own headers are includes less. (Especially MD5.h)

Headers are sorted alphabetically while in e.g. FileUtils.cpp FileUtils.h
is the first file included.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@915 726aef4b-f618-498e-8847-2d620e286838
2008-01-07 21:31:16 +00:00
psychon
eeec633e30 Update copyright header for 2008
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@910 726aef4b-f618-498e-8847-2d620e286838
2008-01-07 21:13:07 +00:00
psychon
d78369fee0 Main part is: Add disconnect and connect to *status
Other stuff included here:
- Always send the quit message when disconnecting from IRC
- Partly rewrite CConnectUserTimer::RunJob() for some de-uglification


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@874 726aef4b-f618-498e-8847-2d620e286838
2007-11-16 22:37:27 +00:00
psychon
65eb10a30e Make 'CTCPReply = VERSION' in the config cause ZNC to ignore CTCP VERSIONs
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@871 726aef4b-f618-498e-8847-2d620e286838
2007-11-12 21:32:29 +00:00
psychon
936c8f1cc9 Fix NAMESX / UHNAMES, round two (I already did so once -.-)
Only the first client having either one enabled got a proper reply, all the
following ones got an empty one.

And btw prettify this code a little. (That Token() stuff is gone)

(More lines removed then added if you dont count comments)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@857 726aef4b-f618-498e-8847-2d620e286838
2007-10-29 11:11:25 +00:00
psychon
434231f530 Fix a mem leak in ZNC core
CUser::DelChan() didn't actually delete anything, so if you joined much... well


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@856 726aef4b-f618-498e-8847-2d620e286838
2007-10-28 18:11:44 +00:00
psychon
87d19870cd Merge sf.net patch 1812367 'Disable auto-rejoin on kick'
This removes the rejoin from core (the channel gets disabled) and adds
a kickrejoin module.

Thanks to cycomate for the original patch


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@852 726aef4b-f618-498e-8847-2d620e286838
2007-10-24 17:44:12 +00:00
psychon
5993255ac3 Fix some ICC warnings found by Kuja
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@846 726aef4b-f618-498e-8847-2d620e286838
2007-09-27 21:00:08 +00:00
psychon
a09a7e79f6 Switch to the copyright headers the GPLv2 wants us to have
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@843 726aef4b-f618-498e-8847-2d620e286838
2007-09-21 18:55:33 +00:00
psychon
c0e3f3bb03 Add JoinTries config var which sets a limit for channel join tries to avoid
flood issues. This var defaults to 0 which means 'No Limit'.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@811 726aef4b-f618-498e-8847-2d620e286838
2007-07-04 20:15:10 +00:00
psychon
b772e2664e Merged rev 838,888,890,894,899,900,902-904,926,934,963,984-989 from crox's branch:
- Changes to specfile
- define PATH_MAX and RTLD_LOCAL if not defines
- compile fixes
- SetFileName should not set m_iFD
- check for cygwin and do not use -fPIC
- replaced if ... elif with case in configure.in
- handle 437 reply code
- allow disabled channels
- use strerror() in CIRCSock::SockError()
- added GetUser() to CClient and CIRCSock
- added support for traffic accounting
- added names to timers


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@806 726aef4b-f618-498e-8847-2d620e286838
2007-05-17 19:09:17 +00:00
psychon
d82eb75d1c merge rev 962;965;972-975:
- increased select timeout to 0.5 secs (this should save CPU time)
- added real-life ISpoof example to the example znc.conf
- make away module ignore message from the user (fixes antiidle together with away)
- show error message when webadmin cant bind to a port (improved later)
- fix /me, it was turned into a CTCP
- remove an extra space


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@802 726aef4b-f618-498e-8847-2d620e286838
2007-05-16 22:35:17 +00:00
psychon
9b671ee976 merge rev 936, 939-943 from psychon branch:
- if a client connected before znc connected to irc and if it uses a wrong nick it
   wasnt informed of this -> fixed
- znc.cpp didnt work with --disable-modules
- some stuff which was already merged previously


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@800 726aef4b-f618-498e-8847-2d620e286838
2007-05-16 22:20:10 +00:00